@@ -62,47 +62,52 @@ void main() {
6262 skip: Platform .isWindows,
6363 );
6464
65- test ('can not launch devtools for the same app in multiple tabs' ,
66- () async {
67- final appUrl = await context.webDriver.currentUrl;
68- // Open a new tab, select it, and navigate to the app
69- await context.webDriver.driver
70- .execute ("window.open('$appUrl ', '_blank');" , []);
71- await Future .delayed (const Duration (seconds: 2 ));
72- final newAppWindow = await context.webDriver.windows.last;
73- await newAppWindow.setAsActive ();
74-
75- // Wait for the page to be ready before trying to open DevTools again.
76- await _waitForPageReady (context);
77-
78- // Try to open devtools and check for the alert.
79- await context.webDriver.driver.keyboard.sendChord ([Keyboard .alt, 'd' ]);
80- await Future .delayed (const Duration (seconds: 2 ));
81- final alert = context.webDriver.driver.switchTo.alert;
82- expect (alert, isNotNull);
83- expect (
84- await alert.text,
85- contains ('This app is already being debugged in a different tab' ),
86- );
87- await alert.accept ();
88-
89- var windows = await context.webDriver.windows.toList ();
90- for (final window in windows) {
91- if (window.id != newAppWindow.id) {
92- await window.setAsActive ();
93- await window.close ();
65+ test (
66+ 'can not launch devtools for the same app in multiple tabs' ,
67+ () async {
68+ final appUrl = await context.webDriver.currentUrl;
69+ // Open a new tab, select it, and navigate to the app
70+ await context.webDriver.driver
71+ .execute ("window.open('$appUrl ', '_blank');" , []);
72+ await Future .delayed (const Duration (seconds: 2 ));
73+ final newAppWindow = await context.webDriver.windows.last;
74+ await newAppWindow.setAsActive ();
75+
76+ // Wait for the page to be ready before trying to open DevTools again.
77+ await _waitForPageReady (context);
78+
79+ // Try to open devtools and check for the alert.
80+ await context.webDriver.driver.keyboard
81+ .sendChord ([Keyboard .alt, 'd' ]);
82+ await Future .delayed (const Duration (seconds: 2 ));
83+ final alert = context.webDriver.driver.switchTo.alert;
84+ expect (alert, isNotNull);
85+ expect (
86+ await alert.text,
87+ contains ('This app is already being debugged in a different tab' ),
88+ );
89+ await alert.accept ();
90+
91+ var windows = await context.webDriver.windows.toList ();
92+ for (final window in windows) {
93+ if (window.id != newAppWindow.id) {
94+ await window.setAsActive ();
95+ await window.close ();
96+ }
9497 }
95- }
9698
97- await newAppWindow.setAsActive ();
98- await context.webDriver.driver.keyboard.sendChord ([Keyboard .alt, 'd' ]);
99- await Future .delayed (const Duration (seconds: 2 ));
100- windows = await context.webDriver.windows.toList ();
101- final devToolsWindow =
102- windows.firstWhere ((window) => window != newAppWindow);
103- await devToolsWindow.setAsActive ();
104- expect (await context.webDriver.pageSource, contains ('DevTools' ));
105- });
99+ await newAppWindow.setAsActive ();
100+ await context.webDriver.driver.keyboard
101+ .sendChord ([Keyboard .alt, 'd' ]);
102+ await Future .delayed (const Duration (seconds: 2 ));
103+ windows = await context.webDriver.windows.toList ();
104+ final devToolsWindow =
105+ windows.firstWhere ((window) => window != newAppWindow);
106+ await devToolsWindow.setAsActive ();
107+ expect (await context.webDriver.pageSource, contains ('DevTools' ));
108+ },
109+ skip: 'See https://github.com/dart-lang/webdev/issues/2462' ,
110+ );
106111
107112 test (
108113 'destroys and recreates the isolate during a page refresh' ,
0 commit comments