Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
chromium.googlesource.com-external-github.com-dart-lang-test
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fuchsia-mirror
chromium.googlesource.com-external-github.com-dart-lang-test
Commits
5449e5b2
Commit
5449e5b2
authored
8 years ago
by
Natalie Weizenbaum
Browse files
Options
Downloads
Patches
Plain Diff
Control the runner through a separate WebSocket.
parent
1b578e43
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/json_reporter.md
+10
-42
10 additions, 42 deletions
doc/json_reporter.md
json_reporter.schema.json
+3
-1
3 additions, 1 deletion
json_reporter.schema.json
with
13 additions
and
43 deletions
doc/json_reporter.md
+
10
−
42
View file @
5449e5b2
...
...
@@ -96,15 +96,17 @@ class StartEvent extends Event {
// The version of the test runner being used.
String runnerVersion;
// The
ID of the isolate in which the runner is running, or `null` if the test
//
runner isn't running
in debug
mode
.
String
isolateID
;
// The
URL for a WebSocket server that serves a JSON-RPC 2.0 protocol for
//
controlling the test runner dur
in
g
debug
ging
.
String
controllerUrl
;
}
```
A single start event is emitted before any other events. It indicates that the
test runner has started running.
The
`controllerUrl`
is
`null`
if the runner isn't in debug mode.
### AllSuitesEvent
```
...
...
@@ -445,7 +447,7 @@ class Metadata {
The metadata class is deprecated and should not be used.
##
Remote Debugg
er APIs
##
Controll
er APIs
During debugging, users of the JSON API need a way to communicate with the test
runner to tell it things like "all the breakpoints are set and the test should
...
...
@@ -455,41 +457,7 @@ connection. The WebSocket URL is available in
[
JSON-RPC 2.0][
]:
http://www.jsonrpc.org/specification
### Dart VM
When running tests on the command-line Dart VM, the test package exposes APIs as
[
service protocol extensions
][
registerExtension
]
. These can be called just like
built-in
[
VM service
][]
RPCs by connecting to the VM service through a WebSocket
connection to the
[
`DebugEvent.observatory`
](
#DebugEvent
)
URL. The
`isolateId`
parameter should match
[
`StartEvent.isolateID`
](
#StartEvent
)
.
[
registerExtension
]:
https://api.dartlang.org/stable/latest/dart-developer/registerExtension.html
[
VM service
]:
https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md
The exception to this is resuming the test, which is done by calling the
built-in
[
`resume`
][
resume
]
RPC for the test isolate. Once the isolate is no
longer paused, the test runner will start running tests automatically.
[
resume
]:
https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#resume
#### `ext.test.restartCurrent`
Calling the
`ext.test.restartCurrent`
RPC when the test runner is running a test
causes it to re-run that test once it completes its current run. It's intended
to be called when the runner is paused, as at a breakpoint.
### Browser
When running browser tests with
`--pause-after-load`
, the test package embeds a
few APIs in the JavaScript context of the host page. These allow tools to
control the debugging process in the same way a user might do from the command
line. They can be accessed by connecting to the remote debugger using the
[
`DebugEvent.remoteDebugger`
](
#DebugEvent
)
URL.
All APIs are defined as methods on the top-level
`dartTest`
object. The
following methods are available:
#### `resume()`
### `null resume()`
Calling
`resume()`
when the test runner is paused causes it to resume running
tests. If the test runner is not paused, it won't do anything. When
...
...
@@ -498,9 +466,9 @@ suite but before any tests are run.
This gives external tools a chance to use the remote debugger protocol to set
breakpoints before tests have begun executing. They can start the test runner
with
`--pause-after-load`
, connect to the
remote debugger
using
the
[
`
Debug
Event.
remoteDebugger`
](
#Debug
Event
)
URL
, set breakpoints, then call
`dartTest.resume()`
in the host frame
when they're finished.
with
`--pause-after-load`
, connect to the
controller protocol
using
[
`
Start
Event.
controllerUrl`
](
#Start
Event
)
, set breakpoints, then call
`resume()`
in
when they're finished.
#### `restartCurrent()`
...
...
This diff is collapsed.
Click to expand it.
json_reporter.schema.json
+
3
−
1
View file @
5449e5b2
...
...
@@ -102,7 +102,9 @@
"runnerVersion"
:
{
"oneOf"
:
[{
"type"
:
"string"
},
{
"type"
:
"null"
}]
},
"isolateID"
:
{
"type"
:
"string"
}
"controllerUrl"
:
{
"oneOf"
:
[{
"type"
:
"string"
},
{
"type"
:
"null"
}]
}
}
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment