blob: c8c0cd041b5e953db039e2643fe8ae8468f39765 [file] [log] [blame] [view]
Kent Tamura59ffb022018-11-27 05:30:561# Running web tests using the content shell
pwnalld8a250722016-11-09 18:24:032
3## Basic usage
4
Kent Tamura59ffb022018-11-27 05:30:565Web tests can be run with `content_shell`. To just dump the render tree, use
Kent Tamuracd3ebc42018-05-16 06:44:226the `--run-web-tests` flag:
pwnalld8a250722016-11-09 18:24:037
8```bash
Kent Tamuracd3ebc42018-05-16 06:44:229out/Default/content_shell --run-web-tests foo.html
pwnalld8a250722016-11-09 18:24:0310```
11
12### Compiling
13
Kent Tamura59ffb022018-11-27 05:30:5614If you want to run web tests,
15[build the target `blink_tests`](web_tests.md); this includes all the other
pwnalld8a250722016-11-09 18:24:0316binaries required to run the tests.
17
18### Running
19
Kent Tamura59ffb022018-11-27 05:30:5620You can run web tests using `run_web_tests.py` (in
Kent Tamuraa045a7f2018-04-25 05:08:1121`src/third_party/blink/tools`).
pwnalld8a250722016-11-09 18:24:0322
23```bash
Kent Tamuraa045a7f2018-04-25 05:08:1124third_party/blink/tools/run_web_tests.py storage/indexeddb
pwnalld8a250722016-11-09 18:24:0325```
26
27or execute the shell directly:
28
29```bash
30out/Default/content_shell --remote-debugging-port=9222
31```
32
33This allows you see how your changes look in Chromium, and even connect with
34devtools (by going to http://127.0.0.1:9222 from another window) to inspect your
35freshly compiled Blink.
36
37*** note
38On the Mac, use `Content Shell.app`, not `content_shell`.
39
40```bash
41out/Default/Content\ Shell.app/Contents/MacOS/Content\ Shell --remote-debugging-port=9222
42```
43***
44
45### Debugging Renderer Crashes
46
47To debug a renderer crash, ask Content Shell to wait for you to attach a
48debugger once it spawns a renderer process by adding the
49`--renderer-startup-dialog` flag:
50
51```bash
52out/Default/content_shell --renderer-startup-dialog
53```
54
55Debugging workers and other subprocesses is simpler with
56`--wait-for-debugger-children`, which can have one of two values: `plugin` or
57`renderer`.
58
59## Future Work
60
61### Reusing existing testing objects
62
63To avoid writing (and maintaining!) yet another test controller, it is desirable
64to reuse an existing test controller. A possible solution would be to change
65DRT's test controller to not depend on DRT's implementation of the Blink
66objects, but rather on the Blink interfaces. In addition, we would need to
67extract an interface from the test shell object that can be implemented by
68content shell. This would allow for directly using DRT's test controller in
69content shell.