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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/open-in-body-onload-sync-to-invalid-redirect-response-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 a redirect response to a ' +
10 'cross-origin request.');
11
12 var xhr = new XMLHttpRequest;
13 var count = 10; // The crash doesn't always happen. Repeat to capture it.
14
15 function openXHR() {
16 xhr.open('GET', '/');
17 openAndSendCrossOriginSimpleXHRExpectingRedirect();
18 }
19
20 function openAndSendCrossOriginSimpleXHRExpectingRedirect() {
21 xhr.open("GET", "http://localhost:8000/xmlhttprequest/resources/redirect.php?u rl=/");
22 xhr.send();
23 }
24
25 xhr.onerror = function() {
26 --count;
27 if (count <= 0) {
28 setTimeout(finishJSTest, 0);
29 } else {
30 openAndSendCrossOriginSimpleXHRExpectingRedirect();
31 }
32 }
33
34 openAndSendCrossOriginSimpleXHRExpectingRedirect();
35 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698