blob: 33a99b781b05ceec0f2923f3ef13698285f0a140 [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
Robert Maea335c41c2017-12-20 22:46:20251. Make sure you have all the dependencies installed by running
andybonsad92aa32015-08-31 02:27:4426
27```shell
Robert Maea335c41c2017-12-20 22:46:2028build/install-build-deps.sh
andybons3322f762015-08-24 21:37:0929```
30
Dominik Röttschesf49ef762017-11-17 09:26:31312. Double check that
32
33```shell
Tom Anderson44027d42018-03-15 17:14:5334ls third_party/test_fonts/test_fonts/
Dominik Röttschesf49ef762017-11-17 09:26:3135```
36
Tom Anderson44027d42018-03-15 17:14:5337is not empty and lists the fonts downloaded through the `test_fonts`
Dominik Röttschesf49ef762017-11-17 09:26:3138hook in the top level `DEPS` file.
39
andybons3322f762015-08-24 21:37:0940## Plugins
41
andybonsad92aa32015-08-31 02:27:4442If `fast/dom/object-plugin-hides-properties.html` and
43`plugins/embed-attributes-style.html` are failing, try uninstalling
44`totem-mozilla` from your system:
45
46 sudo apt-get remove totem-mozilla
47
andybons3322f762015-08-24 21:37:0948## Configuration tips
andybonsad92aa32015-08-31 02:27:4449
50* Use an optimized `content_shell` when rebaselining or running a lot of
51 tests. ([bug 8475](https://crbug.com/8475) is about how the debug output
52 differs from the optimized output.)
53
54 `ninja -C out/Release content_shell`
55
56* Make sure you have wdiff installed: `sudo apt-get install wdiff` to get
57 prettier diff output.
58* Some pixel tests may fail due to processor-specific rounding errors. Build
59 using a chroot jail with Lucid 64-bit user space to be sure that your system
60 matches the checked in baselines. You can use `build/install-chroot.sh` to
61 set up a Lucid 64 chroot. Learn more about
62 [using a linux chroot](using_a_linux_chroot.md).
63
andybons3322f762015-08-24 21:37:0964## Getting a layout test into a debugger
65
66There are two ways:
andybonsad92aa32015-08-31 02:27:4467
681. Run `content_shell` directly rather than using `run_layout_tests.py`. You
69 will need to pass some options:
70 * `--no-timeout` to give you plenty of time to debug
71 * the fully qualified path of the layout test (rather than relative to
72 `WebKit/LayoutTests`).
731. Or, run as normal but with the
74 `--additional-drt-flag=--renderer-startup-dialog
75 --additional-drt-flag=--no-timeout --time-out-ms=86400000` flags. The first
76 one makes content\_shell bring up a dialog before running, which then would
77 let you attach to the process via `gdb -p PID_OF_DUMPRENDERTREE`. The others
78 help avoid the test shell and DumpRenderTree timeouts during the debug
79 session.
andybons3322f762015-08-24 21:37:0980
81## Using an embedded X server
82
andybonsad92aa32015-08-31 02:27:4483If you try to use your computer while the tests are running, you may get annoyed
84as windows are opened and closed automatically. To get around this, you can
85create a separate X server for running the tests.
andybons3322f762015-08-24 21:37:0986
andybonsad92aa32015-08-31 02:27:44871. Install Xephyr (`sudo apt-get install xserver-xephyr`)
881. Start Xephyr as display 4: `Xephyr :4 -screen 1024x768x24`
891. Run the layout tests in the Xephyr: `DISPLAY=:4 run_layout_tests.py`
andybons3322f762015-08-24 21:37:0990
andybonsad92aa32015-08-31 02:27:4491Xephyr supports debugging repainting. See the
92[Xephyr README](http://cgit.freedesktop.org/xorg/xserver/tree/hw/kdrive/ephyr/README)
93for details. In brief:
andybons3322f762015-08-24 21:37:0994
andybonsad92aa32015-08-31 02:27:44951. `XEPHYR_PAUSE=$((500*1000)) Xephyr ...etc... # 500 ms repaint flash`
961. `kill -USR1 $(pidof Xephyr)`
97
98If you don't want to see anything at all, you can use Xvfb (should already be
99installed).
100
1011. Start Xvfb as display 4: `Xvfb :4 -screen 0 1024x768x24`
1021. Run the layout tests in the Xvfb: `DISPLAY=:4 run_layout_tests.py`
andybons3322f762015-08-24 21:37:09103
104## Tiling Window managers
105
andybonsad92aa32015-08-31 02:27:44106The layout tests want to run with the window at a particular size down to the
107pixel level. This means if your window manager resizes the window it'll cause
108test failures. This is another good reason to use an embedded X server.
andybons3322f762015-08-24 21:37:09109
110### xmonad
andybonsad92aa32015-08-31 02:27:44111
112In your `.xmonad/xmonad.hs`, change your config to include a manageHook along
113these lines:
114
andybons3322f762015-08-24 21:37:09115```
116test_shell_manage = className =? "Test_shell" --> doFloat
117main = xmonad $
118 defaultConfig
119 { manageHook = test_shell_manage <+> manageHook defaultConfig
120 ...
andybonsad92aa32015-08-31 02:27:44121```