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

Side by Side Diff: LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-sync-requests.html

Issue 24225002: Don't dispatch events when XHR is set to sync mode (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Revert change on network-preflight-options.html Created 7 years, 3 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
1 <HTML> 1 <HTML>
2 <head> 2 <head>
3 <title>Test case for bug 40952</title> 3 <title>Test case for bug 40952</title>
4 </head> 4 </head>
5 <body> 5 <body>
6 <p> Test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=40952"> bug 4 0952</a>: Onloadend event is not supported in XMLHttpRequest</p> 6 <p> Test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=40952"> bug 4 0952</a>: Onloadend event is not supported in XMLHttpRequest</p>
7 <p> Verify that a loadend ProgressEvent is dispatched after a load, error, or ab ort ProgressEvent when a synchronous request completes normally, fails, or is ab orted respectively.</p> 7 <p> Verify that a loadend ProgressEvent is dispatched after a load or abort Prog ressEvent when a synchronous request completes normally or is aborted respective ly.</p>
8 <p>PASS PASS PASS should appear below:</p> 8 <p>PASS PASS PASS should appear below:</p>
9 <p id=console></p> 9 <p id=console></p>
10 <script type="text/javascript"> 10 <script type="text/javascript">
11 if (window.testRunner) { 11 if (window.testRunner) {
12 testRunner.dumpAsText(); 12 testRunner.dumpAsText();
13 testRunner.waitUntilDone(); 13 testRunner.waitUntilDone();
14 } 14 }
15 15
16 function log(message) 16 function log(message)
17 { 17 {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 completeTest(" load loadend"); 54 completeTest(" load loadend");
55 } 55 }
56 56
57 function testError() 57 function testError()
58 { 58 {
59 results = ""; 59 results = "";
60 60
61 xhr.onloadstart = logUnexpectedProgressEvent; 61 xhr.onloadstart = logUnexpectedProgressEvent;
62 xhr.onabort = logUnexpectedProgressEvent; 62 xhr.onabort = logUnexpectedProgressEvent;
63 xhr.onerror = logProgressEvent; 63 xhr.onerror = logUnexpectedProgressEvent;
64 xhr.onload = logUnexpectedProgressEvent; 64 xhr.onload = logUnexpectedProgressEvent;
65 xhr.onloadend = logProgressEvent; 65 xhr.onloadend = logUnexpectedProgressEvent;
66 66
67 xhr.open("GET", "resources/infinite-loop.php", false); 67 xhr.open("GET", "resources/infinite-loop.php", false);
68 try { 68 try {
69 xhr.send(); 69 xhr.send();
70 } 70 }
71 catch (e) { 71 catch (e) {
72 if (e.code != e.NETWORK_ERR) 72 if (e.code != e.NETWORK_ERR)
73 results += " " + e; 73 results += " " + e;
74 } 74 }
75 75
76 completeTest(" error loadend"); 76 completeTest("");
77 } 77 }
78 78
79 function testAbort() 79 function testAbort()
80 { 80 {
81 results = ""; 81 results = "";
82 82
83 xhr.onloadstart = logUnexpectedProgressEvent; 83 xhr.onloadstart = logUnexpectedProgressEvent;
84 xhr.onabort = logProgressEvent; 84 xhr.onabort = logProgressEvent;
85 xhr.onerror = logUnexpectedProgressEvent; 85 xhr.onerror = logUnexpectedProgressEvent;
86 xhr.onload = logUnexpectedProgressEvent; 86 xhr.onload = logUnexpectedProgressEvent;
(...skipping 14 matching lines...) Expand all
101 101
102 completeTest(" abort loadend"); 102 completeTest(" abort loadend");
103 } 103 }
104 104
105 testNormal(); 105 testNormal();
106 testError(); 106 testError();
107 testAbort(); 107 testAbort();
108 108
109 </script> 109 </script>
110 </body> 110 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698