Commit 654af1c7 authored by Robert Ma's avatar Robert Ma Committed by Commit Bot

Roll in new version of WPT tools again to include a Windows fix

The previous checkout contains a bug that would cause manifest update to
fail on Windows sometimes, so we are rolling a new version again to
include a high-priority fix:
https://github.com/w3c/web-platform-tests/pull/9737

Bug: 749879
Change-Id: I36495316d5ddea288c7422c2dbed30c1fed6106d
Reviewed-on: https://chromium-review.googlesource.com/944720Reviewed-by: default avatarPhilip Jägenstedt <foolip@chromium.org>
Commit-Queue: Robert Ma <robertma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540364}
parent f14dd9d2
...@@ -51,7 +51,7 @@ Local Modifications: None ...@@ -51,7 +51,7 @@ Local Modifications: None
Name: web-platform-tests - Test Suites for Web Platform specifications Name: web-platform-tests - Test Suites for Web Platform specifications
Short Name: wpt Short Name: wpt
URL: https://github.com/w3c/web-platform-tests/ URL: https://github.com/w3c/web-platform-tests/
Version: 38612167f54c475836c122013756e92b9a8859cc Version: 5122353fba91c9d97599cb94a02fb8ec7ec1384e
License: LICENSES FOR W3C TEST SUITES (http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html) License: LICENSES FOR W3C TEST SUITES (http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html)
License File: wpt/wpt/LICENSE.md License File: wpt/wpt/LICENSE.md
Security Critical: no Security Critical: no
......
...@@ -9,7 +9,7 @@ cd $DIR ...@@ -9,7 +9,7 @@ cd $DIR
TARGET_DIR=$DIR/wpt TARGET_DIR=$DIR/wpt
REMOTE_REPO="https://chromium.googlesource.com/external/w3c/web-platform-tests.git" REMOTE_REPO="https://chromium.googlesource.com/external/w3c/web-platform-tests.git"
WPT_HEAD=38612167f54c475836c122013756e92b9a8859cc WPT_HEAD=5122353fba91c9d97599cb94a02fb8ec7ec1384e
function clone { function clone {
# Remove existing repo if already exists. # Remove existing repo if already exists.
......
...@@ -8,7 +8,7 @@ sys.path.insert(0, os.path.join(here)) ...@@ -8,7 +8,7 @@ sys.path.insert(0, os.path.join(here))
sys.path.insert(0, os.path.join(here, "six")) sys.path.insert(0, os.path.join(here, "six"))
sys.path.insert(0, os.path.join(here, "html5lib")) sys.path.insert(0, os.path.join(here, "html5lib"))
sys.path.insert(0, os.path.join(here, "wptserve")) sys.path.insert(0, os.path.join(here, "wptserve"))
sys.path.insert(0, os.path.join(here, "pywebsocket", "src")) sys.path.insert(0, os.path.join(here, "pywebsocket"))
sys.path.insert(0, os.path.join(here, "third_party", "attrs", "src")) sys.path.insert(0, os.path.join(here, "third_party", "attrs", "src"))
sys.path.insert(0, os.path.join(here, "third_party", "funcsigs")) sys.path.insert(0, os.path.join(here, "third_party", "funcsigs"))
sys.path.insert(0, os.path.join(here, "third_party", "pluggy")) sys.path.insert(0, os.path.join(here, "third_party", "pluggy"))
......
...@@ -3,7 +3,6 @@ import os ...@@ -3,7 +3,6 @@ import os
import re import re
from collections import defaultdict from collections import defaultdict
from six import iteritems, itervalues, viewkeys, string_types from six import iteritems, itervalues, viewkeys, string_types
from tempfile import mkstemp
from .item import ManualTest, WebdriverSpecTest, Stub, RefTestNode, RefTest, TestharnessTest, SupportFile, ConformanceCheckerTest, VisualTest from .item import ManualTest, WebdriverSpecTest, Stub, RefTestNode, RefTest, TestharnessTest, SupportFile, ConformanceCheckerTest, VisualTest
from .log import get_logger from .log import get_logger
...@@ -91,6 +90,8 @@ class Manifest(object): ...@@ -91,6 +90,8 @@ class Manifest(object):
hash_changed = True hash_changed = True
else: else:
new_type, manifest_items = old_type, self._data[old_type][rel_path] new_type, manifest_items = old_type, self._data[old_type][rel_path]
if old_type in ("reftest", "reftest_node") and new_type != old_type:
reftest_changes = True
else: else:
new_type, manifest_items = source_file.manifest_items() new_type, manifest_items = source_file.manifest_items()
...@@ -233,11 +234,6 @@ def write(manifest, manifest_path): ...@@ -233,11 +234,6 @@ def write(manifest, manifest_path):
dir_name = os.path.dirname(manifest_path) dir_name = os.path.dirname(manifest_path)
if not os.path.exists(dir_name): if not os.path.exists(dir_name):
os.makedirs(dir_name) os.makedirs(dir_name)
with open(manifest_path, "wb") as f:
fd, temp_manifest_path = mkstemp(dir=dir_name) json.dump(manifest.to_json(), f, sort_keys=True, indent=1, separators=(',', ': '))
temp_manifest = open(temp_manifest_path, "wb") f.write("\n")
json.dump(manifest.to_json(), temp_manifest,
sort_keys=True, indent=1, separators=(',', ': '))
temp_manifest.write("\n")
os.rename(temp_manifest_path, manifest_path)
os.close(fd)
...@@ -14,6 +14,10 @@ class Git(object): ...@@ -14,6 +14,10 @@ class Git(object):
def get_func(repo_path): def get_func(repo_path):
def git(cmd, *args): def git(cmd, *args):
full_cmd = ["git", cmd] + list(args) full_cmd = ["git", cmd] + list(args)
try:
return subprocess.check_output(full_cmd, cwd=repo_path, stderr=subprocess.STDOUT)
except WindowsError:
full_cmd[0] = "git.bat"
return subprocess.check_output(full_cmd, cwd=repo_path, stderr=subprocess.STDOUT) return subprocess.check_output(full_cmd, cwd=repo_path, stderr=subprocess.STDOUT)
return git return git
......
...@@ -234,8 +234,10 @@ class RoutesBuilder(object): ...@@ -234,8 +234,10 @@ class RoutesBuilder(object):
def add_handler(self, method, route, handler): def add_handler(self, method, route, handler):
self.extra.append((str(method), str(route), handler)) self.extra.append((str(method), str(route), handler))
def add_static(self, path, format_args, content_type, route): def add_static(self, path, format_args, content_type, route, headers=None):
handler = handlers.StaticHandler(path, format_args, content_type) if headers is None:
headers = {}
handler = handlers.StaticHandler(path, format_args, content_type, **headers)
self.add_handler(b"GET", str(route), handler) self.add_handler(b"GET", str(route), handler)
def add_mount_point(self, url_base, path): def add_mount_point(self, url_base, path):
......
{ {
"run": {"path": "run.py", "script": "run", "parser": "create_parser", "help": "Run tests in a browser", "run": {"path": "run.py", "script": "run", "parser": "create_parser", "help": "Run tests in a browser",
"virtualenv": true, "install": ["requests"], "requirements": ["../wptrunner/requirements.txt"]}, "virtualenv": true, "install": ["requests"], "requirements": ["../wptrunner/requirements.txt"]},
"update-expectations": {"path": "update.py", "script": "update_expectations",
"parser": "create_parser_update", "help": "Update expectations files from raw logs.",
"virtualenv": true, "install": ["requests"],
"requirements": ["../wptrunner/requirements.txt"]},
"files-changed": {"path": "testfiles.py", "script": "run_changed_files", "parser": "get_parser", "files-changed": {"path": "testfiles.py", "script": "run_changed_files", "parser": "get_parser",
"help": "Get a list of files that have changed", "virtualenv": false}, "help": "Get a list of files that have changed", "virtualenv": false},
"tests-affected": {"path": "testfiles.py", "script": "run_tests_affected", "parser": "get_parser_affected", "tests-affected": {"path": "testfiles.py", "script": "run_tests_affected", "parser": "get_parser_affected",
......
...@@ -226,6 +226,7 @@ class Chrome(BrowserSetup): ...@@ -226,6 +226,7 @@ class Chrome(BrowserSetup):
else: else:
raise WptrunError("Unable to locate or install chromedriver binary") raise WptrunError("Unable to locate or install chromedriver binary")
class ChromeAndroid(BrowserSetup): class ChromeAndroid(BrowserSetup):
name = "chrome_android" name = "chrome_android"
browser_cls = browser.ChromeAndroid browser_cls = browser.ChromeAndroid
...@@ -314,6 +315,23 @@ https://selenium-release.storage.googleapis.com/index.html ...@@ -314,6 +315,23 @@ https://selenium-release.storage.googleapis.com/index.html
kwargs["webdriver_binary"] = webdriver_binary kwargs["webdriver_binary"] = webdriver_binary
class Safari(BrowserSetup):
name = "safari"
browser_cls = browser.Safari
def install(self, venv):
raise NotImplementedError
def setup_kwargs(self, kwargs):
if kwargs["webdriver_binary"] is None:
webdriver_binary = self.browser.find_webdriver()
if webdriver_binary is None:
raise WptrunError("Unable to locate safaridriver binary")
kwargs["webdriver_binary"] = webdriver_binary
class Sauce(BrowserSetup): class Sauce(BrowserSetup):
name = "sauce" name = "sauce"
browser_cls = browser.Sauce browser_cls = browser.Sauce
...@@ -349,6 +367,7 @@ product_setup = { ...@@ -349,6 +367,7 @@ product_setup = {
"chrome_android": ChromeAndroid, "chrome_android": ChromeAndroid,
"edge": Edge, "edge": Edge,
"ie": InternetExplorer, "ie": InternetExplorer,
"safari": Safari,
"servo": Servo, "servo": Servo,
"sauce": Sauce, "sauce": Sauce,
"opera": Opera, "opera": Opera,
......
...@@ -366,7 +366,7 @@ class StringHandler(object): ...@@ -366,7 +366,7 @@ class StringHandler(object):
self.resp_headers = [("Content-Type", content_type)] self.resp_headers = [("Content-Type", content_type)]
for k, v in headers.iteritems(): for k, v in headers.iteritems():
resp_headers.append((k.replace("_", "-"), v)) self.resp_headers.append((k.replace("_", "-"), v))
self.handler = handler(self.handle_request) self.handler = handler(self.handle_request)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment