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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/open-in-body-onload-sync-to-invalid-preflight-handling.html

Issue 1475863005: [Async][WIP] Call FrameLoader::checkCompleted() asynchronously to avoid sync body.onload() Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <script src="/js-test-resources/js-test.js"></script>
3 <body onload="openXHR();">
4 <!-- This embed is necessary to cause the synchronous invocation of onload -->
5 <embed type="text/html; charset=utf-8">
6 <script>
7 window.jsTestIsAsync = true;
8 description('XMLHttpRequest doesn\'t crash even when open() is invoked ' +
9 'synchronously to handling of an invalid preflight response.');
10
11 var xhr = new XMLHttpRequest;
12 var count = 10; // The crash doesn't always happen. Repeat to capture it.
13
14 function openXHR() {
15 xhr.open('GET', '/');
16 openAndSendCrossOriginNonSimpleXHR();
17 }
18
19 function openAndSendCrossOriginNonSimpleXHR() {
20 xhr.open("PUT", "http://localhost:8000/xmlhttprequest/");
21 xhr.send();
22 }
23
24 xhr.onerror = function() {
25 --count;
26 if (count <= 0) {
27 setTimeout(finishJSTest, 0);
28 } else {
29 openAndSendCrossOriginNonSimpleXHR();
30 }
31 }
32
33 openAndSendCrossOriginNonSimpleXHR();
34 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698