Index: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/cross-origin-preflight-timeout.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/cross-origin-preflight-timeout.html b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/cross-origin-preflight-timeout.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..923ea56e2680677b004abf3305c5930274ed4496 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/cross-origin-preflight-timeout.html |
@@ -0,0 +1,19 @@ |
+<!doctype html> |
+<html> |
+<script src="/resources/testharness.js"></script> |
+<script src="/resources/testharnessreport.js"></script> |
+ |
+<script> |
+async_test(t => { |
+ const url = 'http://localhost:8000/xmlhttprequest/resources/access-control-allow-with-delay.php'; |
+ const xhr = new XMLHttpRequest(); |
+ xhr.open('GET', url); |
+ xhr.setRequestHeader('foo', 'bar'); |
+ xhr.timeout = 1500; |
+ xhr.ontimeout = t.step_func_done(() => { |
+ assert_equals(xhr.readyState, 4); |
+ }); |
+ xhr.onload = t.unreached_func('load event fired'); |
+ xhr.send(); |
+ }, 'CORS preflight and the actual request should use the same timer'); |
+</script> |