Bug 1507412 [wpt PR 14066] - Worker: Separate worker-from-blob-url.window.html to filter out failing tests in a more fine-grained way, a=testonly
authorHiroki Nakagawa <nhiroki@chromium.org>
Thu, 22 Nov 2018 10:34:28 +0000
changeset 504350 c46b59962f2e00e7f1d5e3957c4186e9b056888c
parent 504349 5c99519fee0949fb0d26fd9d6b036143e672d0ac
child 504351 02868188c96f86cde78d1242b7cb15d888d42ad7
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1507412, 14066, 655458, 800898, 1337129, 609586
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1507412 [wpt PR 14066] - Worker: Separate worker-from-blob-url.window.html to filter out failing tests in a more fine-grained way, a=testonly Automatic update from web-platform-testsWorker: Separate worker-from-blob-url.window.html to filter out failing tests in a more fine-grained way This test file should be separated into 2 files (one for dedicated workers and the other for shared workers). This is because Edge and Safari don't support shared workers, and Chrome has an issue on shared workers with Blob URL revocation, so some tests are expected to fail on them. By separating the file, browsers can filter out failing tests in a more fine grained way. Bug: 655458, 800898 Change-Id: I9ea6c76dc9b6841bf6aaa98251c81f292dd460cf Reviewed-on: https://chromium-review.googlesource.com/c/1337129 Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Matt Falkenhagen <falken@chromium.org> Cr-Commit-Position: refs/heads/master@{#609586} -- wpt-commits: d0a6ed2b3686ac287842e4b8e813b44ee14553ff wpt-pr: 14066
testing/web-platform/tests/workers/dedicated-worker-from-blob-url.window.js
testing/web-platform/tests/workers/shared-worker-from-blob-url.window.js
testing/web-platform/tests/workers/worker-from-blob-url.window.js
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/workers/dedicated-worker-from-blob-url.window.js
@@ -0,0 +1,28 @@
+function message_from_port(port) {
+  return new Promise(resolve => {
+    port.onmessage = e => resolve(e.data);
+  });
+}
+
+promise_test(async t => {
+  const run_result = 'worker_OK';
+  const blob_contents = 'self.postMessage("' + run_result + '");';
+  const blob = new Blob([blob_contents]);
+  const url = URL.createObjectURL(blob);
+
+  const worker = new Worker(url);
+  const reply = await message_from_port(worker);
+  assert_equals(reply, run_result);
+}, 'Creating a dedicated worker from a blob URL works.');
+
+promise_test(async t => {
+  const run_result = 'worker_OK';
+  const blob_contents = 'self.postMessage("' + run_result + '");';
+  const blob = new Blob([blob_contents]);
+  const url = URL.createObjectURL(blob);
+
+  const worker = new Worker(url);
+  URL.revokeObjectURL(url);
+  const reply = await message_from_port(worker);
+  assert_equals(reply, run_result);
+}, 'Creating a dedicated worker from a blob URL works immediately before revoking.');
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/workers/shared-worker-from-blob-url.window.js
@@ -0,0 +1,53 @@
+function message_from_port(port) {
+  return new Promise(resolve => {
+    port.onmessage = e => resolve(e.data);
+  });
+}
+
+promise_test(async t => {
+  const run_result = 'worker_OK_';
+  const blob_contents =
+    'self.counter = 0; self.onconnect = e => {++self.counter;' +
+    'e.source.postMessage("' + run_result + '" + self.counter); };';
+  const blob = new Blob([blob_contents]);
+  const url = URL.createObjectURL(blob);
+
+  const worker1 = new SharedWorker(url);
+  const reply1 = await message_from_port(worker1.port);
+  assert_equals(reply1, run_result + '1');
+  const worker2 = new SharedWorker(url);
+  const reply2 = await message_from_port(worker2.port);
+  assert_equals(reply2, run_result + '2');
+}, 'Creating a shared worker from a blob URL works.');
+
+promise_test(async t => {
+  const run_result = 'worker_OK';
+  const blob_contents =
+    'self.onconnect = e => { e.source.postMessage("' + run_result + '"); };';
+  const blob = new Blob([blob_contents]);
+  const url = URL.createObjectURL(blob);
+
+  const worker = new SharedWorker(url);
+  URL.revokeObjectURL(url);
+
+  const reply = await message_from_port(worker.port);
+  assert_equals(reply, run_result);
+}, 'Creating a shared worker from a blob URL works immediately before revoking.');
+
+promise_test(async t => {
+  const run_result = 'worker_OK_';
+  const blob_contents =
+    'self.counter = 0; self.onconnect = e => {++self.counter;' +
+    'e.source.postMessage("' + run_result + '" + self.counter); };';
+  const blob = new Blob([blob_contents]);
+  const url = URL.createObjectURL(blob);
+
+  const worker1 = new SharedWorker(url);
+  URL.revokeObjectURL(url);
+
+  const reply1 = await message_from_port(worker1.port);
+  assert_equals(reply1, run_result + '1');
+  const worker2 = new SharedWorker(url);
+  const reply2 = await message_from_port(worker2.port);
+  assert_equals(reply2, run_result + '2');
+}, 'Connecting to a shared worker on a revoked blob URL works.');
deleted file mode 100644
--- a/testing/web-platform/tests/workers/worker-from-blob-url.window.js
+++ /dev/null
@@ -1,77 +0,0 @@
-function message_from_port(port) {
-  return new Promise(resolve => {
-    port.onmessage = e => resolve(e.data);
-  });
-}
-
-promise_test(async t => {
-  const run_result = 'worker_OK';
-  const blob_contents = 'self.postMessage("' + run_result + '");';
-  const blob = new Blob([blob_contents]);
-  const url = URL.createObjectURL(blob);
-
-  const worker = new Worker(url);
-  const reply = await message_from_port(worker);
-  assert_equals(reply, run_result);
-}, 'Creating a dedicated worker from a blob URL works.');
-
-promise_test(async t => {
-  const run_result = 'worker_OK';
-  const blob_contents = 'self.postMessage("' + run_result + '");';
-  const blob = new Blob([blob_contents]);
-  const url = URL.createObjectURL(blob);
-
-  const worker = new Worker(url);
-  URL.revokeObjectURL(url);
-  const reply = await message_from_port(worker);
-  assert_equals(reply, run_result);
-}, 'Creating a dedicated worker from a blob URL works immediately before revoking.');
-
-promise_test(async t => {
-  const run_result = 'worker_OK_';
-  const blob_contents =
-    'self.counter = 0; self.onconnect = e => {++self.counter;' +
-    'e.source.postMessage("' + run_result + '" + self.counter); };';
-  const blob = new Blob([blob_contents]);
-  const url = URL.createObjectURL(blob);
-
-  const worker1 = new SharedWorker(url);
-  const reply1 = await message_from_port(worker1.port);
-  assert_equals(reply1, run_result + '1');
-  const worker2 = new SharedWorker(url);
-  const reply2 = await message_from_port(worker2.port);
-  assert_equals(reply2, run_result + '2');
-}, 'Creating a shared worker from a blob URL works.');
-
-promise_test(async t => {
-  const run_result = 'worker_OK';
-  const blob_contents =
-    'self.onconnect = e => { e.source.postMessage("' + run_result + '"); };';
-  const blob = new Blob([blob_contents]);
-  const url = URL.createObjectURL(blob);
-
-  const worker = new SharedWorker(url);
-  URL.revokeObjectURL(url);
-
-  const reply = await message_from_port(worker.port);
-  assert_equals(reply, run_result);
-}, 'Creating a shared worker from a blob URL works immediately before revoking.');
-
-
-promise_test(async t => {
-  const run_result = 'worker_OK_';
-  const blob_contents =
-    'self.counter = 0; self.onconnect = e => {++self.counter;' +
-    'e.source.postMessage("' + run_result + '" + self.counter); };';
-  const blob = new Blob([blob_contents]);
-  const url = URL.createObjectURL(blob);
-
-  const worker1 = new SharedWorker(url);
-  URL.revokeObjectURL(url);
-
-  const reply1 = await message_from_port(worker1.port);
-  assert_equals(reply1, run_result + '1');
-  const worker2 = new SharedWorker(url);
-  const reply2 = await message_from_port(worker2.port);
-  assert_equals(reply2, run_result + '2');
-}, 'Connecting to a shared worker on a revoked blob URL works.');