blob: 1dfd1684e1a0f076fa8352cddbb2631103a43ae5 [file] [log] [blame] [view]
andybons3322f762015-08-24 21:37:091# Running layout tests on Linux
2
mostynbdf175a82016-02-08 23:27:2031. Build `blink_tests` (see [Linux-specific build instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md))
andybonsad92aa32015-08-31 02:27:4441. 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
qyearsleyac3af532016-11-16 22:07:3213See [Layout Tests](testing/layout_tests.md)
andybonsad92aa32015-08-31 02:27:4414for full documentation about set up and available options.
andybons3322f762015-08-24 21:37:0915
16## Pixel Tests
17
andybonsad92aa32015-08-31 02:27:4418The pixel test results were generated on Ubuntu 10.4 (Lucid). If you're running
19a newer version of Ubuntu, you will get some pixel test failures due to changes
20in freetype or fonts. In this case, you can create a Lucid 64 chroot using
21`build/install-chroot.sh` to compile and run tests.
andybons3322f762015-08-24 21:37:0922
23## Fonts
24
25Make sure you have all the necessary fonts installed.
andybonsad92aa32015-08-31 02:27:4426
27```shell
andybons3322f762015-08-24 21:37:0928sudo apt-get install apache2 wdiff php5-cgi ttf-indic-fonts \
horo233d31c2016-11-16 03:43:0029 msttcorefonts ttf-dejavu-core ttf-kochi-gothic ttf-kochi-mincho \
andybons3322f762015-08-24 21:37:0930 ttf-thai-tlwg
31```
32
33You can also just run `build/install-build-deps.sh` again.
34
35## Plugins
36
andybonsad92aa32015-08-31 02:27:4437If `fast/dom/object-plugin-hides-properties.html` and
38`plugins/embed-attributes-style.html` are failing, try uninstalling
39`totem-mozilla` from your system:
40
41 sudo apt-get remove totem-mozilla
42
andybons3322f762015-08-24 21:37:0943## Configuration tips
andybonsad92aa32015-08-31 02:27:4444
45* Use an optimized `content_shell` when rebaselining or running a lot of
46 tests. ([bug 8475](https://crbug.com/8475) is about how the debug output
47 differs from the optimized output.)
48
49 `ninja -C out/Release content_shell`
50
51* Make sure you have wdiff installed: `sudo apt-get install wdiff` to get
52 prettier diff output.
53* Some pixel tests may fail due to processor-specific rounding errors. Build
54 using a chroot jail with Lucid 64-bit user space to be sure that your system
55 matches the checked in baselines. You can use `build/install-chroot.sh` to
56 set up a Lucid 64 chroot. Learn more about
57 [using a linux chroot](using_a_linux_chroot.md).
58
andybons3322f762015-08-24 21:37:0959## Getting a layout test into a debugger
60
61There are two ways:
andybonsad92aa32015-08-31 02:27:4462
631. Run `content_shell` directly rather than using `run_layout_tests.py`. You
64 will need to pass some options:
65 * `--no-timeout` to give you plenty of time to debug
66 * the fully qualified path of the layout test (rather than relative to
67 `WebKit/LayoutTests`).
681. Or, run as normal but with the
69 `--additional-drt-flag=--renderer-startup-dialog
70 --additional-drt-flag=--no-timeout --time-out-ms=86400000` flags. The first
71 one makes content\_shell bring up a dialog before running, which then would
72 let you attach to the process via `gdb -p PID_OF_DUMPRENDERTREE`. The others
73 help avoid the test shell and DumpRenderTree timeouts during the debug
74 session.
andybons3322f762015-08-24 21:37:0975
76## Using an embedded X server
77
andybonsad92aa32015-08-31 02:27:4478If you try to use your computer while the tests are running, you may get annoyed
79as windows are opened and closed automatically. To get around this, you can
80create a separate X server for running the tests.
andybons3322f762015-08-24 21:37:0981
andybonsad92aa32015-08-31 02:27:44821. Install Xephyr (`sudo apt-get install xserver-xephyr`)
831. Start Xephyr as display 4: `Xephyr :4 -screen 1024x768x24`
841. Run the layout tests in the Xephyr: `DISPLAY=:4 run_layout_tests.py`
andybons3322f762015-08-24 21:37:0985
andybonsad92aa32015-08-31 02:27:4486Xephyr supports debugging repainting. See the
87[Xephyr README](http://cgit.freedesktop.org/xorg/xserver/tree/hw/kdrive/ephyr/README)
88for details. In brief:
andybons3322f762015-08-24 21:37:0989
andybonsad92aa32015-08-31 02:27:44901. `XEPHYR_PAUSE=$((500*1000)) Xephyr ...etc... # 500 ms repaint flash`
911. `kill -USR1 $(pidof Xephyr)`
92
93If you don't want to see anything at all, you can use Xvfb (should already be
94installed).
95
961. Start Xvfb as display 4: `Xvfb :4 -screen 0 1024x768x24`
971. Run the layout tests in the Xvfb: `DISPLAY=:4 run_layout_tests.py`
andybons3322f762015-08-24 21:37:0998
99## Tiling Window managers
100
andybonsad92aa32015-08-31 02:27:44101The layout tests want to run with the window at a particular size down to the
102pixel level. This means if your window manager resizes the window it'll cause
103test failures. This is another good reason to use an embedded X server.
andybons3322f762015-08-24 21:37:09104
105### xmonad
andybonsad92aa32015-08-31 02:27:44106
107In your `.xmonad/xmonad.hs`, change your config to include a manageHook along
108these lines:
109
andybons3322f762015-08-24 21:37:09110```
111test_shell_manage = className =? "Test_shell" --> doFloat
112main = xmonad $
113 defaultConfig
114 { manageHook = test_shell_manage <+> manageHook defaultConfig
115 ...
andybonsad92aa32015-08-31 02:27:44116```