With the introduction of GPU-acceleration in Chromium, we need to test both the GPU-accelerated code paths and the software-only rendered code paths.
- Problem 1: We need some way to tell new-run-webkit-tests to do things differently to run the GPU tests.
Solution: We've introduced a new "chromium-gpu" platform switch that sets new-run-webkit-tests up to use the correct defaults.
- Problem 2: We don't want to run all tests both with GPU-acceleration and software-only, because many tests don't execute the GPU-accelerated path, and some tests (i.e. WebGL) do not work without GPU-acceleration
Solution: new-run-webkit-tests has a hard-coded list of directories to subset when running the GPU tests that it uses if you don't specify any directories or files on the command line
- Problem 3: Tests may fail differently in the GPU-accelerated and software-only code paths.
Solution: the test_expectations.txt file now supports two new modifiers, "GPU" and "CPU", to indicate that the line should only apply to the hardware or software case. Note that if you need to specify different results for both cases (e.g., one doesn't PASS), you must specify both modifiers. You can't omit one.
- Problem 4: Different hardware produces different results. How do we have consistent results?
Solution: We use a software GL implementation (OSMesa) that does off-screen rendering and makes software pixel-comparisons.
- Problem 5: OSMesa isn't the same as hardware; shouldn't we test hardware too? And under different configurations, different types of GL, etc?
Solution: Coming soon! See bug.
Related aside: There will be a separate WebKit-GPU sheriff rotation in addition to the normal WebKit gardening schedule (also coming soon!), so normal WebKit gardeners don't have to mess with GPU breakages.
With that, here are the steps to run GPU-accelerated layout tests locally:
1. Build DumpRenderTree.
% cd src ; make -j $JOBS DumpRenderTree BUILDTYPE=Debug
If you're getting strange errors for things that aren't defined like CSSValue.*, try a clean build! :)
(change as necessary for your platform; this is for Linux, and watch out, it's case-sensitive)
2. Run the tests.
% cd src ; third_party/WebKit/Tools/Scripts/new-run-webkit-tests --debug --print default,config --platform chromium-gpu
3. Send your patch to try server.
% cd src ; git try --sub_repo third_party/WebKit --bot mac_layout,win_layout,linux_layout
This assumes you're using git and have changes both in WebKit and Chromium; for other configurations, see Try Server usage