Skip to content

Commit

Permalink
Add //third_party/blink/tools/run_web_tests.*,
Browse files Browse the repository at this point in the history
which is the new name of run-webkit-tests.
This CL also replaces references to "run-webkit-tests" with
"run_web_tests.py".

* //blink/tools/run_layout_tests.py
 Show a message, and run run_web_tests.py.

* //BUILD.gn
 "webkit_layout_tests" doesn't need //third_party/WebKit/Tools/Scripts
 any longer.

* //testing/buildbot/gn_isolate_map.pyl
 Replace run-webkit-tests with run_web_tests.py.

* //third_party/blink/tools/run_web_tests.{bat,py}
 Added.

* //third_party/WebKit/Tools/Scripts/run-webkit-tests
 Show a message.

* Other files: Really trivial changes. In many files, this CL
  replaces "run-webkit-tests" with "run_web_tests.py" in comments or
  strings.

Note that we decided to rename LayoutTests to web_tests.
https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/KKNbuzj-3HY/H8FWgtKrBgAJ


Bug: 829697
Change-Id: I899457cb3bcdb306aa47843a4c767c5980d9edc0
Reviewed-on: https://chromium-review.googlesource.com/1025543
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Quinten Yearsley <qyearsley@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553452}
  • Loading branch information
tkent-google authored and Commit Bot committed Apr 25, 2018
1 parent b7c3572 commit a045a7f
Show file tree
Hide file tree
Showing 61 changed files with 124 additions and 103 deletions.
1 change: 0 additions & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,6 @@ if (!is_ios) {
"//testing/scripts/run_isolated_script_test.py",
"//testing/xvfb.py",
"//third_party/WebKit/LayoutTests/",
"//third_party/WebKit/Tools/Scripts/",
"//third_party/blink/perf_tests/",
"//third_party/blink/tools/",
"//third_party/pywebsocket/",
Expand Down
9 changes: 5 additions & 4 deletions blink/tools/run_layout_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
# found in the LICENSE file.

"""Wrapper around
third_party/WebKit/Tools/Scripts/run-webkit-tests"""
third_party/blink/tools/run_web_tests.py"""
import os
import subprocess
import sys

def main():
print '\n Please use third_party/blink/tools/run_web_tests.*. ' \
'This command will be removed.\n'
src_dir = os.path.abspath(os.path.join(sys.path[0], '..', '..'))
script_dir=os.path.join(src_dir, "third_party", "WebKit", "Tools",
"Scripts")
script = os.path.join(script_dir, 'run-webkit-tests')
script_dir=os.path.join(src_dir, "third_party", "blink", "tools")
script = os.path.join(script_dir, 'run_web_tests.py')
cmd = [sys.executable, script] + sys.argv[1:]
return subprocess.call(cmd)

Expand Down
2 changes: 1 addition & 1 deletion chrome/test/mini_installer/test_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ def main():
def _FullResults(suite, result, metadata):
"""Convert the unittest results to the Chromium JSON test result format.
This matches run-webkit-tests (the layout tests) and the flakiness dashboard.
This matches run_web_tests.py (the layout tests) and the flakiness dashboard.
"""

full_results = {}
Expand Down
2 changes: 1 addition & 1 deletion docs/accessibility/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ content/shell/test_runner
To run all accessibility LayoutTests:
```
ninja -C out/release blink_tests
third_party/WebKit/Tools/Scripts/run-webkit-tests --build-directory=out --target=release accessibility/
third_party/blink/tools/run_web_tests.py --build-directory=out --target=release accessibility/
```

To run just one test by itself without the script:
Expand Down
8 changes: 4 additions & 4 deletions docs/testing/identifying_tests_that_depend_on_order.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ interested in adding that feature to the script.
Instead of running `bisect_web_test_ordering.py`, you can manually do the work
of step 4 above.

1. `run-webkit-tests --child-processes=1 --order=none --test-list=path/to/file/from/step/3`
1. `run_web_tests.py --child-processes=1 --order=none --test-list=path/to/file/from/step/3`
2. If the test doesn't fail here, then the test itself is probably just flaky.
If it does, remove some lines from the file and repeat step 1. Continue
repeating until you've found the dependency. If the test fails when run by
itself, but passes on the bots, that means that it depends on another test to
pass. In this case, you need to generate the list of tests run by
`run-webkit-tests --order=natural` and repeat this process to find which test
`run_web_tests.py --order=natural` and repeat this process to find which test
causes the test in question to *pass* (e.g.
[crbug.com/262793](https://crbug.com/262793)).
3. File a bug and give it the
Expand All @@ -57,13 +57,13 @@ of step 4 above.

#### Run tests in a random order and diagnose failures

1. Run `run-webkit-tests --order=random --no-retry`
1. Run `run_web_tests.py --order=random --no-retry`
2. Run `./tools/print_web_test_ordering.py` and save the output to a file. This
outputs the tests run in the order they were run on each content_shell
instance.
3. Run the diagnosing steps from above to figure out which tests

Run `run-webkit-tests --run-singly --no-retry`. This starts up a new
Run `run_web_tests.py --run-singly --no-retry`. This starts up a new
content_shell instance for each test. Tests that fail when run in isolation but
pass when run as part of the full test suite represent some state that we're not
properly resetting between test runs or some state that we're not properly
Expand Down
2 changes: 1 addition & 1 deletion docs/testing/layout_test_baseline_fallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ results).
In addition, the optimizer also removes redundant all-PASS testharness.js
results. Such baselines are redundant when there are no other fallbacks later
on the search path (including if the all-PASS baselines are at root), because
`run-webkit-tests` assumes all-PASS testharness.js results when baselines can
`run_web_tests.py` assumes all-PASS testharness.js results when baselines can
not be found for a platform.

### Rebaseline
Expand Down
36 changes: 20 additions & 16 deletions docs/testing/layout_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ This document covers running and debugging existing layout tests. See the
[Writing Layout Tests documentation](./writing_layout_tests.md) if you find
yourself writing layout tests.

Note that we're in process of changing the term "layout tests" to "web tests".
Please assume these terms mean the identical stuff. We also call it as
"WebKit tests" and "WebKit layout tests".

[TOC]

## Running Layout Tests
Expand Down Expand Up @@ -46,20 +50,20 @@ strip ./xcodebuild/{Debug,Release}/content_shell.app/Contents/MacOS/content_shel
TODO: mention `testing/xvfb.py`

The test runner script is in
`third_party/WebKit/Tools/Scripts/run-webkit-tests`.
`third_party/blink/tools/run_web_tests.py`.

To specify which build directory to use (e.g. out/Default, out/Release,
out/Debug) you should pass the `-t` or `--target` parameter. For example, to
use the build in `out/Default`, use:

```bash
python third_party/WebKit/Tools/Scripts/run-webkit-tests -t Default
python third_party/blink/tools/run_web_tests.py -t Default
```

For Android (if your build directory is `out/android`):

```bash
python third_party/WebKit/Tools/Scripts/run-webkit-tests -t android --android
python third_party/blink/tools/run_web_tests.py -t android --android
```

Tests marked as `[ Skip ]` in
Expand All @@ -86,21 +90,21 @@ arguments to `run_webkit_tests.py` relative to the layout test directory
use:

```bash
Tools/Scripts/run-webkit-tests fast/forms
third_party/blink/tools/run_web_tests.py fast/forms
```

Or you could use the following shorthand:

```bash
Tools/Scripts/run-webkit-tests fast/fo\*
third_party/blink/tools/run_web_tests.py fast/fo\*
```

*** promo
Example: To run the layout tests with a debug build of `content_shell`, but only
test the SVG tests and run pixel tests, you would run:

```bash
Tools/Scripts/run-webkit-tests -t Default svg
third_party/blink/tools/run_web_tests.py -t Default svg
```
***

Expand All @@ -121,7 +125,7 @@ out/Default/content_shell.exe --run-layout-test --no-sandbox \
but this requires a manual diff against expected results, because the shell
doesn't do it for you.

To see a complete list of arguments supported, run: `run-webkit-tests --help`
To see a complete list of arguments supported, run: `run_web_tests.py --help`

*** note
**Linux Note:** We try to match the Windows render tree output exactly by
Expand Down Expand Up @@ -195,7 +199,7 @@ There are two ways to run layout tests with additional command-line arguments:
* Using `--additional-driver-flag`:

```bash
run-webkit-tests --additional-driver-flag=--blocking-repaint
run_web_tests.py --additional-driver-flag=--blocking-repaint
```

This tells the test harness to pass `--blocking-repaint` to the
Expand Down Expand Up @@ -405,7 +409,7 @@ machine?
> Debug DevTools lets you avoid having to recompile after every change to the DevTools front-end.
* Do one of the following:
* Option A) Run from the chromium/src folder:
`blink/tools/run_layout_tests.sh
`third_party/blink/tools/run_web_tests.sh
--additional-driver-flag='--debug-devtools'
--additional-driver-flag='--remote-debugging-port=9222'
--time-out-ms=6000000`
Expand Down Expand Up @@ -449,7 +453,7 @@ this:
gclient sync || exit 125
ninja -C out/Debug -j100 blink_tests || exit 125
blink/tools/run_layout_tests.sh -t Debug \
third_party/blink/tools/run_web_tests.py -t Debug \
--no-show-results --no-retry-failures \
path/to/layout/test.html
```
Expand All @@ -474,8 +478,8 @@ read on.
***

```bash
cd src/third_party/WebKit
Tools/Scripts/run-webkit-tests --reset-results foo/bar/test.html
cd src/third_party/blink
tools/run_web_tests.py --reset-results foo/bar/test.html
```

If there are current expectation files for `LayoutTests/foo/bar/test.html`,
Expand All @@ -498,8 +502,8 @@ Though we prefer the Rebaseline Tool to local rebaselining, the Rebaseline Tool
doesn't support rebaselining flag-specific expectations.

```bash
cd src/third_party/WebKit
Tools/Scripts/run-webkit-tests --additional-driver-flag=--enable-flag --reset-results foo/bar/test.html
cd src/third_party/blink
tools/run_web_tests.py --additional-driver-flag=--enable-flag --reset-results foo/bar/test.html
```

New baselines will be created in the flag-specific baselines directory, e.g.
Expand All @@ -513,14 +517,14 @@ files. You can follow the steps below for easier review.
1. Copy existing baselines to the flag-specific baselines directory for the
tests to be rebaselined:
```bash
Tools/Scripts/run-webkit-tests --additional-driver-flag=--enable-flag --copy-baselines foo/bar/test.html
third_party/blink/tools/run_web_tests.py --additional-driver-flag=--enable-flag --copy-baselines foo/bar/test.html
```
Then add the newly created baseline files, commit and upload the patch.
Note that the above command won't copy baselines for passing tests.

2. Rebaseline the test locally:
```bash
Tools/Scripts/run-webkit-tests --additional-driver-flag=--enable-flag --reset-results foo/bar/test.html
third_party/blink/tools/run_web_tests.py --additional-driver-flag=--enable-flag --reset-results foo/bar/test.html
```
Commit the changes and upload the patch.

Expand Down
6 changes: 3 additions & 3 deletions docs/testing/layout_tests_in_content_shell.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ binaries required to run the tests.

### Running

You can run layout tests using `run-webkit-tests` (in
`src/third_party/WebKit/Tools/Scripts`).
You can run layout tests using `run_web_tests.py` (in
`src/third_party/blink/tools`).

```bash
third_party/WebKit/Tools/Scripts/run-webkit-tests storage/indexeddb
third_party/blink/tools/run_web_tests.py storage/indexeddb
```

or execute the shell directly:
Expand Down
2 changes: 1 addition & 1 deletion docs/testing/layout_tests_tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ assess its flakiness. While not foolproof, this approach gives you some
confidence, and giving up CPU cycles for mental energy is a pretty good trade.

```bash
third_party/WebKit/Tools/Scripts/run-webkit-tests path/to/test.html --repeat-each=100
third_party/blink/tools/run_web_tests.py path/to/test.html --repeat-each=100
```

The
Expand Down
2 changes: 1 addition & 1 deletion docs/testing/web_platform_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ http://web-platform-tests.org/appendix/github-intro.html.
## Running tests

Same as Blink layout tests, you can use
[`run-webkit-tests`](layout_tests.md#running-the-tests) to run any WPT test.
[`run_web_tests.py`](layout_tests.md#running-the-tests) to run any WPT test.

One thing to note is that glob patterns for WPT tests are not yet supported.

Expand Down
4 changes: 2 additions & 2 deletions docs/testing/writing_layout_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ In these situations, a test file will be accompanied by a baseline, which is an
`-expected.txt` file that contains the test's expected output.

The baselines are generated automatically when appropriate by
`run-webkit-tests`, which is described [here](./layout_tests.md), and by the
`run_web_tests.py`, which is described [here](./layout_tests.md), and by the
[rebaselining tools](./layout_test_expectations.md).

Text baselines for `testharness.js` should be avoided, as having a text baseline
Expand Down Expand Up @@ -315,7 +315,7 @@ or features restricted to secure protocols.
HTTP tests are those under `LayoutTests/http/tests` (or virtual variants). Use a
locally running HTTP server (Apache) to run them. Tests are served off of ports
8000 and 8080 for HTTP, and 8443 for HTTPS. If you run the tests using
`run-webkit-tests`, the server will be started automatically. To run the server
`run_web_tests.py`, the server will be started automatically. To run the server
manually to reproduce or debug a failure:

```bash
Expand Down
4 changes: 2 additions & 2 deletions testing/buildbot/gn_isolate_map.pyl
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@
"script": "//testing/scripts/run_isolated_script_test.py",
"args": [
"--xvfb",
"../../third_party/WebKit/Tools/Scripts/run-webkit-tests",
"../../third_party/blink/tools/run_web_tests.py",
"--clobber-old-results",
"--debug-rwt-logging",
"--no-show-results",
Expand All @@ -1327,7 +1327,7 @@
"script": "//testing/scripts/run_isolated_script_test.py",
"args": [
"--xvfb",
"../../third_party/WebKit/Tools/Scripts/run-webkit-tests",
"../../third_party/blink/tools/run_web_tests.py",
"--seed", "4",
"--no-show-results",
"--clobber-old-results",
Expand Down
2 changes: 1 addition & 1 deletion testing/scripts/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
os.path.join(SCRIPT_DIR, os.path.pardir, os.path.pardir))


# run-webkit-tests returns the number of failures as the return
# run_web_tests.py returns the number of failures as the return
# code, but caps the return code at 101 to avoid overflow or colliding
# with reserved values from the shell.
MAX_FAILURES_EXIT_STATUS = 101
Expand Down
4 changes: 2 additions & 2 deletions third_party/WebKit/LayoutTests/FlagExpectations/README.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FlagExpectations stores flag-specific test expectations. To run layout tests
with a flag, use:

run-webkit-tests --additional-driver-flag=--name-of-flag
run_web_tests.py --additional-driver-flag=--name-of-flag

In addition to passing --name-of-flag to the binary, run-webkit-tests will look
In addition to passing --name-of-flag to the binary, run_web_tests.py will look
for test expectations in

FlagExpectations/name-of-flag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ crbug.com/538697 [ Win ] printing/webgl-oversized-printing.html [ Failure Crash
# development, just marking failed tests here is fine enough for tests under
# virtual/outofblink-cors.
#
# ./Tools/Scripts/run-webkit-tests virtual/outofblink-cors
# ./Tools/Scripts/run_web_tests.py virtual/outofblink-cors
# Found 2061 tests; running 2060, skipping 1.
# 2060 tests ran as expected (1968 passed, 92 didn't).

Expand Down
4 changes: 2 additions & 2 deletions third_party/WebKit/LayoutTests/NeverFixTests
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file should only include tests that we never want to run.
# There should only be the following categories of tests here:
# 1. Tests of the test harness (run-webkit-tests) itself.
# 1. Tests of the test harness (run_web_tests.py) itself.
# 2. Tests enabled by chromium embedders (e.g. Opera).
# 3. Tests that apply to some platforms but not others.
# 4. Tests that are too slow in Debug and so we only want to skip them in Debug.
Expand Down Expand Up @@ -1829,7 +1829,7 @@ crbug.com/457718 external/wpt/css/css-pseudo/marker-font-properties.html [ WontF
external/wpt/mediacapture-streams/MediaStream-default-feature-policy.https.html [ WontFix ]

# These directories have manual tests that don't have to run with
# run-webkit-tests; see https://crbug.com/359838.
# run_web_tests.py; see https://crbug.com/359838.
http/tests/ManualTests/ [ WontFix ]

# These test produce invisible different pixels on Win7 Debug.
Expand Down
2 changes: 1 addition & 1 deletion third_party/WebKit/LayoutTests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ crbug.com/826878 [ Mac ] virtual/color_space/fast/canvas/color-space/toDataURL-c
# development, just marking failed tests here is fine enough for tests under
# virtual/outofblink-cors.
#
# ./Tools/Scripts/run-webkit-tests virtual/outofblink-cors
# ./thrid_party/blink/tools/run_web_tests.py virtual/outofblink-cors
# Found 2061 tests; running 2060, skipping 1.
# 2060 tests ran as expected (1968 passed, 92 didn't).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
if (window.eventSender) {
runTest();
} else {
testFailed("This test is not interactive, please run using run-webkit-tests");
testFailed("This test is not interactive, please run using run_web_tests.py");
}

</script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Test that a leak is not created by assigning a MessagePort to a property of its own listener.

Only works with run-webkit-tests --leaks.
Only works with run_web_tests.py --leaks.


Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<body>
<p>Test that a leak is not created by assigning a MessagePort to a property of its own listener.</p>
<p>Only works with run-webkit-tests --leaks.</p>
<p>Only works with run_web_tests.py --leaks.</p>
<pre id=log></pre>
<script src="../../resources/gc.js"></script>
<script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This test verifies that the Home/End/PageUp/PageDown keys work correctly for <select> elements. Since it requires eventSender.keyDown, it will not run solo in the web browser; it must be run with run-webkit-tests.
This test verifies that the Home/End/PageUp/PageDown keys work correctly for <select> elements. Since it requires eventSender.keyDown, it will not run solo in the web browser; it must be run with run_web_tests.py.


PASS sendKeyAndExpectIndex("ss", "PageDown", 0, 3) is true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</head>
<body>
<p>This test verifies that the Home/End/PageUp/PageDown keys work correctly for &lt;select&gt; elements.
Since it requires <CODE>eventSender.keyDown</CODE>, it will not run solo in the web browser; it must be run with <KBD>run-webkit-tests</KBD>.</p>
Since it requires <CODE>eventSender.keyDown</CODE>, it will not run solo in the web browser; it must be run with <KBD>run_web_tests.py</KBD>.</p>
<hr>
<form>
<select name="singleselect" id="ss" size="4" multiple="true">
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a045a7f

Please sign in to comment.