|
8 | 8 | library;
|
9 | 9 |
|
10 | 10 | import 'dart:async';
|
| 11 | +import 'dart:io'; |
11 | 12 |
|
12 | 13 | import 'package:dwds/expression_compiler.dart';
|
13 | 14 | import 'package:test/test.dart';
|
@@ -358,46 +359,52 @@ void main() {
|
358 | 359 | },
|
359 | 360 | );
|
360 | 361 |
|
361 |
| - test('breakpoint in captured code is deleted', () async { |
362 |
| - var bp = await addBreakpoint( |
363 |
| - file: mainFile, |
364 |
| - breakpointMarker: capturedStringMarker, |
365 |
| - ); |
| 362 | + test( |
| 363 | + 'breakpoint in captured code is deleted', |
| 364 | + () async { |
| 365 | + var bp = await addBreakpoint( |
| 366 | + file: mainFile, |
| 367 | + breakpointMarker: capturedStringMarker, |
| 368 | + ); |
366 | 369 |
|
367 |
| - final oldLog = "log('\$mainValue');"; |
368 |
| - final newLog = "log('\${closure()}');"; |
369 |
| - await makeEditAndRecompile(mainFile, oldLog, newLog); |
| 370 | + final oldLog = "log('\$mainValue');"; |
| 371 | + final newLog = "log('\${closure()}');"; |
| 372 | + await makeEditAndRecompile(mainFile, oldLog, newLog); |
370 | 373 |
|
371 |
| - bp = |
372 |
| - (await hotReloadAndHandlePausePost([ |
373 |
| - (file: mainFile, breakpointMarker: capturedStringMarker, bp: bp), |
374 |
| - ])).first; |
| 374 | + bp = |
| 375 | + (await hotReloadAndHandlePausePost([ |
| 376 | + (file: mainFile, breakpointMarker: capturedStringMarker, bp: bp), |
| 377 | + ])).first; |
375 | 378 |
|
376 |
| - final breakpointFuture = waitForBreakpoint(); |
| 379 | + final breakpointFuture = waitForBreakpoint(); |
377 | 380 |
|
378 |
| - await callEvaluate(); |
| 381 | + await callEvaluate(); |
379 | 382 |
|
380 |
| - // Should break at `capturedString`. |
381 |
| - await breakpointFuture; |
382 |
| - final oldCapturedString = 'captured closure gen0'; |
383 |
| - // Closure gets evaluated for the first time. |
384 |
| - await resumeAndExpectLog(oldCapturedString); |
385 |
| - |
386 |
| - final newCapturedString = 'captured closure gen1'; |
387 |
| - await makeEditAndRecompile( |
388 |
| - mainFile, |
389 |
| - oldCapturedString, |
390 |
| - newCapturedString, |
391 |
| - ); |
| 383 | + // Should break at `capturedString`. |
| 384 | + await breakpointFuture; |
| 385 | + final oldCapturedString = 'captured closure gen0'; |
| 386 | + // Closure gets evaluated for the first time. |
| 387 | + await resumeAndExpectLog(oldCapturedString); |
| 388 | + |
| 389 | + final newCapturedString = 'captured closure gen1'; |
| 390 | + await makeEditAndRecompile( |
| 391 | + mainFile, |
| 392 | + oldCapturedString, |
| 393 | + newCapturedString, |
| 394 | + ); |
392 | 395 |
|
393 |
| - await hotReloadAndHandlePausePost([ |
394 |
| - (file: mainFile, breakpointMarker: capturedStringMarker, bp: bp), |
395 |
| - ]); |
| 396 | + await hotReloadAndHandlePausePost([ |
| 397 | + (file: mainFile, breakpointMarker: capturedStringMarker, bp: bp), |
| 398 | + ]); |
396 | 399 |
|
397 |
| - // Breakpoint should not be hit as it's now deleted. We should also see |
398 |
| - // the old string still as the closure has not been reevaluated. |
399 |
| - await callEvaluateAndExpectLog(oldCapturedString); |
400 |
| - }); |
| 400 | + // Breakpoint should not be hit as it's now deleted. We should also see |
| 401 | + // the old string still as the closure has not been reevaluated. |
| 402 | + await callEvaluateAndExpectLog(oldCapturedString); |
| 403 | + }, |
| 404 | + // TODO(srujzs): Re-enable after |
| 405 | + // https://github.com/dart-lang/webdev/issues/2640. |
| 406 | + skip: Platform.isWindows, |
| 407 | + ); |
401 | 408 | }, timeout: Timeout.factor(2));
|
402 | 409 |
|
403 | 410 | group('when pause_isolates_on_start is false', () {
|
|
0 commit comments