Skip to content
This repository has been archived by the owner on Jul 18, 2018. It is now read-only.

Commit

Permalink
Roll in new version of wpt tools and modify callers correspondingly
Browse files Browse the repository at this point in the history
* Updated the versions in WPT_HEAD in checkout.sh and README.chromium.
* All wpt commands now have a single entry point, wpt. Include this
  dispatch module in WPTWhiteList.
* The commands for generating manifest, starting wptserve and running
  wpt lint are now "wpt manifest", "wpt serve" and "wpt lint". Change
  webkitpy and PRESUBMIT.py accordingly.
* The new wptserve contains a change for
  fetch/api/abort/general-serviceworker.https.html
  (web-platform-tests/wpt#6484),
  so the test is rebaselined.

Bug: 749879
Change-Id: I214860078add1c391266f063193aa279db414bb0
Reviewed-on: https://chromium-review.googlesource.com/677557
Reviewed-by: Quinten Yearsley <qyearsley@chromium.org>
Commit-Queue: Robert Ma <robertma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504060}
  • Loading branch information
Hexcles authored and Commit Bot committed Sep 25, 2017
1 parent ea69a47 commit 26a8ae1
Show file tree
Hide file tree
Showing 41 changed files with 1,958 additions and 130 deletions.
3 changes: 2 additions & 1 deletion third_party/WebKit/LayoutTests/external/PRESUBMIT.py
Expand Up @@ -14,7 +14,7 @@ def _LintWPT(input_api, output_api):
wpt_path = input_api.os_path.join(input_api.PresubmitLocalPath(), 'wpt')
linter_path = input_api.os_path.join(
input_api.PresubmitLocalPath(), '..', '..', 'Tools', 'Scripts',
'webkitpy', 'thirdparty', 'wpt', 'wpt', 'lint')
'webkitpy', 'thirdparty', 'wpt', 'wpt', 'wpt')

paths_in_wpt = []
for f in input_api.AffectedFiles():
Expand All @@ -31,6 +31,7 @@ def _LintWPT(input_api, output_api):
args = [
input_api.python_executable,
linter_path,
'lint',
'--repo-root=%s' % wpt_path,
'--ignore-glob=*-expected.txt',
] + paths_in_wpt
Expand Down
@@ -1,4 +1,51 @@
This is a testharness.js-based test.
FAIL General fetch abort tests in a service worker Failed to register a ServiceWorker: The script does not have a MIME type.
FAIL Aborting rejects with AbortError promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Aborting rejects with AbortError - no-cors promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
PASS TypeError from request constructor takes priority - RequestInit's window is not null
FAIL TypeError from request constructor takes priority - Input URL is not valid promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL TypeError from request constructor takes priority - Input URL has credentials promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL TypeError from request constructor takes priority - RequestInit's mode is navigate promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL TypeError from request constructor takes priority - RequestInit's referrer is invalid promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL TypeError from request constructor takes priority - RequestInit's method is invalid promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL TypeError from request constructor takes priority - RequestInit's method is forbidden promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL TypeError from request constructor takes priority - RequestInit's mode is no-cors and method is not simple promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
PASS TypeError from request constructor takes priority - RequestInit's cache mode is only-if-cached and mode is not same-origin
PASS TypeError from request constructor takes priority - Request with cache mode: only-if-cached and fetch mode cors
PASS TypeError from request constructor takes priority - Request with cache mode: only-if-cached and fetch mode no-cors
FAIL TypeError from request constructor takes priority - Bad referrerPolicy init parameter value promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
PASS TypeError from request constructor takes priority - Bad mode init parameter value
PASS TypeError from request constructor takes priority - Bad credentials init parameter value
PASS TypeError from request constructor takes priority - Bad cache init parameter value
PASS TypeError from request constructor takes priority - Bad redirect init parameter value
FAIL Request objects have a signal property assert_true: Signal member is present & truthy expected true got false
FAIL Signal on request object promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Signal on request object created from request object promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Signal on request object created from request object, with signal on second request promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Signal on request object created from request object, with signal on second request overriding another promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Signal retained after unrelated properties are overridden by fetch promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Signal removed by setting to null promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Already aborted signal rejects immediately promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Request is still 'used' if signal is aborted before fetching promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL response.arrayBuffer() rejects if already aborted promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL response.blob() rejects if already aborted promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL response.formData() rejects if already aborted promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL response.json() rejects if already aborted promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL response.text() rejects if already aborted promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Already aborted signal does not make request promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Already aborted signal can be used for many fetches promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Signal can be used to abort other fetches, even if another fetch succeeded before aborting promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Underlying connection is closed when aborting after receiving response promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Underlying connection is closed when aborting after receiving response - no-cors promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Fetch aborted & connection closed when aborted after calling response.arrayBuffer() promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Fetch aborted & connection closed when aborted after calling response.blob() promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Fetch aborted & connection closed when aborted after calling response.formData() promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Fetch aborted & connection closed when aborted after calling response.json() promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Fetch aborted & connection closed when aborted after calling response.text() promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Stream errors once aborted. Underlying connection closed. promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Stream errors once aborted, after reading. Underlying connection closed. promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Stream will not error if body is empty. It's closed with an empty queue before it errors. promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Readable stream synchronously cancels with AbortError if aborted before reading promise_test: Unhandled rejection with value: object "ReferenceError: AbortController is not defined"
FAIL Signal state is cloned AbortController is not defined
FAIL Clone aborts with original controller AbortController is not defined
Harness: the test ran to completion.

Expand Up @@ -40,9 +40,9 @@ def __init__(self, port_obj, output_dir):
path_to_wpt_config = fs.join(path_to_wpt_support, 'wpt.config.json')
path_to_wpt_tests = fs.abspath(fs.join(self._port_obj.layout_tests_dir(), 'external', 'wpt'))
path_to_ws_handlers = fs.join(path_to_wpt_tests, 'websockets', 'handlers')
serve_script = fs.join(path_to_wpt_root, 'serve')
wpt_script = fs.join(path_to_wpt_root, 'wpt')
start_cmd = [self._port_obj.host.executable,
'-u', serve_script,
'-u', wpt_script, 'serve',
'--config', path_to_wpt_config,
'--doc_root', path_to_wpt_tests]

Expand Down
Expand Up @@ -22,7 +22,8 @@ def test_init_start_cmd(self):
[
'python',
'-u',
'/mock-checkout/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/serve',
'/mock-checkout/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/wpt',
'serve',
'--config',
'/mock-checkout/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt.config.json',
'--doc_root',
Expand Down
Expand Up @@ -51,9 +51,9 @@ Local Modifications: None
Name: web-platform-tests - Test Suites for Web Platform specifications
Short Name: wpt
URL: https://github.com/w3c/web-platform-tests/
Version: 32aa301b33136f71b1e15594f07ea5345a6305db
Version: 53008fece70040f1886d2ba5ff92a97eed1e4037
License: LICENSES FOR W3C TEST SUITES (http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html)
License File: wpt/wpt/LICENSE
License File: wpt/wpt/LICENSE.md
Security Critical: no
Description: This includes code for the manifest tool, lint tool, and wptserve.
Used to run all supported web-platform-tests as part of Blink
Expand Down
@@ -1,15 +1,18 @@
./.gitignore
./__init__.py
./config.default.json
./CONTRIBUTING.md
./LICENSE.md
./lint
./manifest
./serve
./config.default.json
./serve.py
./wpt
./wpt.py
./tools
./tools/__init__.py
./tools/gitignore
./tools/gitignore/__init__.py
./tools/gitignore/gitignore.py
./tools/html5lib
./tools/html5lib/LICENSE
./tools/html5lib/README.rst
./tools/html5lib/html5lib
./tools/html5lib/html5lib/__init__.py
./tools/html5lib/html5lib/constants.py
Expand Down Expand Up @@ -53,38 +56,57 @@
./tools/html5lib/html5lib/trie/datrie.py
./tools/html5lib/html5lib/trie/py.py
./tools/html5lib/html5lib/utils.py
./tools/html5lib/LICENSE
./tools/html5lib/README.rst
./tools/LICENSE
./tools/lint
./tools/lint/__init__.py
./tools/lint/commands.json
./tools/lint/fnmatch.py
./tools/lint/lint.py
./tools/localpaths.py
./tools/manifest
./tools/manifest/XMLParser.py
./tools/manifest/__init__.py
./tools/manifest/catalog
./tools/manifest/catalog/xhtml.dtd
./tools/manifest/commands.json
./tools/manifest/item.py
./tools/manifest/log.py
./tools/manifest/manifest.py
./tools/manifest/sourcefile.py
./tools/manifest/tests
./tools/manifest/update.py
./tools/manifest/utils.py
./tools/manifest/vcs.py
./tools/manifest/XMLParser.py
./tools/serve
./tools/serve/__init__.py
./tools/serve/commands.json
./tools/serve/serve.py
./tools/six
./tools/six/CHANGES
./tools/six/CONTRIBUTORS
./tools/six/LICENSE
./tools/six/README
./tools/six/six.py
./tools/sslutils
./tools/sslutils/__init__.py
./tools/sslutils/base.py
./tools/sslutils/openssl.py
./tools/sslutils/pregenerated.py
./tools/wptserve/.gitignore
./tools/wpt
./tools/wpt/__init__.py
./tools/wpt/browser.py
./tools/wpt/commands.json
./tools/wpt/install.py
./tools/wpt/markdown.py
./tools/wpt/paths
./tools/wpt/run.py
./tools/wpt/stability.py
./tools/wpt/testfiles.py
./tools/wpt/utils.py
./tools/wpt/virtualenv.py
./tools/wpt/wpt.py
./tools/wptserve
./tools/wptserve/LICENSE
./tools/wptserve/README.md
./tools/wptserve/wptserve
./tools/wptserve/wptserve/__init__.py
./tools/wptserve/wptserve/constants.py
./tools/wptserve/wptserve/handlers.py
Expand Down
Expand Up @@ -9,7 +9,7 @@ cd $DIR

TARGET_DIR=$DIR/wpt
REMOTE_REPO="https://chromium.googlesource.com/external/w3c/web-platform-tests.git"
WPT_HEAD=32aa301b33136f71b1e15594f07ea5345a6305db
WPT_HEAD=53008fece70040f1886d2ba5ff92a97eed1e4037

function clone {
# Remove existing repo if already exists.
Expand All @@ -19,6 +19,11 @@ function clone {
git clone $REMOTE_REPO $TARGET_DIR
cd $TARGET_DIR && git checkout $WPT_HEAD
echo "WPTHead: " `git rev-parse HEAD`

# Apply local changes.
cd $DIR && git apply chromium.patch
# Chromium presubmit requires scripts with shebang to be executable.
chmod 755 $TARGET_DIR/tools/manifest/update.py
}

function reduce {
Expand All @@ -39,7 +44,4 @@ for action in $actions; do
$action
done

# Chromium presubmit requires scripts with shebang to be executable.
chmod 755 $TARGET_DIR/tools/manifest/update.py

# TODO(burnik): Handle the SSL certs and other configuration.
@@ -0,0 +1,43 @@
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/lint/lint.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/lint/lint.py
--- a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/lint/lint.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/lint/lint.py
@@ -725,6 +725,7 @@ def create_parser():
help="Run CSS testsuite specific lints")
parser.add_argument("--repo-root", help="The WPT directory. Use this"
"option if the lint script exists outside the repository")
+ parser.add_argument("--ignore-glob", help="Additional file glob to ignore.")
parser.add_argument("--all", action="store_true", help="If no paths are passed, try to lint the whole "
"working directory, not just files that changed")
return parser
@@ -746,16 +747,21 @@ def main(**kwargs):

paths = lint_paths(kwargs, repo_root)

- return lint(repo_root, paths, output_format, kwargs.get("css_mode", False))
+ ignore_glob = kwargs.get("ignore_glob")

+ return lint(repo_root, paths, output_format, kwargs.get("css_mode", False), ignore_glob)

-def lint(repo_root, paths, output_format, css_mode):
+
+def lint(repo_root, paths, output_format, css_mode, ignore_glob):
error_count = defaultdict(int)
last = None

with open(os.path.join(repo_root, "lint.whitelist")) as f:
whitelist, ignored_files = parse_whitelist(f)

+ if ignore_glob:
+ ignored_files.add(ignore_glob)
+
output_errors = {"json": output_errors_json,
"markdown": output_errors_markdown,
"normal": output_errors_text}[output_format]
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wpt/paths b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wpt/paths
--- a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wpt/paths
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wpt/paths
@@ -1,4 +1,3 @@
-tools/ci/
tools/lint/
tools/manifest/
tools/serve/
Expand Up @@ -15,3 +15,4 @@ webdriver/.idea
.DS_Store
*.rej
_venv
webdriver/.cache
Expand Up @@ -9,7 +9,7 @@
"check_subdomains": true,
"log_level":"debug",
"bind_hostname": true,
"ssl": {"type": "openssl",
"ssl": {"type": "pregenerated",
"encrypt_after_connect": false,
"openssl": {
"openssl_binary": "openssl",
Expand All @@ -18,8 +18,8 @@
"base_conf_path": null
},
"pregenerated": {
"host_key_path": null,
"host_cert_path": null
"host_key_path": "tools/certs/web-platform.test.key",
"host_cert_path": "tools/certs/web-platform.test.pem"
},
"none": {}
},
Expand Down
11 changes: 0 additions & 11 deletions third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/lint

This file was deleted.

This file was deleted.

@@ -0,0 +1,3 @@
{"lint":
{"path": "lint.py", "script": "main", "parser": "create_parser", "help": "Run the lint",
"virtualenv": false}}

0 comments on commit 26a8ae1

Please sign in to comment.