layout_tests_linux.md 4.39 KB
Newer Older
1 2
# Running layout tests on Linux

3
1.  Build `blink_tests` (see [Linux-specific build instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md))
4 5 6 7 8 9 10 11 12
1.  Checkout the layout tests
    *   If you have an entry in your `.gclient` file that includes
        "LayoutTests", you may need to comment it out and sync.
    *   You can run a subset of the tests by passing in a path relative to
        `src/third_party/WebKit/LayoutTests/`.  For example,
        `run_layout_tests.py fast` will only run the tests under
        `src/third_party/WebKit/LayoutTests/fast/`.
1.  When the tests finish, any unexpected results should be displayed.

13
See [Layout Tests](testing/layout_tests.md)
14
for full documentation about set up and available options.
15 16 17

## Pixel Tests

18 19 20 21
The pixel test results were generated on Ubuntu 10.4 (Lucid). If you're running
a newer version of Ubuntu, you will get some pixel test failures due to changes
in freetype or fonts.  In this case, you can create a Lucid 64 chroot using
`build/install-chroot.sh` to compile and run tests.
22 23 24 25

## Fonts

Make sure you have all the necessary fonts installed.
26 27

```shell
28
sudo apt-get install apache2 wdiff php5-cgi ttf-indic-fonts \
29
   msttcorefonts ttf-dejavu-core ttf-kochi-gothic ttf-kochi-mincho \
30 31 32 33 34 35 36
   ttf-thai-tlwg
```

You can also just run `build/install-build-deps.sh` again.

## Plugins

37 38 39 40 41 42
If `fast/dom/object-plugin-hides-properties.html` and
`plugins/embed-attributes-style.html` are failing, try uninstalling
`totem-mozilla` from your system:

    sudo apt-get remove totem-mozilla

43
## Configuration tips
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58

*   Use an optimized `content_shell` when rebaselining or running a lot of
    tests. ([bug 8475](https://crbug.com/8475) is about how the debug output
    differs from the optimized output.)

    `ninja -C out/Release content_shell`

*   Make sure you have wdiff installed: `sudo apt-get install wdiff` to get
    prettier diff output.
*   Some pixel tests may fail due to processor-specific rounding errors. Build
    using a chroot jail with Lucid 64-bit user space to be sure that your system
    matches the checked in baselines.  You can use `build/install-chroot.sh` to
    set up a Lucid 64 chroot. Learn more about
    [using a linux chroot](using_a_linux_chroot.md).

59 60 61
## Getting a layout test into a debugger

There are two ways:
62 63 64 65 66 67 68 69 70 71 72 73 74

1.  Run `content_shell` directly rather than using `run_layout_tests.py`. You
    will need to pass some options:
    *   `--no-timeout` to give you plenty of time to debug
    *   the fully qualified path of the layout test (rather than relative to
        `WebKit/LayoutTests`).
1.  Or, run as normal but with the
    `--additional-drt-flag=--renderer-startup-dialog
    --additional-drt-flag=--no-timeout --time-out-ms=86400000` flags. The first
    one makes content\_shell bring up a dialog before running, which then would
    let you attach to the process via `gdb -p PID_OF_DUMPRENDERTREE`. The others
    help avoid the test shell and DumpRenderTree timeouts during the debug
    session.
75 76 77

## Using an embedded X server

78 79 80 81 82 83 84 85 86 87 88
If you try to use your computer while the tests are running, you may get annoyed
as windows are opened and closed automatically.  To get around this, you can
create a separate X server for running the tests.

1.  Install Xephyr (`sudo apt-get install xserver-xephyr`)
1.  Start Xephyr as display 4: `Xephyr :4 -screen 1024x768x24`
1.  Run the layout tests in the Xephyr: `DISPLAY=:4 run_layout_tests.py`

Xephyr supports debugging repainting. See the
[Xephyr README](http://cgit.freedesktop.org/xorg/xserver/tree/hw/kdrive/ephyr/README)
for details. In brief:
89

90 91
1.  `XEPHYR_PAUSE=$((500*1000)) Xephyr ...etc...  # 500 ms repaint flash`
1.  `kill -USR1 $(pidof Xephyr)`
92

93 94
If you don't want to see anything at all, you can use Xvfb (should already be
installed).
95

96 97
1.  Start Xvfb as display 4: `Xvfb :4 -screen 0 1024x768x24`
1.  Run the layout tests in the Xvfb: `DISPLAY=:4 run_layout_tests.py`
98 99 100

## Tiling Window managers

101 102 103
The layout tests want to run with the window at a particular size down to the
pixel level.  This means if your window manager resizes the window it'll cause
test failures.  This is another good reason to use an embedded X server.
104 105

### xmonad
106 107 108 109

In your `.xmonad/xmonad.hs`, change your config to include a manageHook along
these lines:

110 111 112 113 114 115
```
test_shell_manage = className =? "Test_shell" --> doFloat
main = xmonad $
  defaultConfig
    { manageHook = test_shell_manage <+> manageHook defaultConfig
    ...
116
```