diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index 4cd8c7044f6c..2f859419ffc5 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -14681,6 +14681,10 @@ "path": "hr-time/basic.html", "url": "/hr-time/basic.html" }, + { + "path": "hr-time/basic.worker.js", + "url": "/hr-time/basic.worker" + }, { "path": "hr-time/idlharness.html", "url": "/hr-time/idlharness.html" @@ -26245,6 +26249,38 @@ "path": "url/url-constructor.html", "url": "/url/url-constructor.html" }, + { + "path": "url/urlsearchparams-append.html", + "url": "/url/urlsearchparams-append.html" + }, + { + "path": "url/urlsearchparams-constructor.html", + "url": "/url/urlsearchparams-constructor.html" + }, + { + "path": "url/urlsearchparams-delete.html", + "url": "/url/urlsearchparams-delete.html" + }, + { + "path": "url/urlsearchparams-get.html", + "url": "/url/urlsearchparams-get.html" + }, + { + "path": "url/urlsearchparams-getall.html", + "url": "/url/urlsearchparams-getall.html" + }, + { + "path": "url/urlsearchparams-has.html", + "url": "/url/urlsearchparams-has.html" + }, + { + "path": "url/urlsearchparams-set.html", + "url": "/url/urlsearchparams-set.html" + }, + { + "path": "url/urlsearchparams-stringifier.html", + "url": "/url/urlsearchparams-stringifier.html" + }, { "path": "user-timing/idlharness.html", "url": "/user-timing/idlharness.html" @@ -35420,7 +35456,7 @@ } ] }, - "rev": "a5f15d6bdbeeec010465dc906e542873d64797ec", + "rev": "623c1536821f7536d8ee2859bbeaf0d9738ea707", "url_base": "/", "version": 2 } diff --git a/testing/web-platform/meta/mozilla-sync b/testing/web-platform/meta/mozilla-sync index e9fb93bd84aa..cd459f33df32 100644 --- a/testing/web-platform/meta/mozilla-sync +++ b/testing/web-platform/meta/mozilla-sync @@ -1 +1 @@ -1e125923b6586c58492f54dc396e6cbfd09c6ae2 \ No newline at end of file +f0cc59cdba5802f6981f9325129c4ac4f3c7b805 \ No newline at end of file diff --git a/testing/web-platform/tests/.gitmodules b/testing/web-platform/tests/.gitmodules index 787d28dde644..d4eafdcc4d1c 100644 --- a/testing/web-platform/tests/.gitmodules +++ b/testing/web-platform/tests/.gitmodules @@ -5,3 +5,4 @@ [submodule "tools"] path = tools url = https://github.com/w3c/wpt-tools.git + ignore = dirty \ No newline at end of file diff --git a/testing/web-platform/tests/content-security-policy/blink-contrib/self-doesnt-match-blob.sub.html b/testing/web-platform/tests/content-security-policy/blink-contrib/self-doesnt-match-blob.sub.html index 487e8881bddc..5f388622c417 100644 --- a/testing/web-platform/tests/content-security-policy/blink-contrib/self-doesnt-match-blob.sub.html +++ b/testing/web-platform/tests/content-security-policy/blink-contrib/self-doesnt-match-blob.sub.html @@ -31,6 +31,10 @@ connect-src 'self'; script-src 'self' 'unsafe-inline'; child-src 'self'; worker.onmessage = function(event) { alert_assert(event.data); }; + worker.onerror = function(event) { + alert_assert('TEST COMPLETE'); + event.preventDefault(); + } } catch (e) { alert_assert('TEST COMPLETE'); } diff --git a/testing/web-platform/tests/content-security-policy/blink-contrib/star-doesnt-match-blob.sub.html b/testing/web-platform/tests/content-security-policy/blink-contrib/star-doesnt-match-blob.sub.html index 57fec43b6bb0..fac12b52a65a 100644 --- a/testing/web-platform/tests/content-security-policy/blink-contrib/star-doesnt-match-blob.sub.html +++ b/testing/web-platform/tests/content-security-policy/blink-contrib/star-doesnt-match-blob.sub.html @@ -31,6 +31,10 @@ connect-src 'self'; script-src 'self' 'unsafe-inline'; child-src *; worker.onmessage = function(event) { alert_assert(event.data); }; + worker.onerror = function(event) { + event.preventDefault(); + alert_assert('TEST COMPLETE'); + } } catch (e) { alert_assert('TEST COMPLETE'); } diff --git a/testing/web-platform/tests/hr-time/basic.worker.js b/testing/web-platform/tests/hr-time/basic.worker.js new file mode 100644 index 000000000000..6a9f7a3932a7 --- /dev/null +++ b/testing/web-platform/tests/hr-time/basic.worker.js @@ -0,0 +1,18 @@ +importScripts("/resources/testharness.js"); + +test(function() { + assert_true((performance !== undefined), "WorkerGlobalScope.performance exists"); + assert_equals((typeof performance.now), "function"); +}, "WorkerGlobalScope.performance.now() is a function"); + +test(function() { + assert_true(performance.now() > 0); +}, "WorkerGlobalScope.performance.now() returns a positive number"); + +test(function() { + var now1 = performance.now(); + var now2 = performance.now(); + assert_true((now2-now1) >= 0); + }, "WorkerGlobalScope.performance.now() difference is not negative"); + +done(); diff --git a/testing/web-platform/tests/mixed-content/generic/common.js b/testing/web-platform/tests/mixed-content/generic/common.js index e02e52f6b49e..3881513b2f25 100644 --- a/testing/web-platform/tests/mixed-content/generic/common.js +++ b/testing/web-platform/tests/mixed-content/generic/common.js @@ -83,7 +83,8 @@ function setAttributes(el, attrs) { function bindEvents(element, resolveEventName, rejectEventName) { element.eventPromise = new Promise(function(resolve, reject) { element.addEventListener(resolveEventName || "load", resolve); - element.addEventListener(rejectEventName || "error", reject); + element.addEventListener(rejectEventName || "error", + function(e) { e.preventDefault(); reject(); } ); }); } diff --git a/testing/web-platform/tests/tools/.gitignore b/testing/web-platform/tests/tools/.gitignore index 7a8ba560c9ea..76cfc1005c3a 100644 --- a/testing/web-platform/tests/tools/.gitignore +++ b/testing/web-platform/tests/tools/.gitignore @@ -3,4 +3,4 @@ *.sw[po] *~ \#* - +runner/MANIFEST.json diff --git a/testing/web-platform/tests/tools/manifest/item.py b/testing/web-platform/tests/tools/manifest/item.py index 702682cd70e5..3dee3173bd0f 100644 --- a/testing/web-platform/tests/tools/manifest/item.py +++ b/testing/web-platform/tests/tools/manifest/item.py @@ -1,8 +1,18 @@ +import os import urlparse from abc import ABCMeta, abstractmethod, abstractproperty item_types = ["testharness", "reftest", "manual", "stub", "wdspec"] + +def from_os_path(path): + return path.replace(os.path.sep, "/") + + +def to_os_path(path): + return path.replace("/", os.path.sep) + + def get_source_file(source_files, tests_root, manifest, path): def make_new(): from sourcefile import SourceFile @@ -17,6 +27,7 @@ def get_source_file(source_files, tests_root, manifest, path): return source_files[path] + class ManifestItem(object): __metaclass__ = ABCMeta @@ -58,7 +69,7 @@ class ManifestItem(object): return hash(self.key() + self.meta_key()) def to_json(self): - return {"path": self.path} + return {"path": from_os_path(self.path)} @classmethod def from_json(self, manifest, tests_root, obj, source_files=None): @@ -86,7 +97,8 @@ class URLManifestItem(ManifestItem): @classmethod def from_json(cls, manifest, tests_root, obj, source_files=None): - source_file = get_source_file(source_files, tests_root, manifest, obj["path"]) + source_file = get_source_file(source_files, tests_root, manifest, + to_os_path(obj["path"])) return cls(source_file, obj["url"], url_base=manifest.url_base, @@ -111,7 +123,8 @@ class TestharnessTest(URLManifestItem): @classmethod def from_json(cls, manifest, tests_root, obj, source_files=None): - source_file = get_source_file(source_files, tests_root, manifest, obj["path"]) + source_file = get_source_file(source_files, tests_root, manifest, + to_os_path(obj["path"])) return cls(source_file, obj["url"], url_base=manifest.url_base, @@ -147,7 +160,8 @@ class RefTest(URLManifestItem): @classmethod def from_json(cls, manifest, tests_root, obj, source_files=None): - source_file = get_source_file(source_files, tests_root, manifest, obj["path"]) + source_file = get_source_file(source_files, tests_root, manifest, + to_os_path(obj["path"])) return cls(source_file, obj["url"], obj["references"], @@ -171,5 +185,6 @@ class WebdriverSpecTest(ManifestItem): @classmethod def from_json(cls, manifest, tests_root, obj, source_files=None): - source_file = get_source_file(source_files, tests_root, manifest, obj["path"]) + source_file = get_source_file(source_files, tests_root, manifest, + to_os_path(obj["path"])) return cls(source_file, manifest=manifest) diff --git a/testing/web-platform/tests/url/resources/testharness-extras.js b/testing/web-platform/tests/url/resources/testharness-extras.js new file mode 100644 index 000000000000..c812ca64d19b --- /dev/null +++ b/testing/web-platform/tests/url/resources/testharness-extras.js @@ -0,0 +1,11 @@ +/* +Extending the W3C testharness.js with locally useful functionality. +*/ + +function assert_type_error(f, msg) { + assert_throws(TypeError(), f, msg); +} + +function assert_syntax_error(f, msg) { + assert_throws(SyntaxError(), f, msg); +} diff --git a/testing/web-platform/tests/url/urlsearchparams-append.html b/testing/web-platform/tests/url/urlsearchparams-append.html new file mode 100644 index 000000000000..78a8986e1e59 --- /dev/null +++ b/testing/web-platform/tests/url/urlsearchparams-append.html @@ -0,0 +1,51 @@ + + + + + + + + + + + diff --git a/testing/web-platform/tests/url/urlsearchparams-constructor.html b/testing/web-platform/tests/url/urlsearchparams-constructor.html new file mode 100644 index 000000000000..e2d7b11c1007 --- /dev/null +++ b/testing/web-platform/tests/url/urlsearchparams-constructor.html @@ -0,0 +1,129 @@ + + + + + + + + + + + diff --git a/testing/web-platform/tests/url/urlsearchparams-delete.html b/testing/web-platform/tests/url/urlsearchparams-delete.html new file mode 100644 index 000000000000..f44de89e5417 --- /dev/null +++ b/testing/web-platform/tests/url/urlsearchparams-delete.html @@ -0,0 +1,42 @@ + + + + + + + + + + + diff --git a/testing/web-platform/tests/url/urlsearchparams-get.html b/testing/web-platform/tests/url/urlsearchparams-get.html new file mode 100644 index 000000000000..ff8782561c36 --- /dev/null +++ b/testing/web-platform/tests/url/urlsearchparams-get.html @@ -0,0 +1,33 @@ + + + + + + + + + + + diff --git a/testing/web-platform/tests/url/urlsearchparams-getall.html b/testing/web-platform/tests/url/urlsearchparams-getall.html new file mode 100644 index 000000000000..4285fa256398 --- /dev/null +++ b/testing/web-platform/tests/url/urlsearchparams-getall.html @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/testing/web-platform/tests/url/urlsearchparams-has.html b/testing/web-platform/tests/url/urlsearchparams-has.html new file mode 100644 index 000000000000..1e583c6cfcee --- /dev/null +++ b/testing/web-platform/tests/url/urlsearchparams-has.html @@ -0,0 +1,36 @@ + + + + + + + + + + + diff --git a/testing/web-platform/tests/url/urlsearchparams-set.html b/testing/web-platform/tests/url/urlsearchparams-set.html new file mode 100644 index 000000000000..db0e7a67b757 --- /dev/null +++ b/testing/web-platform/tests/url/urlsearchparams-set.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/url/urlsearchparams-stringifier.html b/testing/web-platform/tests/url/urlsearchparams-stringifier.html new file mode 100644 index 000000000000..4215a21a03b1 --- /dev/null +++ b/testing/web-platform/tests/url/urlsearchparams-stringifier.html @@ -0,0 +1,123 @@ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/workers/Worker_cross_origin_security_err.htm b/testing/web-platform/tests/workers/Worker_cross_origin_security_err.htm index 53e8a7b0537d..647a8b81e263 100644 --- a/testing/web-platform/tests/workers/Worker_cross_origin_security_err.htm +++ b/testing/web-platform/tests/workers/Worker_cross_origin_security_err.htm @@ -4,9 +4,14 @@
diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html b/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html index 196b53bedbe8..2e0dd8db33a7 100644 --- a/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html @@ -12,35 +12,54 @@ // not propogate to the window before the tests finish setup({allow_uncaught_exception: true}); +function testSharedWorkerHelper(t, script) { + try { + var worker = new SharedWorker(script, ''); + worker.onerror = t.step_func_done(function(e) { + assert_true(e instanceof ErrorEvent); + }); + } catch (e) { + t.step_func_done(function(e) { assert_true(true); }); + } +} + test(function() { assert_throws("SecurityError", function() { new SharedWorker('unsupported:', ''); }); }, "unsupported_scheme"); + async_test(function() { var worker = new SharedWorker('data:,onconnect = function(e) { e.ports[0].postMessage(1); }', ''); worker.port.onmessage = this.step_func_done(function(e) { assert_equals(e.data, 1); }); }, "data_url"); -test(function() { - assert_throws("SecurityError", function() { new SharedWorker('javascript:""', ''); }); + +async_test(function(t) { + testSharedWorkerHelper(this, 'javascript:""'); }, "javascript_url"); -test(function() { - assert_throws("SecurityError", function() { new SharedWorker('about:blank', ''); }); + +async_test(function(t) { + testSharedWorkerHelper(this, 'about:blank'); }, "about_blank"); -test(function() { - assert_throws("SecurityError", function() { new SharedWorker('http://www.opera.com/', ''); }); + +async_test(function(t) { + testSharedWorkerHelper(this, 'http://www.opera.com/'); }, "opera_com"); -test(function() { - assert_throws("SecurityError", function() { new SharedWorker(location.protocol+'//'+location.hostname+':81/', ''); }); + +async_test(function(t) { + testSharedWorkerHelper(this, location.protocol+'//'+location.hostname+':81/'); }, "port_81"); -test(function() { - assert_throws("SecurityError", function() { new SharedWorker('https://'+location.hostname+':80/', ''); }); + +async_test(function(t) { + testSharedWorkerHelper(this, 'https://'+location.hostname+':80/'); }, "https_port_80"); -test(function() { - assert_throws("SecurityError", function() { new SharedWorker('https://'+location.hostname+':8000/', ''); }); + +async_test(function(t) { + testSharedWorkerHelper(this, 'https://'+location.hostname+':8000/'); }, "https_port_8000"); -test(function() { - assert_throws("SecurityError", function() { new SharedWorker('http://'+location.hostname+':8012/', ''); }); + +async_test(function(t) { + testSharedWorkerHelper(this, 'http://'+location.hostname+':8012/'); }, "http_port_8012");