11
11
12
12
let runWithPriority ;
13
13
let ImmediatePriority ;
14
- let InteractivePriority ;
14
+ let UserBlockingPriority ;
15
15
let NormalPriority ;
16
16
let scheduleCallback ;
17
17
let cancelCallback ;
@@ -137,7 +137,7 @@ describe('Scheduler', () => {
137
137
const Schedule = require ( 'scheduler' ) ;
138
138
runWithPriority = Schedule . unstable_runWithPriority ;
139
139
ImmediatePriority = Schedule . unstable_ImmediatePriority ;
140
- InteractivePriority = Schedule . unstable_InteractivePriority ;
140
+ UserBlockingPriority = Schedule . unstable_UserBlockingPriority ;
141
141
NormalPriority = Schedule . unstable_NormalPriority ;
142
142
scheduleCallback = Schedule . unstable_scheduleCallback ;
143
143
cancelCallback = Schedule . unstable_cancelCallback ;
@@ -226,7 +226,7 @@ describe('Scheduler', () => {
226
226
// Yield before B is flushed
227
227
expect ( flushWork ( 100 ) ) . toEqual ( [ 'A' ] ) ;
228
228
229
- runWithPriority ( InteractivePriority , ( ) => {
229
+ runWithPriority ( UserBlockingPriority , ( ) => {
230
230
scheduleCallback ( ( ) => doWork ( 'C' , 100 ) ) ;
231
231
scheduleCallback ( ( ) => doWork ( 'D' , 100 ) ) ;
232
232
} ) ;
@@ -237,11 +237,11 @@ describe('Scheduler', () => {
237
237
238
238
it ( 'expires work' , ( ) => {
239
239
scheduleCallback ( ( ) => doWork ( 'A' , 100 ) ) ;
240
- runWithPriority ( InteractivePriority , ( ) => {
240
+ runWithPriority ( UserBlockingPriority , ( ) => {
241
241
scheduleCallback ( ( ) => doWork ( 'B' , 100 ) ) ;
242
242
} ) ;
243
243
scheduleCallback ( ( ) => doWork ( 'C' , 100 ) ) ;
244
- runWithPriority ( InteractivePriority , ( ) => {
244
+ runWithPriority ( UserBlockingPriority , ( ) => {
245
245
scheduleCallback ( ( ) => doWork ( 'D' , 100 ) ) ;
246
246
} ) ;
247
247
@@ -314,7 +314,7 @@ describe('Scheduler', () => {
314
314
} ;
315
315
316
316
// Schedule a high priority callback
317
- runWithPriority ( InteractivePriority , ( ) => scheduleCallback ( work ) ) ;
317
+ runWithPriority ( UserBlockingPriority , ( ) => scheduleCallback ( work ) ) ;
318
318
319
319
// Flush until just before the expiration time
320
320
expect ( flushWork ( 249 ) ) . toEqual ( [ 'A' , 'B' , 'Yield!' ] ) ;
@@ -325,7 +325,7 @@ describe('Scheduler', () => {
325
325
} ) ;
326
326
327
327
it ( 'nested callbacks inherit the priority of the currently executing callback' , ( ) => {
328
- runWithPriority ( InteractivePriority , ( ) => {
328
+ runWithPriority ( UserBlockingPriority , ( ) => {
329
329
scheduleCallback ( ( ) => {
330
330
doWork ( 'Parent callback' , 100 ) ;
331
331
scheduleCallback ( ( ) => {
@@ -336,7 +336,7 @@ describe('Scheduler', () => {
336
336
337
337
expect ( flushWork ( 100 ) ) . toEqual ( [ 'Parent callback' ] ) ;
338
338
339
- // The nested callback has interactive priority, so it should
339
+ // The nested callback has user-blocking priority, so it should
340
340
// expire quickly.
341
341
advanceTime ( 250 + 100 ) ;
342
342
expect ( clearYieldedValues ( ) ) . toEqual ( [ 'Nested callback' ] ) ;
@@ -360,7 +360,7 @@ describe('Scheduler', () => {
360
360
scheduleCallback ( work ) ;
361
361
expect ( flushWork ( 100 ) ) . toEqual ( [ 'A' , 'Yield!' ] ) ;
362
362
363
- runWithPriority ( InteractivePriority , ( ) => {
363
+ runWithPriority ( UserBlockingPriority , ( ) => {
364
364
scheduleCallback ( ( ) => doWork ( 'High pri' , 100 ) ) ;
365
365
} ) ;
366
366
@@ -379,7 +379,7 @@ describe('Scheduler', () => {
379
379
if ( task [ 0 ] === 'B' ) {
380
380
// Schedule high pri work from inside another callback
381
381
yieldValue ( 'Schedule high pri' ) ;
382
- runWithPriority ( InteractivePriority , ( ) =>
382
+ runWithPriority ( UserBlockingPriority , ( ) =>
383
383
scheduleCallback ( ( ) => doWork ( 'High pri' , 100 ) ) ,
384
384
) ;
385
385
}
@@ -438,24 +438,24 @@ describe('Scheduler', () => {
438
438
} ) ;
439
439
} ) ;
440
440
const wrappedInteractiveCallback = runWithPriority (
441
- InteractivePriority ,
441
+ UserBlockingPriority ,
442
442
( ) =>
443
443
wrapCallback ( ( ) => {
444
444
scheduleCallback ( ( ) => {
445
- doWork ( 'Interactive ' , 100 ) ;
445
+ doWork ( 'User-blocking ' , 100 ) ;
446
446
} ) ;
447
447
} ) ,
448
448
) ;
449
449
450
450
// This should schedule a normal callback
451
451
wrappedCallback ( ) ;
452
- // This should schedule an interactive callback
452
+ // This should schedule an user-blocking callback
453
453
wrappedInteractiveCallback ( ) ;
454
454
455
455
advanceTime ( 249 ) ;
456
456
expect ( clearYieldedValues ( ) ) . toEqual ( [ ] ) ;
457
457
advanceTime ( 1 ) ;
458
- expect ( clearYieldedValues ( ) ) . toEqual ( [ 'Interactive ' ] ) ;
458
+ expect ( clearYieldedValues ( ) ) . toEqual ( [ 'User-blocking ' ] ) ;
459
459
460
460
advanceTime ( 10000 ) ;
461
461
expect ( clearYieldedValues ( ) ) . toEqual ( [ 'Normal' ] ) ;
@@ -468,26 +468,26 @@ describe('Scheduler', () => {
468
468
} ) ;
469
469
} ) ;
470
470
const wrappedInteractiveCallback = runWithPriority (
471
- InteractivePriority ,
471
+ UserBlockingPriority ,
472
472
( ) =>
473
473
wrapCallback ( ( ) => {
474
474
scheduleCallback ( ( ) => {
475
- doWork ( 'Interactive ' , 100 ) ;
475
+ doWork ( 'User-blocking ' , 100 ) ;
476
476
} ) ;
477
477
} ) ,
478
478
) ;
479
479
480
- runWithPriority ( InteractivePriority , ( ) => {
480
+ runWithPriority ( UserBlockingPriority , ( ) => {
481
481
// This should schedule a normal callback
482
482
wrappedCallback ( ) ;
483
- // This should schedule an interactive callback
483
+ // This should schedule an user-blocking callback
484
484
wrappedInteractiveCallback ( ) ;
485
485
} ) ;
486
486
487
487
advanceTime ( 249 ) ;
488
488
expect ( clearYieldedValues ( ) ) . toEqual ( [ ] ) ;
489
489
advanceTime ( 1 ) ;
490
- expect ( clearYieldedValues ( ) ) . toEqual ( [ 'Interactive ' ] ) ;
490
+ expect ( clearYieldedValues ( ) ) . toEqual ( [ 'User-blocking ' ] ) ;
491
491
492
492
advanceTime ( 10000 ) ;
493
493
expect ( clearYieldedValues ( ) ) . toEqual ( [ 'Normal' ] ) ;
@@ -536,7 +536,7 @@ describe('Scheduler', () => {
536
536
yieldValue ( getCurrentPriorityLevel ( ) ) ;
537
537
runWithPriority ( NormalPriority , ( ) => {
538
538
yieldValue ( getCurrentPriorityLevel ( ) ) ;
539
- runWithPriority ( InteractivePriority , ( ) => {
539
+ runWithPriority ( UserBlockingPriority , ( ) => {
540
540
yieldValue ( getCurrentPriorityLevel ( ) ) ;
541
541
} ) ;
542
542
} ) ;
@@ -547,7 +547,7 @@ describe('Scheduler', () => {
547
547
NormalPriority ,
548
548
ImmediatePriority ,
549
549
NormalPriority ,
550
- InteractivePriority ,
550
+ UserBlockingPriority ,
551
551
ImmediatePriority ,
552
552
] ) ;
553
553
} ) ;
0 commit comments