Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/weird-cors-test-case.html

Issue 1894183003: Edge case cors preflight race condition (DON'T SUBMIT). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/testserver.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/testserver.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698