Skip to content

Commit 564c7e9

Browse files
committed
Add expiration to fuzz tester
1 parent 320d71d commit 564c7e9

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/renderers/shared/fiber/ReactFiberBeginWork.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
330330
}
331331

332332
function updateHostRoot(current, workInProgress, renderExpirationTime) {
333-
const root = (workInProgress.stateNode: FiberRoot);
334333
pushHostRootContext(workInProgress);
335334
const updateQueue = workInProgress.updateQueue;
336335
if (updateQueue !== null) {

src/renderers/shared/fiber/__tests__/ReactIncrementalTriangle-test.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ describe('ReactIncrementalTriangle', () => {
5454
};
5555
}
5656

57+
const EXPIRE = 'EXPIRE';
58+
function expire(ms) {
59+
return {
60+
type: EXPIRE,
61+
ms,
62+
};
63+
}
64+
5765
function TriangleSimulator() {
5866
let triangles = [];
5967
let leafTriangles = [];
@@ -212,6 +220,9 @@ describe('ReactIncrementalTriangle', () => {
212220
targetTriangle.activate();
213221
}
214222
break;
223+
case EXPIRE:
224+
ReactNoop.expire(action.ms);
225+
break;
215226
default:
216227
break;
217228
}
@@ -251,7 +262,7 @@ describe('ReactIncrementalTriangle', () => {
251262
}
252263

253264
function randomAction() {
254-
switch (randomInteger(0, 4)) {
265+
switch (randomInteger(0, 5)) {
255266
case 0:
256267
return flush(randomInteger(0, totalTriangles * 1.5));
257268
case 1:
@@ -260,6 +271,8 @@ describe('ReactIncrementalTriangle', () => {
260271
return interrupt();
261272
case 3:
262273
return toggle(randomInteger(0, totalChildren));
274+
case 4:
275+
return expire(randomInteger(0, 1500));
263276
default:
264277
throw new Error('Switch statement should be exhaustive');
265278
}
@@ -290,6 +303,9 @@ describe('ReactIncrementalTriangle', () => {
290303
case TOGGLE:
291304
result += `toggle(${action.childIndex})`;
292305
break;
306+
case EXPIRE:
307+
result += `expire(${action.ms})`;
308+
break;
293309
default:
294310
throw new Error('Switch statement should be exhaustive');
295311
}

0 commit comments

Comments
 (0)