| Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/weird-cors-test-case.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/weird-cors-test-case.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/weird-cors-test-case.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..83eb118b695b853290fd1fa032e6f85e1329cc38
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/weird-cors-test-case.html
|
| @@ -0,0 +1,40 @@
|
| +<!DOCTYPE html>
|
| +<script src="../resources/testharness.js"></script>
|
| +<script src="../resources/testharnessreport.js"></script>
|
| +<script src="../resources/get-host-info.js"></script>
|
| +<script src="resources/test-helpers.js"></script>
|
| +<body>
|
| +<script>
|
| +var host_info = get_host_info();
|
| +
|
| +promise_test(t => {
|
| + var scope = 'resources/simple.html';
|
| + var frame;
|
| + var cors_response;
|
| + var worker;
|
| + return service_worker_unregister(t, scope)
|
| + .then(() => with_iframe(scope))
|
| + .then(f => {
|
| + frame = f;
|
| + cors_response = frame.contentWindow.fetch('http://localhost:8888/cors-request', {method: 'PUT'});
|
| + return service_worker_unregister_and_register(t, 'resources/claim-worker.js', scope);
|
| + })
|
| + .then(r => {
|
| + add_completion_callback(() => r.unregister());
|
| + worker = r.installing;
|
| + return wait_for_state(t, r.installing, 'activated');
|
| + })
|
| + .then(() => new Promise(resolve => {
|
| + var c = new MessageChannel();
|
| + worker.postMessage({port: c.port2}, [c.port2]);
|
| + c.port1.onmessage = reply => resolve(reply.data);
|
| + }))
|
| + .then(reply => {
|
| + assert_equals(reply, 'PASS');
|
| + fetch('http://localhost:8888/release');
|
| + return cors_response;
|
| + });
|
| + }, 'Should work');
|
| +
|
| +</script>
|
| +</body>
|
|
|