Skip to content

Commit

Permalink
DevTools: update layout test docs for debugging DevTools tests
Browse files Browse the repository at this point in the history
Bug: 667560
Change-Id: Ic335a8364393e85de100e5b82f2d03dd6983ff84
Reviewed-on: https://chromium-review.googlesource.com/801258
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Will Chen <chenwilliam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520699}
  • Loading branch information
wwwillchen authored and Commit Bot committed Nov 30, 2017
1 parent 7dd04de commit 22b4885
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions docs/testing/layout_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,34 +399,35 @@ machine?
* If none of that helps, and you have access to the bot itself, you may have to
log in there and see if you can reproduce the problem manually.

### Debugging Inspector Tests

* Add `window.debugTest = true;` to your test code as follows:

```javascript
window.debugTest = true;
function test() {
/* TEST CODE */
}
```
### Debugging DevTools Tests

* Add `debug_devtools=true` to args.gn and compile: `ninja -C out/Default devtools_frontend_resources`
> Debug DevTools lets you avoid having to recompile after every change to the DevTools front-end.
* Do one of the following:
* Option A) Run from the chromium/src folder:
`blink/tools/run_layout_tests.sh
--additional_driver_flag='--remote-debugging-port=9222'
--additional-driver-flag='--debug-devtools'
--additional-driver-flag='--remote-debugging-port=9222'
--time-out-ms=6000000`
* Option B) If you need to debug an http/tests/inspector test, start httpd
as described above. Then, run content_shell:
`out/Default/content_shell --remote-debugging-port=9222 --run-layout-test
`out/Default/content_shell --debug-devtools --remote-debugging-port=9222 --run-layout-test
http://127.0.0.1:8000/path/to/test.html`
* Open `http://localhost:9222` in a stable/beta/canary Chrome, click the single
link to open the devtools with the test loaded.
* You may need to replace devtools.html with inspector.html in your URL (or you
can use local chrome inspection of content_shell from `chrome://inspect`
instead)
* In the loaded devtools, set any required breakpoints and execute `test()` in
the console to actually start the test.

NOTE: If the test is an html file, this means it's a legacy test so you need to add:
* Add `window.debugTest = true;` to your test code as follows:

```javascript
window.debugTest = true;
function test() {
/* TEST CODE */
}
```

## Bisecting Regressions

You can use [`git bisect`](https://git-scm.com/docs/git-bisect) to find which
Expand Down

0 comments on commit 22b4885

Please sign in to comment.