gecko-dev/testing/web-platform/tests/workers/Worker-location.sub.any.js
kdillon e5bb05c0bb Bug 1526377 [wpt PR 15164] - Fixing test to use wpt server features., a=testonly
Automatic update from web-platform-tests
Fixing test to use wpt server features.

Change-Id: I6c40eacb5635461375543d857b37bb2bd36a2805
Reviewed-on: https://chromium-review.googlesource.com/c/1446773
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Commit-Queue: Philip Jägenstedt <foolip@chromium.org>
Cr-Commit-Position: refs/heads/master@{#627717}

--

wpt-commits: c0d2352f34b33d8cd346b38db301cfa2c5be92f2
wpt-pr: 15164
2019-02-14 11:38:28 +00:00

14 lines
789 B
JavaScript

// META: global=!default, dedicatedworker, sharedworker
test(() => {
assert_equals(String(WorkerLocation), "function WorkerLocation() { [native code] }");
assert_true(location instanceof Object);
assert_equals(location.href, 'http://{{host}}:{{ports[http][0]}}/workers/Worker-location.sub.any.worker.js');
assert_equals(location.origin, "http://{{host}}:{{ports[http][0]}}");
assert_equals(location.protocol, "http:");
assert_equals(location.host, "{{host}}:{{ports[http][0]}}");
assert_equals(location.hostname, "{{host}}");
assert_equals(location.port, "{{ports[http][0]}}");
assert_equals(location.pathname, "/workers/Worker-location.sub.any.worker.js");
assert_equals(location.search, "");
assert_equals(location.hash, "");
}, 'Test WorkerLocation properties.');