@@ -516,43 +516,46 @@ describe('BrowserWindow module', () => {
516
516
517
517
describe ( 'BrowserWindow.moveTop()' , ( ) => {
518
518
it ( 'should not steal focus' , async ( ) => {
519
+ console . log ( 'should not steal focus 1' )
519
520
const posDelta = 50
520
521
const wShownInactive = emittedOnce ( w , 'show' )
521
522
w . showInactive ( )
522
523
await wShownInactive
523
524
assert ( ! w . isFocused ( ) )
524
-
525
+ console . log ( 'should not steal focus 2' )
525
526
const otherWindow = new BrowserWindow ( { show : false , title : 'otherWindow' } )
526
527
const otherWindowShown = emittedOnce ( otherWindow , 'show' )
527
528
otherWindow . loadURL ( 'data:text/html,<html><body background-color: rgba(255,255,255,0)></body></html>' )
528
529
otherWindow . show ( )
529
530
await otherWindowShown
530
531
assert ( otherWindow . isFocused ( ) )
531
-
532
+ console . log ( 'should not steal focus 3' )
532
533
w . moveTop ( )
533
534
const wPos = w . getPosition ( )
534
535
const wMoving = emittedOnce ( w , 'move' )
535
536
w . setPosition ( wPos [ 0 ] + posDelta , wPos [ 1 ] + posDelta )
536
537
await wMoving
537
538
assert ( ! w . isFocused ( ) )
538
539
assert ( otherWindow . isFocused ( ) )
539
-
540
+ console . log ( 'should not steal focus 4' )
540
541
const wFocused = emittedOnce ( w , 'focus' )
541
542
w . focus ( )
542
543
await wFocused
543
544
assert ( w . isFocused ( ) )
544
-
545
+ console . log ( 'should not steal focus 5' )
545
546
otherWindow . moveTop ( )
546
547
const otherWindowPos = otherWindow . getPosition ( )
547
548
const otherWindowMoving = emittedOnce ( otherWindow , 'move' )
548
549
otherWindow . setPosition ( otherWindowPos [ 0 ] + posDelta , otherWindowPos [ 1 ] + posDelta )
549
550
await otherWindowMoving
550
551
assert ( ! otherWindow . isFocused ( ) )
551
552
assert ( w . isFocused ( ) )
552
-
553
+ console . log ( 'should not steal focus 6' )
553
554
await closeWindow ( otherWindow , { assertSingleWindow : false } ) . then ( ( ) => {
555
+ console . log ( 'should not steal focus 7' )
554
556
assert . strictEqual ( BrowserWindow . getAllWindows ( ) . length , 2 ) // Test window + w
555
557
} )
558
+ console . log ( 'should not steal focus 8' )
556
559
} )
557
560
} )
558
561
0 commit comments