1
1
<!DOCTYPE html>
2
2
< html style ="width: 100%; height: 100%; ">
3
- < head >
4
- < meta charset ="utf-8 ">
5
- < title > Scheduler Test Page</ title >
3
+
4
+ < head >
5
+ < meta charset ="utf-8 ">
6
+ < title > Scheduler Test Page</ title >
6
7
< style >
7
8
.correct {
8
9
border : solid green 2px ;
11
12
border : dashed red 2px ;
12
13
}
13
14
</ style >
14
- </ head >
15
- < body >
16
- < h1 > Scheduler Fixture</ h1 >
17
- < p >
18
- This fixture is for manual testing purposes, and the patterns used in
19
- implementing it should not be used as a model. This is mainly for anyone
20
- working on making changes to the `schedule` module.
21
- </ p >
22
- < h2 > Tests:</ h2 >
23
- < ol >
24
- < li >
25
- < button onClick ="runTestOne() "> Run Test 1</ button >
26
- < p > Calls the callback within the frame when not blocked:</ p >
27
- < div > < b > Expected:</ b > </ div >
28
- < div id ="test-1-expected ">
29
- </ div >
30
- < div > -------------------------------------------------</ div >
31
- < div > If you see the same above and below it's correct.
15
+ </ head >
16
+
17
+ < body >
18
+ < h1 > Scheduler Fixture</ h1 >
19
+ < p >
20
+ This fixture is for manual testing purposes, and the patterns used in
21
+ implementing it should not be used as a model. This is mainly for anyone
22
+ working on making changes to the `schedule` module.
23
+ </ p >
24
+ < h2 > Tests:</ h2 >
25
+ < ol >
26
+ < li >
27
+ < button onClick ="runTestOne() "> Run Test 1</ button >
28
+ < p > Calls the callback within the frame when not blocked:</ p >
29
+ < div > < b > Expected:</ b > </ div >
30
+ < div id ="test-1-expected ">
31
+ </ div >
32
+ < div > -------------------------------------------------</ div >
33
+ < div > If you see the same above and below it's correct.
32
34
< div > -------------------------------------------------</ div >
33
35
< div > < b > Actual:</ b > </ div >
34
36
< div id ="test-1 "> </ div >
35
- </ li >
36
- < li >
37
- < p > Accepts multiple callbacks and calls within frame when not blocked</ p >
38
- < button onClick ="runTestTwo() "> Run Test 2</ button >
39
- < div > < b > Expected:</ b > </ div >
40
- < div id ="test-2-expected ">
41
- </ div >
42
- < div > -------------------------------------------------</ div >
43
- < div > If you see the same above and below it's correct.
37
+ </ li >
38
+ < li >
39
+ < p > Accepts multiple callbacks and calls within frame when not blocked</ p >
40
+ < button onClick ="runTestTwo() "> Run Test 2</ button >
41
+ < div > < b > Expected:</ b > </ div >
42
+ < div id ="test-2-expected ">
43
+ </ div >
44
+ < div > -------------------------------------------------</ div >
45
+ < div > If you see the same above and below it's correct.
44
46
< div > -------------------------------------------------</ div >
45
47
< div > < b > Actual:</ b > </ div >
46
48
< div id ="test-2 "> </ div >
47
- </ li >
48
- < li >
49
- < p > Schedules callbacks in correct order when they use scheduleWork to schedule themselves</ p >
50
- < button onClick ="runTestThree() "> Run Test 3</ button >
51
- < div > < b > Expected:</ b > </ div >
52
- < div id ="test-3-expected ">
53
- </ div >
54
- < div > -------------------------------------------------</ div >
55
- < div > If you see the same above and below it's correct.
49
+ </ li >
50
+ < li >
51
+ < p > Schedules callbacks in correct order when they use scheduleWork to schedule themselves</ p >
52
+ < button onClick ="runTestThree() "> Run Test 3</ button >
53
+ < div > < b > Expected:</ b > </ div >
54
+ < div id ="test-3-expected ">
55
+ </ div >
56
+ < div > -------------------------------------------------</ div >
57
+ < div > If you see the same above and below it's correct.
56
58
< div > -------------------------------------------------</ div >
57
59
< div > < b > Actual:</ b > </ div >
58
60
< div id ="test-3 "> </ div >
59
- </ li >
60
- < li >
61
- < p > Calls timed out callbacks and then any more pending callbacks, defers others if time runs out</ p >
62
- < button onClick ="runTestFour() "> Run Test 4</ button >
63
- < div > < b > Expected:</ b > </ div >
64
- < div id ="test-4-expected ">
65
- </ div >
66
- < div > -------------------------------------------------</ div >
67
- < div > If you see the same above and below it's correct.
61
+ </ li >
62
+ < li >
63
+ < p > Calls timed out callbacks and then any more pending callbacks, defers others if time runs out</ p >
64
+ < button onClick ="runTestFour() "> Run Test 4</ button >
65
+ < div > < b > Expected:</ b > </ div >
66
+ < div id ="test-4-expected ">
67
+ </ div >
68
+ < div > -------------------------------------------------</ div >
69
+ < div > If you see the same above and below it's correct.
68
70
< div > -------------------------------------------------</ div >
69
71
< div > < b > Actual:</ b > </ div >
70
72
< div id ="test-4 "> </ div >
71
- </ li >
72
- < li >
73
- < p > When some callbacks throw errors, still calls them all within the same frame</ p >
74
- < p > < b > IMPORTANT:</ b > Open the console when you run this! Inspect the logs there!</ p >
75
- < button onClick ="runTestFive() "> Run Test 5</ button >
76
- </ li >
77
- < li >
78
- < p > When some callbacks throw errors < b > and some also time out</ b > , still calls them all within the same frame</ p >
79
- < p > < b > IMPORTANT:</ b > Open the console when you run this! Inspect the logs there!</ p >
80
- < button onClick ="runTestSix() "> Run Test 6</ button >
81
- </ li >
82
- < li >
83
- < p > Continues calling callbacks even when user switches away from this tab</ p >
84
- < button onClick ="runTestSeven() "> Run Test 7</ button >
85
- < div > < b > Click the button above, observe the counter, then switch to
86
- another tab and switch back:</ b > </ div >
87
- < div id ="test-7 ">
88
- </ div >
89
- < div > If the counter advanced while you were away from this tab, it's correct.</ div >
90
- </ li >
91
- </ ol >
92
- < script src ="../../build/dist/react.development.js "> </ script >
93
- < script src ="../../build/node_modules/scheduler/umd/scheduler.development.js "> </ script >
94
- < script src ="https://unpkg.com/babel-standalone@6/babel.js "> </ script >
95
- < script type ="text/babel ">
73
+ </ li >
74
+ < li >
75
+ < p > When some callbacks throw errors, still calls them all within the same frame</ p >
76
+ < p > < b > IMPORTANT:</ b > Open the console when you run this! Inspect the logs there!</ p >
77
+ < button onClick ="runTestFive() "> Run Test 5</ button >
78
+ </ li >
79
+ < li >
80
+ < p > When some callbacks throw errors < b > and some also time out</ b > , still calls them all within the same frame</ p >
81
+ < p > < b > IMPORTANT:</ b > Open the console when you run this! Inspect the logs there!</ p >
82
+ < button onClick ="runTestSix() "> Run Test 6</ button >
83
+ </ li >
84
+ < li >
85
+ < p > Continues calling callbacks even when user switches away from this tab</ p >
86
+ < button onClick ="runTestSeven() "> Run Test 7</ button >
87
+ < div > < b > Click the button above, observe the counter, then switch to
88
+ another tab and switch back:</ b > </ div >
89
+ < div id ="test-7 ">
90
+ </ div >
91
+ < div > If the counter advanced while you were away from this tab, it's correct.</ div >
92
+ </ li >
93
+ </ ol >
94
+ < script src ="../../build/dist/react.development.js "> </ script >
95
+ < script src ="../../build/node_modules/scheduler/umd/scheduler.development.js "> </ script >
96
+ < script src ="https://unpkg.com/babel-standalone@6/babel.js "> </ script >
97
+ < script type ="text/babel ">
96
98
const {
97
- unstable_scheduleWork : scheduleWork ,
98
- unstable_cancelWork : cancelWork ,
99
+ unstable_scheduleCallback : scheduleCallback ,
100
+ unstable_cancelCallback : cancelCallback ,
99
101
unstable_now : now
100
102
} = Scheduler ;
101
103
function displayTestResult ( testNumber ) {
@@ -496,4 +498,4 @@ <h2>Tests:</h2>
496
498
}
497
499
</ script type="text/babel">
498
500
</ body >
499
- </ html >
501
+ </ html >
0 commit comments