Fix scheduler fixture
Dan Abramov committed
Oct 23, 2018 at 16:35 UTC
0cc50b675ae55fef687f4cb01293849fc49539e7
1 file changed
+24
-24
fixtures/scheduler/index.html
+24
-24
@@ -48,7 +48,7 @@
48
<div id="test-2"></div>
49
</li>
50
<li>
51
- <p>Schedules callbacks in correct order when they use scheduleWork to schedule themselves</p>
51
+ <p>Schedules callbacks in correct order when they use scheduleCallback to schedule themselves</p>
52
<button onClick="runTestThree()">Run Test 3</button>
53
<div><b>Expected:</b></div>
54
<div id="test-3-expected">
@@ -225,7 +225,7 @@ function runTestOne() {
225
const cb1 = (x) => {
226
updateTestResult(1, 'cb1 called with argument of ' + JSON.stringify(x));
227
}
228
- scheduleWork(cb1);
228
+ scheduleCallback(cb1);
229
updateTestResult(1, 'scheduled Cb1');
230
logWhenFramesStart(1, () => {
231
displayTestResult(1);
@@ -243,9 +243,9 @@ function runTestTwo() {
243
const cbB = (x) => {
244
updateTestResult(2, 'cbB called with argument of ' + JSON.stringify(x));
245
}
246
- scheduleWork(cbA);
246
+ scheduleCallback(cbA);
247
updateTestResult(2, 'scheduled CbA');
248
- scheduleWork(cbB);
248
+ scheduleCallback(cbB);
249
updateTestResult(2, 'scheduled CbB');
250
logWhenFramesStart(2, () => {
251
displayTestResult(2);
@@ -255,12 +255,12 @@ function runTestTwo() {
255
256
function runTestThree() {
257
// Test 3
258
- // Schedules callbacks in correct order when they use scheduleWork to schedule themselves
258
+ // Schedules callbacks in correct order when they use scheduleCallback to schedule themselves
259
clearTestResult(3);
260
let callbackAIterations = 0;
261
const cbA = (x) => {
262
if (callbackAIterations < 1) {
263
- scheduleWork(cbA);
263
+ scheduleCallback(cbA);
264
updateTestResult(3, 'scheduled CbA again');
265
}
266
updateTestResult(3, 'cbA' + callbackAIterations + ' called with argument of ' + JSON.stringify(x));
@@ -269,9 +269,9 @@ function runTestThree() {
269
const cbB = (x) => {
270
updateTestResult(3, 'cbB called with argument of ' + JSON.stringify(x));
271
}
272
- scheduleWork(cbA);
272
+ scheduleCallback(cbA);
273
updateTestResult(3, 'scheduled CbA');
274
- scheduleWork(cbB);
274
+ scheduleCallback(cbB);
275
updateTestResult(3, 'scheduled CbB');
276
logWhenFramesStart(3, () => {
277
displayTestResult(3);
@@ -305,13 +305,13 @@ function runTestFour() {
305
const cbD = (x) => {
306
updateTestResult(4, 'cbD called with argument of ' + JSON.stringify(x));
307
}
308
- scheduleWork(cbA); // won't time out
308
+ scheduleCallback(cbA); // won't time out
309
updateTestResult(4, 'scheduled cbA');
310
- scheduleWork(cbB, {timeout: 100}); // times out later
310
+ scheduleCallback(cbB, {timeout: 100}); // times out later
311
updateTestResult(4, 'scheduled cbB');
312
- scheduleWork(cbC, {timeout: 1}); // will time out fast
312
+ scheduleCallback(cbC, {timeout: 1}); // will time out fast
313
updateTestResult(4, 'scheduled cbC');
314
- scheduleWork(cbD); // won't time out
314
+ scheduleCallback(cbD); // won't time out
315
updateTestResult(4, 'scheduled cbD');
316
317
// should have run in order of C, A, B, D
@@ -390,15 +390,15 @@ function runTestFive() {
390
});
391
});
392
});
393
- scheduleWork(cbA);
393
+ scheduleCallback(cbA);
394
console.log('scheduled cbA');
395
- scheduleWork(cbB); // will throw error
395
+ scheduleCallback(cbB); // will throw error
396
console.log('scheduled cbB');
397
- scheduleWork(cbC);
397
+ scheduleCallback(cbC);
398
console.log('scheduled cbC');
399
- scheduleWork(cbD); // will throw error
399
+ scheduleCallback(cbD); // will throw error
400
console.log('scheduled cbD');
401
- scheduleWork(cbE);
401
+ scheduleCallback(cbE);
402
console.log('scheduled cbE');
403
};
404
}
@@ -468,15 +468,15 @@ function runTestSix() {
468
});
469
});
470
});
471
- scheduleWork(cbA);
471
+ scheduleCallback(cbA);
472
console.log('scheduled cbA');
473
- scheduleWork(cbB); // will throw error
473
+ scheduleCallback(cbB); // will throw error
474
console.log('scheduled cbB');
475
- scheduleWork(cbC, {timeout: 1});
475
+ scheduleCallback(cbC, {timeout: 1});
476
console.log('scheduled cbC');
477
- scheduleWork(cbD, {timeout: 1}); // will throw error
477
+ scheduleCallback(cbD, {timeout: 1}); // will throw error
478
console.log('scheduled cbD');
479
- scheduleWork(cbE, {timeout: 1});
479
+ scheduleCallback(cbE, {timeout: 1});
480
console.log('scheduled cbE');
481
};
482
}
@@ -492,9 +492,9 @@ function runTestSeven() {
492
counter++;
493
counterNode.innerHTML = counter;
494
waitForTimeToPass(100);
495
- scheduleWork(incrementCounterAndScheduleNextCallback);
495
+ scheduleCallback(incrementCounterAndScheduleNextCallback);
496
}
497
- scheduleWork(incrementCounterAndScheduleNextCallback);
497
+ scheduleCallback(incrementCounterAndScheduleNextCallback);
498
}
499
</script type="text/babel">
500
</body>