Commit 3fab2ea2 authored by Nate Chapin's avatar Nate Chapin Committed by Commit Bot

Additional web-platform-tests for nested workers

Bug: 31666
Change-Id: Ib4e935437d0bf08fabc6c83103e6979e1c7ac8c8
Reviewed-on: https://chromium-review.googlesource.com/1104953
Commit-Queue: Nate Chapin <japhet@chromium.org>
Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568666}
parent caebb755
<!DOCTYPE html>
<title>DedicatedWorker: import</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
// Starts a dedicated worker for |scriptURL| and waits until the list of // Starts a dedicated worker for |scriptURL| and waits until the list of
// imported modules is sent from the worker. Passes if the list is equal to // imported modules is sent from the worker. Passes if the list is equal to
// |expectedImportedModules|. // |expectedImportedModules|.
...@@ -43,5 +37,3 @@ import_test('resources/dynamic-import-and-then-static-import-worker.js', ...@@ -43,5 +37,3 @@ import_test('resources/dynamic-import-and-then-static-import-worker.js',
import_test('resources/eval-dynamic-import-worker.js', import_test('resources/eval-dynamic-import-worker.js',
['export-on-load-script.js'], ['export-on-load-script.js'],
'eval(import()).'); 'eval(import()).');
</script>
This is a testharness.js-based test.
FAIL Static import. promise_test: Unhandled rejection with value: object "ReferenceError: Worker is not defined"
FAIL Nested static import. promise_test: Unhandled rejection with value: object "ReferenceError: Worker is not defined"
FAIL Static import and then dynamic import. promise_test: Unhandled rejection with value: object "ReferenceError: Worker is not defined"
FAIL Dynamic import. promise_test: Unhandled rejection with value: object "ReferenceError: Worker is not defined"
FAIL Nested dynamic import. promise_test: Unhandled rejection with value: object "ReferenceError: Worker is not defined"
FAIL Dynamic import and then static import. promise_test: Unhandled rejection with value: object "ReferenceError: Worker is not defined"
FAIL eval(import()). promise_test: Unhandled rejection with value: object "ReferenceError: Worker is not defined"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Test terminating a nested workers by calling terminate() from its parent worker assert_equals: expected "Pass" but got "Fail: ReferenceError: Worker is not defined"
Harness: the test ran to completion.
<!DOCTYPE html>
<meta charset="utf-8">
<title>Test terminating a nested workers by calling terminate() from its parent worker</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(function() {
const worker = new Worker("support/parent_of_nested_worker.js");
worker.onmessage = this.step_func_done(function(e) {
assert_equals(e.data, "Pass");
done();
});
worker.postMessage("close");
});
</script>
This is a testharness.js-based test.
FAIL Nested work that closes itself Worker is not defined
Harness: the test ran to completion.
importScripts("/resources/testharness.js");
async_test(function() {
if (!self.Worker)
done();
const worker = new Worker("support/WorkerClose.js");
worker.onmessage = this.step_func_done(function(e) {
assert_equals(e.data, "close");
done();
});
worker.postMessage("close");
}, "Nested work that closes itself");
This is a testharness.js-based test.
FAIL Nested worker that calls importScripts() Worker is not defined
Harness: the test ran to completion.
importScripts("/resources/testharness.js");
async_test(function() {
const worker = new Worker("support/ImportScripts.js");
worker.postMessage("ping");
worker.onmessage = this.step_func_done(function(evt) {
assert_equals(evt.data, "Pass");
worker.terminate();
});
}, "Nested worker that calls importScripts()");
done();
This is a testharness.js-based test.
FAIL Nested worker that issues a sync XHR Worker is not defined
Harness: the test ran to completion.
importScripts("/resources/testharness.js");
async_test(function() {
const worker = new Worker("support/sync_xhr.js");
worker.postMessage("ping");
worker.onmessage = this.step_func_done(function(evt) {
assert_equals(evt.data, "Pass");
worker.terminate();
});
}, "Nested worker that issues a sync XHR");
done();
This is a testharness.js-based test.
FAIL Test terminating a chain of nested workers by calling terminate() from the owning document assert_equals: expected "Pass" but got "Fail: ReferenceError: Worker is not defined"
Harness: the test ran to completion.
<!DOCTYPE html>
<meta charset="utf-8">
<title>Test terminating a chain of nested workers by calling terminate() from the owning document</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(function() {
const worker = new Worker("support/parent_of_nested_worker.js");
worker.onmessage = this.step_func_done(function(e) {
assert_equals(e.data, "Pass");
worker.terminate();
});
});
</script>
try {
var worker = new Worker("WorkerBasic.js");
worker.onmessage = function(e) {
if (e.data == "Pass") {
postMessage("Pass");
} else if (e.data == "close") {
close();
postMessage("Pass");
}
};
worker.postMessage("start");
} catch (e) {
postMessage("Fail: " + e);
}
try
{
const request = new XMLHttpRequest();
request.open("GET", "sync_xhr_target.xml", false);
request.send();
result = request.responseText == "<foo>sometext</foo>\n" ? "Pass" : "Fail";
postMessage(result);
}
catch(ex)
{
result = "Fail";
postMessage(result);
}
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