blob: 6d46f3487094f6f30aa5ac718817f6307b9c43a6 [file] [log] [blame] [view]
pwnallae101a5f2016-11-08 00:24:381# Layout Tests
2
3Layout tests are used by Blink to test many components, including but not
4limited to layout and rendering. In general, layout tests involve loading pages
5in a test renderer (`content_shell`) and comparing the rendered output or
6JavaScript output against an expected output file.
7
pwnall4ea2eb32016-11-29 02:47:258This document covers running and debugging existing layout tests. See the
9[Writing Layout Tests documentation](./writing_layout_tests.md) if you find
10yourself writing layout tests.
11
Kent Tamuraa045a7f2018-04-25 05:08:1112Note that we're in process of changing the term "layout tests" to "web tests".
13Please assume these terms mean the identical stuff. We also call it as
14"WebKit tests" and "WebKit layout tests".
15
pwnallae101a5f2016-11-08 00:24:3816[TOC]
17
18## Running Layout Tests
19
20### Initial Setup
21
22Before you can run the layout tests, you need to build the `blink_tests` target
23to get `content_shell` and all of the other needed binaries.
24
25```bash
26ninja -C out/Release blink_tests
27```
28
29On **Android** (layout test support
30[currently limited to KitKat and earlier](https://crbug.com/567947)) you need to
31build and install `content_shell_apk` instead. See also:
32[Android Build Instructions](../android_build_instructions.md).
33
34```bash
35ninja -C out/Default content_shell_apk
36adb install -r out/Default/apks/ContentShell.apk
37```
38
39On **Mac**, you probably want to strip the content_shell binary before starting
40the tests. If you don't, you'll have 5-10 running concurrently, all stuck being
41examined by the OS crash reporter. This may cause other failures like timeouts
42where they normally don't occur.
43
44```bash
45strip ./xcodebuild/{Debug,Release}/content_shell.app/Contents/MacOS/content_shell
46```
47
48### Running the Tests
49
50TODO: mention `testing/xvfb.py`
51
52The test runner script is in
Kent Tamuraa045a7f2018-04-25 05:08:1153`third_party/blink/tools/run_web_tests.py`.
pwnallae101a5f2016-11-08 00:24:3854
55To specify which build directory to use (e.g. out/Default, out/Release,
56out/Debug) you should pass the `-t` or `--target` parameter. For example, to
57use the build in `out/Default`, use:
58
59```bash
Kent Tamuraa045a7f2018-04-25 05:08:1160python third_party/blink/tools/run_web_tests.py -t Default
pwnallae101a5f2016-11-08 00:24:3861```
62
63For Android (if your build directory is `out/android`):
64
65```bash
Kent Tamuraa045a7f2018-04-25 05:08:1166python third_party/blink/tools/run_web_tests.py -t android --android
pwnallae101a5f2016-11-08 00:24:3867```
68
69Tests marked as `[ Skip ]` in
70[TestExpectations](../../third_party/WebKit/LayoutTests/TestExpectations)
71won't be run at all, generally because they cause some intractable tool error.
72To force one of them to be run, either rename that file or specify the skipped
pwnall4ea2eb32016-11-29 02:47:2573test as the only one on the command line (see below). Read the
74[Layout Test Expectations documentation](./layout_test_expectations.md) to learn
75more about TestExpectations and related files.
pwnallae101a5f2016-11-08 00:24:3876
pwnall4ea2eb32016-11-29 02:47:2577*** promo
78Currently only the tests listed in
pwnallae101a5f2016-11-08 00:24:3879[SmokeTests](../../third_party/WebKit/LayoutTests/SmokeTests)
80are run on the Android bots, since running all layout tests takes too long on
81Android (and may still have some infrastructure issues). Most developers focus
82their Blink testing on Linux. We rely on the fact that the Linux and Android
83behavior is nearly identical for scenarios outside those covered by the smoke
84tests.
pwnall4ea2eb32016-11-29 02:47:2585***
pwnallae101a5f2016-11-08 00:24:3886
87To run only some of the tests, specify their directories or filenames as
88arguments to `run_webkit_tests.py` relative to the layout test directory
89(`src/third_party/WebKit/LayoutTests`). For example, to run the fast form tests,
90use:
91
92```bash
Kent Tamuraa045a7f2018-04-25 05:08:1193third_party/blink/tools/run_web_tests.py fast/forms
pwnallae101a5f2016-11-08 00:24:3894```
95
96Or you could use the following shorthand:
97
98```bash
Kent Tamuraa045a7f2018-04-25 05:08:1199third_party/blink/tools/run_web_tests.py fast/fo\*
pwnallae101a5f2016-11-08 00:24:38100```
101
102*** promo
103Example: To run the layout tests with a debug build of `content_shell`, but only
104test the SVG tests and run pixel tests, you would run:
105
106```bash
Kent Tamuraa045a7f2018-04-25 05:08:11107third_party/blink/tools/run_web_tests.py -t Default svg
pwnallae101a5f2016-11-08 00:24:38108```
109***
110
111As a final quick-but-less-robust alternative, you can also just use the
112content_shell executable to run specific tests by using (for Windows):
113
114```bash
115out/Default/content_shell.exe --run-layout-test --no-sandbox full_test_source_path
116```
117
118as in:
119
120```bash
121out/Default/content_shell.exe --run-layout-test --no-sandbox \
122 c:/chrome/src/third_party/WebKit/LayoutTests/fast/forms/001.html
123```
124
125but this requires a manual diff against expected results, because the shell
126doesn't do it for you.
127
Kent Tamuraa045a7f2018-04-25 05:08:11128To see a complete list of arguments supported, run: `run_web_tests.py --help`
pwnallae101a5f2016-11-08 00:24:38129
130*** note
131**Linux Note:** We try to match the Windows render tree output exactly by
132matching font metrics and widget metrics. If there's a difference in the render
133tree output, we should see if we can avoid rebaselining by improving our font
134metrics. For additional information on Linux Layout Tests, please see
135[docs/layout_tests_linux.md](../layout_tests_linux.md).
136***
137
138*** note
139**Mac Note:** While the tests are running, a bunch of Appearance settings are
140overridden for you so the right type of scroll bars, colors, etc. are used.
141Your main display's "Color Profile" is also changed to make sure color
142correction by ColorSync matches what is expected in the pixel tests. The change
143is noticeable, how much depends on the normal level of correction for your
144display. The tests do their best to restore your setting when done, but if
145you're left in the wrong state, you can manually reset it by going to
146System Preferences → Displays → Color and selecting the "right" value.
147***
148
149### Test Harness Options
150
151This script has a lot of command line flags. You can pass `--help` to the script
152to see a full list of options. A few of the most useful options are below:
153
154| Option | Meaning |
155|:----------------------------|:--------------------------------------------------|
156| `--debug` | Run the debug build of the test shell (default is release). Equivalent to `-t Debug` |
157| `--nocheck-sys-deps` | Don't check system dependencies; this allows faster iteration. |
158| `--verbose` | Produce more verbose output, including a list of tests that pass. |
159| `--no-pixel-tests` | Disable the pixel-to-pixel PNG comparisons and image checksums for tests that don't call `testRunner.dumpAsText()` |
Xianzhu Wangcacba482017-06-05 18:46:43160| `--reset-results` | Overwrite the current baselines (`-expected.{png|txt|wav}` files) with actual results, or create new baselines if there are no existing baselines. |
pwnallae101a5f2016-11-08 00:24:38161| `--renderer-startup-dialog` | Bring up a modal dialog before running the test, useful for attaching a debugger. |
Quinten Yearsley17bf9b432018-01-02 22:02:45162| `--fully-parallel` | Run tests in parallel using as many child processes as the system has cores. |
pwnallae101a5f2016-11-08 00:24:38163| `--driver-logging` | Print C++ logs (LOG(WARNING), etc). |
164
165## Success and Failure
166
167A test succeeds when its output matches the pre-defined expected results. If any
168tests fail, the test script will place the actual generated results, along with
169a diff of the actual and expected results, into
170`src/out/Default/layout_test_results/`, and by default launch a browser with a
171summary and link to the results/diffs.
172
173The expected results for tests are in the
174`src/third_party/WebKit/LayoutTests/platform` or alongside their respective
175tests.
176
177*** note
178Tests which use [testharness.js](https://github.com/w3c/testharness.js/)
179do not have expected result files if all test cases pass.
180***
181
182A test that runs but produces the wrong output is marked as "failed", one that
183causes the test shell to crash is marked as "crashed", and one that takes longer
184than a certain amount of time to complete is aborted and marked as "timed out".
185A row of dots in the script's output indicates one or more tests that passed.
186
187## Test expectations
188
189The
qyearsley23599b72017-02-16 19:10:42190[TestExpectations](../../third_party/WebKit/LayoutTests/TestExpectations) file (and related
191files) contains the list of all known layout test failures. See the
pwnall4ea2eb32016-11-29 02:47:25192[Layout Test Expectations documentation](./layout_test_expectations.md) for more
193on this.
pwnallae101a5f2016-11-08 00:24:38194
195## Testing Runtime Flags
196
197There are two ways to run layout tests with additional command-line arguments:
198
199* Using `--additional-driver-flag`:
200
201 ```bash
Kent Tamuraa045a7f2018-04-25 05:08:11202 run_web_tests.py --additional-driver-flag=--blocking-repaint
pwnallae101a5f2016-11-08 00:24:38203 ```
204
205 This tells the test harness to pass `--blocking-repaint` to the
206 content_shell binary.
207
208 It will also look for flag-specific expectations in
209 `LayoutTests/FlagExpectations/blocking-repaint`, if this file exists. The
210 suppressions in this file override the main TestExpectations file.
211
212* Using a *virtual test suite* defined in
qyearsley23599b72017-02-16 19:10:42213 [LayoutTests/VirtualTestSuites](../../third_party/WebKit/LayoutTests/VirtualTestSuites).
pwnallae101a5f2016-11-08 00:24:38214 A virtual test suite runs a subset of layout tests under a specific path with
215 additional flags. For example, you could test a (hypothetical) new mode for
216 repainting using the following virtual test suite:
217
218 ```json
219 {
220 "prefix": "blocking_repaint",
221 "base": "fast/repaint",
222 "args": ["--blocking-repaint"],
223 }
224 ```
225
226 This will create new "virtual" tests of the form
Robert Ma89dd91d832017-08-02 18:08:44227 `virtual/blocking_repaint/fast/repaint/...` which correspond to the files
pwnallae101a5f2016-11-08 00:24:38228 under `LayoutTests/fast/repaint` and pass `--blocking-repaint` to
229 content_shell when they are run.
230
231 These virtual tests exist in addition to the original `fast/repaint/...`
232 tests. They can have their own expectations in TestExpectations, and their own
233 baselines. The test harness will use the non-virtual baselines as a fallback.
234 However, the non-virtual expectations are not inherited: if
235 `fast/repaint/foo.html` is marked `[ Fail ]`, the test harness still expects
236 `virtual/blocking_repaint/fast/repaint/foo.html` to pass. If you expect the
237 virtual test to also fail, it needs its own suppression.
238
239 The "prefix" value does not have to be unique. This is useful if you want to
240 run multiple directories with the same flags (but see the notes below about
241 performance). Using the same prefix for different sets of flags is not
242 recommended.
243
244For flags whose implementation is still in progress, virtual test suites and
245flag-specific expectations represent two alternative strategies for testing.
246Consider the following when choosing between them:
247
248* The
249 [waterfall builders](https://dev.chromium.org/developers/testing/chromium-build-infrastructure/tour-of-the-chromium-buildbot)
250 and [try bots](https://dev.chromium.org/developers/testing/try-server-usage)
251 will run all virtual test suites in addition to the non-virtual tests.
252 Conversely, a flag-specific expectations file won't automatically cause the
253 bots to test your flag - if you want bot coverage without virtual test suites,
254 you will need to set up a dedicated bot for your flag.
255
256* Due to the above, virtual test suites incur a performance penalty for the
257 commit queue and the continuous build infrastructure. This is exacerbated by
258 the need to restart `content_shell` whenever flags change, which limits
259 parallelism. Therefore, you should avoid adding large numbers of virtual test
260 suites. They are well suited to running a subset of tests that are directly
261 related to the feature, but they don't scale to flags that make deep
262 architectural changes that potentially impact all of the tests.
263
Jeff Carpenter489d4022018-05-15 00:23:00264* Note that using wildcards in virtual test path names (e.g.
265 `virtual/blocking_repaint/fast/repaint/*`) is not supported.
266
pwnallae101a5f2016-11-08 00:24:38267## Tracking Test Failures
268
269All bugs, associated with layout test failures must have the
270[Test-Layout](https://crbug.com/?q=label:Test-Layout) label. Depending on how
271much you know about the bug, assign the status accordingly:
272
273* **Unconfirmed** -- You aren't sure if this is a simple rebaseline, possible
274 duplicate of an existing bug, or a real failure
275* **Untriaged** -- Confirmed but unsure of priority or root cause.
276* **Available** -- You know the root cause of the issue.
277* **Assigned** or **Started** -- You will fix this issue.
278
279When creating a new layout test bug, please set the following properties:
280
281* Components: a sub-component of Blink
282* OS: **All** (or whichever OS the failure is on)
283* Priority: 2 (1 if it's a crash)
284* Type: **Bug**
285* Labels: **Test-Layout**
286
287You can also use the _Layout Test Failure_ template, which will pre-set these
288labels for you.
289
pwnallae101a5f2016-11-08 00:24:38290## Debugging Layout Tests
291
292After the layout tests run, you should get a summary of tests that pass or fail.
293If something fails unexpectedly (a new regression), you will get a content_shell
294window with a summary of the unexpected failures. Or you might have a failing
295test in mind to investigate. In any case, here are some steps and tips for
296finding the problem.
297
298* Take a look at the result. Sometimes tests just need to be rebaselined (see
299 below) to account for changes introduced in your patch.
300 * Load the test into a trunk Chrome or content_shell build and look at its
301 result. (For tests in the http/ directory, start the http server first.
302 See above. Navigate to `http://localhost:8000/` and proceed from there.)
303 The best tests describe what they're looking for, but not all do, and
304 sometimes things they're not explicitly testing are still broken. Compare
305 it to Safari, Firefox, and IE if necessary to see if it's correct. If
306 you're still not sure, find the person who knows the most about it and
307 ask.
308 * Some tests only work properly in content_shell, not Chrome, because they
309 rely on extra APIs exposed there.
310 * Some tests only work properly when they're run in the layout-test
311 framework, not when they're loaded into content_shell directly. The test
312 should mention that in its visible text, but not all do. So try that too.
313 See "Running the tests", above.
314* If you think the test is correct, confirm your suspicion by looking at the
315 diffs between the expected result and the actual one.
316 * Make sure that the diffs reported aren't important. Small differences in
317 spacing or box sizes are often unimportant, especially around fonts and
318 form controls. Differences in wording of JS error messages are also
319 usually acceptable.
320 * `./run_webkit_tests.py path/to/your/test.html --full-results-html` will
321 produce a page including links to the expected result, actual result, and
322 diff.
323 * Add the `--sources` option to `run_webkit_tests.py` to see exactly which
324 expected result it's comparing to (a file next to the test, something in
325 platform/mac/, something in platform/chromium-win/, etc.)
326 * If you're still sure it's correct, rebaseline the test (see below).
327 Otherwise...
328* If you're lucky, your test is one that runs properly when you navigate to it
329 in content_shell normally. In that case, build the Debug content_shell
330 project, fire it up in your favorite debugger, and load the test file either
qyearsley23599b72017-02-16 19:10:42331 from a `file:` URL.
pwnallae101a5f2016-11-08 00:24:38332 * You'll probably be starting and stopping the content_shell a lot. In VS,
333 to save navigating to the test every time, you can set the URL to your
qyearsley23599b72017-02-16 19:10:42334 test (`file:` or `http:`) as the command argument in the Debugging section of
pwnallae101a5f2016-11-08 00:24:38335 the content_shell project Properties.
336 * If your test contains a JS call, DOM manipulation, or other distinctive
337 piece of code that you think is failing, search for that in the Chrome
338 solution. That's a good place to put a starting breakpoint to start
339 tracking down the issue.
340 * Otherwise, you're running in a standard message loop just like in Chrome.
341 If you have no other information, set a breakpoint on page load.
342* If your test only works in full layout-test mode, or if you find it simpler to
343 debug without all the overhead of an interactive session, start the
344 content_shell with the command-line flag `--run-layout-test`, followed by the
qyearsley23599b72017-02-16 19:10:42345 URL (`file:` or `http:`) to your test. More information about running layout tests
pwnalld8a250722016-11-09 18:24:03346 in content_shell can be found [here](./layout_tests_in_content_shell.md).
pwnallae101a5f2016-11-08 00:24:38347 * In VS, you can do this in the Debugging section of the content_shell
348 project Properties.
349 * Now you're running with exactly the same API, theme, and other setup that
350 the layout tests use.
351 * Again, if your test contains a JS call, DOM manipulation, or other
352 distinctive piece of code that you think is failing, search for that in
353 the Chrome solution. That's a good place to put a starting breakpoint to
354 start tracking down the issue.
355 * If you can't find any better place to set a breakpoint, start at the
356 `TestShell::RunFileTest()` call in `content_shell_main.cc`, or at
357 `shell->LoadURL() within RunFileTest()` in `content_shell_win.cc`.
358* Debug as usual. Once you've gotten this far, the failing layout test is just a
359 (hopefully) reduced test case that exposes a problem.
360
361### Debugging HTTP Tests
362
363To run the server manually to reproduce/debug a failure:
364
365```bash
Kent Tamurae81dbff2018-04-20 17:35:34366cd src/third_party/blink/tools
367./run_blink_httpd.py
pwnallae101a5f2016-11-08 00:24:38368```
369
370The layout tests will be served from `http://127.0.0.1:8000`. For example, to
371run the test
372`LayoutTest/http/tests/serviceworker/chromium/service-worker-allowed.html`,
373navigate to
374`http://127.0.0.1:8000/serviceworker/chromium/service-worker-allowed.html`. Some
375tests will behave differently if you go to 127.0.0.1 vs localhost, so use
376127.0.0.1.
377
Kent Tamurae81dbff2018-04-20 17:35:34378To kill the server, hit any key on the terminal where `run_blink_httpd.py` is
Hajime Hoshia6fad022017-08-01 17:57:58379running, or just use `taskkill` or the Task Manager on Windows, and `killall` or
380Activity Monitor on MacOS.
pwnallae101a5f2016-11-08 00:24:38381
382The test server sets up an alias to `LayoutTests/resources` directory. In HTTP
383tests, you can access testing framework at e.g.
384`src="/js-test-resources/js-test.js"`.
385
386### Tips
387
388Check https://test-results.appspot.com/ to see how a test did in the most recent
389~100 builds on each builder (as long as the page is being updated regularly).
390
391A timeout will often also be a text mismatch, since the wrapper script kills the
392content_shell before it has a chance to finish. The exception is if the test
393finishes loading properly, but somehow hangs before it outputs the bit of text
394that tells the wrapper it's done.
395
396Why might a test fail (or crash, or timeout) on buildbot, but pass on your local
397machine?
398* If the test finishes locally but is slow, more than 10 seconds or so, that
399 would be why it's called a timeout on the bot.
400* Otherwise, try running it as part of a set of tests; it's possible that a test
401 one or two (or ten) before this one is corrupting something that makes this
402 one fail.
403* If it consistently works locally, make sure your environment looks like the
404 one on the bot (look at the top of the stdio for the webkit_tests step to see
405 all the environment variables and so on).
406* If none of that helps, and you have access to the bot itself, you may have to
407 log in there and see if you can reproduce the problem manually.
408
Will Chen22b488502017-11-30 21:37:15409### Debugging DevTools Tests
pwnallae101a5f2016-11-08 00:24:38410
Will Chen22b488502017-11-30 21:37:15411* Add `debug_devtools=true` to args.gn and compile: `ninja -C out/Default devtools_frontend_resources`
412 > Debug DevTools lets you avoid having to recompile after every change to the DevTools front-end.
413* Do one of the following:
414 * Option A) Run from the chromium/src folder:
Kent Tamuraa045a7f2018-04-25 05:08:11415 `third_party/blink/tools/run_web_tests.sh
Will Chen22b488502017-11-30 21:37:15416 --additional-driver-flag='--debug-devtools'
417 --additional-driver-flag='--remote-debugging-port=9222'
418 --time-out-ms=6000000`
419 * Option B) If you need to debug an http/tests/inspector test, start httpd
420 as described above. Then, run content_shell:
421 `out/Default/content_shell --debug-devtools --remote-debugging-port=9222 --run-layout-test
422 http://127.0.0.1:8000/path/to/test.html`
423* Open `http://localhost:9222` in a stable/beta/canary Chrome, click the single
424 link to open the devtools with the test loaded.
425* In the loaded devtools, set any required breakpoints and execute `test()` in
426 the console to actually start the test.
427
428NOTE: If the test is an html file, this means it's a legacy test so you need to add:
pwnallae101a5f2016-11-08 00:24:38429* Add `window.debugTest = true;` to your test code as follows:
430
431 ```javascript
432 window.debugTest = true;
433 function test() {
434 /* TEST CODE */
435 }
Kim Paulhamus61d60c32018-02-09 18:03:49436 ```
pwnallae101a5f2016-11-08 00:24:38437
Steve Kobese123a3d42017-07-20 01:20:30438## Bisecting Regressions
439
440You can use [`git bisect`](https://git-scm.com/docs/git-bisect) to find which
441commit broke (or fixed!) a layout test in a fully automated way. Unlike
442[bisect-builds.py](http://dev.chromium.org/developers/bisect-builds-py), which
443downloads pre-built Chromium binaries, `git bisect` operates on your local
444checkout, so it can run tests with `content_shell`.
445
446Bisecting can take several hours, but since it is fully automated you can leave
447it running overnight and view the results the next day.
448
449To set up an automated bisect of a layout test regression, create a script like
450this:
451
452```
453#!/bin/bash
454
455# Exit code 125 tells git bisect to skip the revision.
456gclient sync || exit 125
457ninja -C out/Debug -j100 blink_tests || exit 125
458
Kent Tamuraa045a7f2018-04-25 05:08:11459third_party/blink/tools/run_web_tests.py -t Debug \
Steve Kobese123a3d42017-07-20 01:20:30460 --no-show-results --no-retry-failures \
461 path/to/layout/test.html
462```
463
464Modify the `out` directory, ninja args, and test name as appropriate, and save
465the script in `~/checkrev.sh`. Then run:
466
467```
468chmod u+x ~/checkrev.sh # mark script as executable
469git bisect start <badrev> <goodrev>
470git bisect run ~/checkrev.sh
471git bisect reset # quit the bisect session
472```
473
pwnallae101a5f2016-11-08 00:24:38474## Rebaselining Layout Tests
475
pwnalld8a250722016-11-09 18:24:03476*** promo
477To automatically re-baseline tests across all Chromium platforms, using the
Xianzhu Wangcacba482017-06-05 18:46:43478buildbot results, see [How to rebaseline](./layout_test_expectations.md#How-to-rebaseline).
pwnallae101a5f2016-11-08 00:24:38479Alternatively, to manually run and test and rebaseline it on your workstation,
pwnalld8a250722016-11-09 18:24:03480read on.
481***
pwnallae101a5f2016-11-08 00:24:38482
pwnallae101a5f2016-11-08 00:24:38483```bash
Kent Tamuraa045a7f2018-04-25 05:08:11484cd src/third_party/blink
485tools/run_web_tests.py --reset-results foo/bar/test.html
pwnallae101a5f2016-11-08 00:24:38486```
487
Xianzhu Wangcacba482017-06-05 18:46:43488If there are current expectation files for `LayoutTests/foo/bar/test.html`,
489the above command will overwrite the current baselines at their original
490locations with the actual results. The current baseline means the `-expected.*`
491file used to compare the actual result when the test is run locally, i.e. the
492first file found in the [baseline search path]
493(https://cs.chromium.org/search/?q=port/base.py+baseline_search_path).
494
495If there are no current baselines, the above command will create new baselines
496in the platform-independent directory, e.g.
497`LayoutTests/foo/bar/test-expected.{txt,png}`.
pwnallae101a5f2016-11-08 00:24:38498
499When you rebaseline a test, make sure your commit description explains why the
Xianzhu Wangcacba482017-06-05 18:46:43500test is being re-baselined.
pwnallae101a5f2016-11-08 00:24:38501
Xianzhu Wang95d0bac32017-06-05 21:09:39502### Rebaselining flag-specific expectations
503
504Though we prefer the Rebaseline Tool to local rebaselining, the Rebaseline Tool
505doesn't support rebaselining flag-specific expectations.
506
507```bash
Kent Tamuraa045a7f2018-04-25 05:08:11508cd src/third_party/blink
509tools/run_web_tests.py --additional-driver-flag=--enable-flag --reset-results foo/bar/test.html
Xianzhu Wang95d0bac32017-06-05 21:09:39510```
511
512New baselines will be created in the flag-specific baselines directory, e.g.
513`LayoutTests/flag-specific/enable-flag/foo/bar/test-expected.{txt,png}`.
514
515Then you can commit the new baselines and upload the patch for review.
516
517However, it's difficult for reviewers to review the patch containing only new
Xianzhu Wangd063968e2017-10-16 16:47:44518files. You can follow the steps below for easier review.
Xianzhu Wang95d0bac32017-06-05 21:09:39519
Xianzhu Wangd063968e2017-10-16 16:47:445201. Copy existing baselines to the flag-specific baselines directory for the
521 tests to be rebaselined:
522 ```bash
Kent Tamuraa045a7f2018-04-25 05:08:11523 third_party/blink/tools/run_web_tests.py --additional-driver-flag=--enable-flag --copy-baselines foo/bar/test.html
Xianzhu Wangd063968e2017-10-16 16:47:44524 ```
525 Then add the newly created baseline files, commit and upload the patch.
526 Note that the above command won't copy baselines for passing tests.
Xianzhu Wang95d0bac32017-06-05 21:09:39527
Xianzhu Wangd063968e2017-10-16 16:47:445282. Rebaseline the test locally:
529 ```bash
Kent Tamuraa045a7f2018-04-25 05:08:11530 third_party/blink/tools/run_web_tests.py --additional-driver-flag=--enable-flag --reset-results foo/bar/test.html
Xianzhu Wangd063968e2017-10-16 16:47:44531 ```
532 Commit the changes and upload the patch.
Xianzhu Wang95d0bac32017-06-05 21:09:39533
Xianzhu Wangd063968e2017-10-16 16:47:445343. Request review of the CL and tell the reviewer to compare the patch sets that
535 were uploaded in step 1 and step 2 to see the differences of the rebaselines.
Xianzhu Wang95d0bac32017-06-05 21:09:39536
foolipeda32ab2017-02-16 19:21:58537## web-platform-tests
pwnallae101a5f2016-11-08 00:24:38538
foolipbbd0f452017-02-11 00:09:53539In addition to layout tests developed and run just by the Blink team, there is
foolipeda32ab2017-02-16 19:21:58540also a shared test suite, see [web-platform-tests](./web_platform_tests.md).
pwnallae101a5f2016-11-08 00:24:38541
542## Known Issues
543
544See
545[bugs with the component Blink>Infra](https://bugs.chromium.org/p/chromium/issues/list?can=2&q=component%3ABlink%3EInfra)
546for issues related to Blink tools, include the layout test runner.
547
pwnallae101a5f2016-11-08 00:24:38548* If QuickTime is not installed, the plugin tests
549 `fast/dom/object-embed-plugin-scripting.html` and
550 `plugins/embed-attributes-setting.html` are expected to fail.