Running layout tests using the content shell

Basic usage

It is possible to run basic layout tests using the content shell. The advantage over the test shell based DumpRenderTree is that content shell will exercise the multi-processing code paths used by chromium.

To just dump the render tree, as when calling DumpRenderTree directly, use the --dump-render-tree flag, as in:
out/Release/content_shell --dump-render-tree foo.html

Compiling

Chromium

If you want to run layout tests using the content shell from within a chromium checkout, you just need to build the content_shell target

WebKit

To build the content shell from within a WebKit checkout, do the following steps:

Running

You can run layout tests using RWT

run-webkit-tests --chromium --driver-nam=content_shell --additional-drt-flag=--dump-render-tree LayoutTests/storage/indexeddb/*

or execute the shell directly:

out/Debug/content_shell --remote-debugging-port=9222

This allows you see how your changes look in Chromium, and even connect with the devtools (by going to http://127.0.0.1:9222 from another window) to inspect your freshly compiled WebKit. 

(Note: on the Mac, use "Content Shell", not "content_shell").

Future Work

Reusing existing testing objects

To avoid writing (and maintaining!) yet another test controller, it is desirable to reuse an existing test controller. A possible solution would be to change DRT's test controller to not depend on DRT's implementation of the WebKit objects, but rather on the WebKit interfaces. In addition, we would need to extract an interface from the test shell object that can be implemented by content shell. This would allow for directly using DRT's test controller in content shell.
Comments