Commit 22b48850 authored by Will Chen's avatar Will Chen Committed by Commit Bot

DevTools: update layout test docs for debugging DevTools tests

Bug: 667560
Change-Id: Ic335a8364393e85de100e5b82f2d03dd6983ff84
Reviewed-on: https://chromium-review.googlesource.com/801258Reviewed-by: default avatarJoel Einbinder <einbinder@chromium.org>
Commit-Queue: Will Chen <chenwilliam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520699}
parent 7dd04dea
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment