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
Name: web-platform-tests - Test Suites for Web Platform specifications
Short Name: wpt
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 File: wpt/wpt/LICENSE.md
Security Critical: no
......
......@@ -9,7 +9,7 @@ cd $DIR
TARGET_DIR=$DIR/wpt
REMOTE_REPO="https://chromium.googlesource.com/external/w3c/web-platform-tests.git"
WPT_HEAD=38612167f54c475836c122013756e92b9a8859cc
WPT_HEAD=5122353fba91c9d97599cb94a02fb8ec7ec1384e
function clone {
# Remove existing repo if already exists.
......
......@@ -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, "html5lib"))
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", "funcsigs"))
sys.path.insert(0, os.path.join(here, "third_party", "pluggy"))
......
......@@ -3,7 +3,6 @@ import os
import re
from collections import defaultdict
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 .log import get_logger
......@@ -91,6 +90,8 @@ class Manifest(object):
hash_changed = True
else:
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:
new_type, manifest_items = source_file.manifest_items()
......@@ -233,11 +234,6 @@ def write(manifest, manifest_path):
dir_name = os.path.dirname(manifest_path)
if not os.path.exists(dir_name):
os.makedirs(dir_name)
fd, temp_manifest_path = mkstemp(dir=dir_name)
temp_manifest = open(temp_manifest_path, "wb")
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)
with open(manifest_path, "wb") as f:
json.dump(manifest.to_json(), f, sort_keys=True, indent=1, separators=(',', ': '))
f.write("\n")
......@@ -14,7 +14,11 @@ class Git(object):
def get_func(repo_path):
def git(cmd, *args):
full_cmd = ["git", cmd] + list(args)
return subprocess.check_output(full_cmd, cwd=repo_path, stderr=subprocess.STDOUT)
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 git
@classmethod
......
......@@ -234,8 +234,10 @@ class RoutesBuilder(object):
def add_handler(self, method, route, handler):
self.extra.append((str(method), str(route), handler))
def add_static(self, path, format_args, content_type, route):
handler = handlers.StaticHandler(path, format_args, content_type)
def add_static(self, path, format_args, content_type, route, headers=None):
if headers is None:
headers = {}
handler = handlers.StaticHandler(path, format_args, content_type, **headers)
self.add_handler(b"GET", str(route), handler)
def add_mount_point(self, url_base, path):
......
{
"run": {"path": "run.py", "script": "run", "parser": "create_parser", "help": "Run tests in a browser",
"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",
"help": "Get a list of files that have changed", "virtualenv": false},
"tests-affected": {"path": "testfiles.py", "script": "run_tests_affected", "parser": "get_parser_affected",
......
......@@ -226,6 +226,7 @@ class Chrome(BrowserSetup):
else:
raise WptrunError("Unable to locate or install chromedriver binary")
class ChromeAndroid(BrowserSetup):
name = "chrome_android"
browser_cls = browser.ChromeAndroid
......@@ -314,6 +315,23 @@ https://selenium-release.storage.googleapis.com/index.html
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):
name = "sauce"
browser_cls = browser.Sauce
......@@ -349,6 +367,7 @@ product_setup = {
"chrome_android": ChromeAndroid,
"edge": Edge,
"ie": InternetExplorer,
"safari": Safari,
"servo": Servo,
"sauce": Sauce,
"opera": Opera,
......
......@@ -366,7 +366,7 @@ class StringHandler(object):
self.resp_headers = [("Content-Type", content_type)]
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)
......
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