blob: 154e33428bef85997b52c89a3355b1eacfee4cc9 [file] [log] [blame] [view]
andybons3322f762015-08-24 21:37:091# Running layout tests on Linux
2
andybonsad92aa32015-08-31 02:27:4431. Build `blink_tests` (see LinuxBuildInstructions)
41. Checkout the layout tests
5 * If you have an entry in your `.gclient` file that includes
6 "LayoutTests", you may need to comment it out and sync.
7 * You can run a subset of the tests by passing in a path relative to
8 `src/third_party/WebKit/LayoutTests/`. For example,
9 `run_layout_tests.py fast` will only run the tests under
10 `src/third_party/WebKit/LayoutTests/fast/`.
111. When the tests finish, any unexpected results should be displayed.
andybons3322f762015-08-24 21:37:0912
andybonsad92aa32015-08-31 02:27:4413See
14[Running WebKit Layout Tests](http://dev.chromium.org/developers/testing/webkit-layout-tests)
15for full documentation about set up and available options.
andybons3322f762015-08-24 21:37:0916
17## Pixel Tests
18
andybonsad92aa32015-08-31 02:27:4419The pixel test results were generated on Ubuntu 10.4 (Lucid). If you're running
20a newer version of Ubuntu, you will get some pixel test failures due to changes
21in freetype or fonts. In this case, you can create a Lucid 64 chroot using
22`build/install-chroot.sh` to compile and run tests.
andybons3322f762015-08-24 21:37:0923
24## Fonts
25
26Make sure you have all the necessary fonts installed.
andybonsad92aa32015-08-31 02:27:4427
28```shell
andybons3322f762015-08-24 21:37:0929sudo apt-get install apache2 wdiff php5-cgi ttf-indic-fonts \
30 msttcorefonts ttf-dejavu-core ttf-kochi-gothic ttf-kochi-mincho \
31 ttf-thai-tlwg
32```
33
34You can also just run `build/install-build-deps.sh` again.
35
36## Plugins
37
andybonsad92aa32015-08-31 02:27:4438If `fast/dom/object-plugin-hides-properties.html` and
39`plugins/embed-attributes-style.html` are failing, try uninstalling
40`totem-mozilla` from your system:
41
42 sudo apt-get remove totem-mozilla
43
andybons3322f762015-08-24 21:37:0944
45## Running layout tests under valgrind on Linux
46
47As above, but use `tools/valgrind/chrome_tests.sh -t webkit` instead. e.g.
andybonsad92aa32015-08-31 02:27:4448
49 sh tools/valgrind/chrome_tests.sh -t webkit LayoutTests/fast/
50
andybons3322f762015-08-24 21:37:0951This defaults to using --debug. Read the script for more details.
52
andybonsad92aa32015-08-31 02:27:4453If you're trying to reproduce a run from the valgrind buildbot, look for the
54`--run_chunk=XX:YY` line in the bot's log. You can rerun exactly as the bot did
55with the commands.
56
57```shell
andybons3322f762015-08-24 21:37:0958cd ~/chromium/src
andybonsad92aa32015-08-31 02:27:4459echo XX > valgrind_layout_chunk.txt
andybons3322f762015-08-24 21:37:0960sh tools/valgrind/chrome_tests.sh -t layout -n YY
61```
andybonsad92aa32015-08-31 02:27:4462
andybons3322f762015-08-24 21:37:0963That will run the XXth chunk of YY layout tests.
64
65## Configuration tips
andybonsad92aa32015-08-31 02:27:4466
67* Use an optimized `content_shell` when rebaselining or running a lot of
68 tests. ([bug 8475](https://crbug.com/8475) is about how the debug output
69 differs from the optimized output.)
70
71 `ninja -C out/Release content_shell`
72
73* Make sure you have wdiff installed: `sudo apt-get install wdiff` to get
74 prettier diff output.
75* Some pixel tests may fail due to processor-specific rounding errors. Build
76 using a chroot jail with Lucid 64-bit user space to be sure that your system
77 matches the checked in baselines. You can use `build/install-chroot.sh` to
78 set up a Lucid 64 chroot. Learn more about
79 [using a linux chroot](using_a_linux_chroot.md).
80
andybons3322f762015-08-24 21:37:0981## Getting a layout test into a debugger
82
83There are two ways:
andybonsad92aa32015-08-31 02:27:4484
851. Run `content_shell` directly rather than using `run_layout_tests.py`. You
86 will need to pass some options:
87 * `--no-timeout` to give you plenty of time to debug
88 * the fully qualified path of the layout test (rather than relative to
89 `WebKit/LayoutTests`).
901. Or, run as normal but with the
91 `--additional-drt-flag=--renderer-startup-dialog
92 --additional-drt-flag=--no-timeout --time-out-ms=86400000` flags. The first
93 one makes content\_shell bring up a dialog before running, which then would
94 let you attach to the process via `gdb -p PID_OF_DUMPRENDERTREE`. The others
95 help avoid the test shell and DumpRenderTree timeouts during the debug
96 session.
andybons3322f762015-08-24 21:37:0997
98## Using an embedded X server
99
andybonsad92aa32015-08-31 02:27:44100If you try to use your computer while the tests are running, you may get annoyed
101as windows are opened and closed automatically. To get around this, you can
102create a separate X server for running the tests.
andybons3322f762015-08-24 21:37:09103
andybonsad92aa32015-08-31 02:27:441041. Install Xephyr (`sudo apt-get install xserver-xephyr`)
1051. Start Xephyr as display 4: `Xephyr :4 -screen 1024x768x24`
1061. Run the layout tests in the Xephyr: `DISPLAY=:4 run_layout_tests.py`
andybons3322f762015-08-24 21:37:09107
andybonsad92aa32015-08-31 02:27:44108Xephyr supports debugging repainting. See the
109[Xephyr README](http://cgit.freedesktop.org/xorg/xserver/tree/hw/kdrive/ephyr/README)
110for details. In brief:
andybons3322f762015-08-24 21:37:09111
andybonsad92aa32015-08-31 02:27:441121. `XEPHYR_PAUSE=$((500*1000)) Xephyr ...etc... # 500 ms repaint flash`
1131. `kill -USR1 $(pidof Xephyr)`
114
115If you don't want to see anything at all, you can use Xvfb (should already be
116installed).
117
1181. Start Xvfb as display 4: `Xvfb :4 -screen 0 1024x768x24`
1191. Run the layout tests in the Xvfb: `DISPLAY=:4 run_layout_tests.py`
andybons3322f762015-08-24 21:37:09120
121## Tiling Window managers
122
andybonsad92aa32015-08-31 02:27:44123The layout tests want to run with the window at a particular size down to the
124pixel level. This means if your window manager resizes the window it'll cause
125test failures. This is another good reason to use an embedded X server.
andybons3322f762015-08-24 21:37:09126
127### xmonad
andybonsad92aa32015-08-31 02:27:44128
129In your `.xmonad/xmonad.hs`, change your config to include a manageHook along
130these lines:
131
andybons3322f762015-08-24 21:37:09132```
133test_shell_manage = className =? "Test_shell" --> doFloat
134main = xmonad $
135 defaultConfig
136 { manageHook = test_shell_manage <+> manageHook defaultConfig
137 ...
andybonsad92aa32015-08-31 02:27:44138```