@@ -440,3 +440,33 @@ class Metadata {
440
440
```
441
441
442
442
The metadata class is deprecated and should not be used.
443
+
444
+ ## Remote Debugger APIs
445
+
446
+ When running browser tests with ` --pause-after-load ` , the test package embeds a
447
+ few APIs in the JavaScript context of the host page. These allow tools to
448
+ control the debugging process in the same way a user might do from the command
449
+ line. They can be accessed by connecting to the remote debugger using the
450
+ [ ` DebugEvent.remoteDebugger ` ] ( #DebugEvent ) URL.
451
+
452
+ All APIs are defined as methods on the top-level ` dartTest ` object. The
453
+ following methods are available:
454
+
455
+ ### ` resume() `
456
+
457
+ Calling ` resume() ` when the test runner is paused causes it to resume running
458
+ tests. If the test runner is not paused, it won't do anything. When
459
+ ` --pause-after-load ` is passed, the test runner will pause after loading each
460
+ suite but before any tests are run.
461
+
462
+ This gives external tools a chance to use the remote debugger protocol to set
463
+ breakpoints before tests have begun executing. They can start the test runner
464
+ with ` --pause-after-load ` , connect to the remote debugger using the
465
+ [ ` DebugEvent.remoteDebugger ` ] ( #DebugEvent ) URL, set breakpoints, then call
466
+ ` dartTest.resume() ` in the host frame when they're finished.
467
+
468
+ ### ` restartCurrent() `
469
+
470
+ Calling ` restartCurrent() ` when the test runner is running a test causes it to
471
+ re-run that test once it completes its current run. It's intended to be called
472
+ when the browser is paused, as at a breakpoint.
0 commit comments