Commit d7bcd374 authored by Eriko Kurimoto's avatar Eriko Kurimoto Committed by Commit Bot

SharedWorker: Add WPT for NaN and Infinity arguments

This CL adds WPT for SharedWorker.
It checks the behavior when NaN or Infinity is set to ScriptURL and WorkerOptions.

Bug: 10399674
Change-Id: I12d9560ca77e3ed0258ec7ba92af08266ca3bde6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2015869
Commit-Queue: Eriko Kurimoto <elkurin@google.com>
Reviewed-by: default avatarHiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735309}
parent 46e3076f
onconnect = e => {
e.ports[0].postMessage(['Infinity', self.name]);
};
<!doctype html>
<title>Infinity as arguments</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(t => {
const worker = new SharedWorker(Infinity, Infinity);
worker.port.onmessage = t.step_func_done(e => {
assert_equals(e.data[0], 'Infinity', 'first arg (script name)');
assert_equals(e.data[1], 'Infinity', 'second arg (worker name)');
});
}, 'Test constructing a shared worker with Infinity');
</script>
onconnect = e => {
e.ports[0].postMessage(['NaN', self.name]);
};
<!doctype html>
<title>NaN as arguments</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(t => {
const worker = new SharedWorker(NaN, NaN);
worker.port.onmessage = t.step_func_done(e => {
assert_equals(e.data[0], 'NaN', 'first arg (script name)');
assert_equals(e.data[1], 'NaN', 'second arg (worker name)');
});
}, 'Test constructing a shared worker with NaN');
</script>
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