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

Side by Side Diff: LayoutTests/fast/events/event-on-xhr-document.html

Issue 206223005: Forbid setting responseType on all sync XHRs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix tests that set responseType on sync XHRs. Created 6 years, 9 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script> 7 <script>
8 8
9 function handle(list, id, event) 9 function handle(list, id, event)
10 { 10 {
(...skipping 13 matching lines...) Expand all
24 24
25 window.caughtFoo.length = 0; 25 window.caughtFoo.length = 0;
26 target.dispatchEvent(new CustomEvent("foo", { bubbles: true })); 26 target.dispatchEvent(new CustomEvent("foo", { bubbles: true }));
27 shouldBe("window.caughtFoo", "['foo@target', 'foo@root']"); 27 shouldBe("window.caughtFoo", "['foo@target', 'foo@root']");
28 28
29 window.caughtFoo.length = 0; 29 window.caughtFoo.length = 0;
30 target.dispatchEvent(new MouseEvent("click", { bubbles: true })); 30 target.dispatchEvent(new MouseEvent("click", { bubbles: true }));
31 shouldBe("window.caughtFoo", "[]"); 31 shouldBe("window.caughtFoo", "[]");
32 } 32 }
33 33
34 window.jsTestIsAsync = true;
35
34 var xhrForXML = new XMLHttpRequest(); 36 var xhrForXML = new XMLHttpRequest();
35 xhrForXML.open("GET", "resources/hello-xhr-event.xml", false); 37 xhrForXML.open("GET", "resources/hello-xhr-event.xml", false);
36 xhrForXML.send(); 38 xhrForXML.send();
37 testEventsFiredOn(xhrForXML.responseXML); 39 testEventsFiredOn(xhrForXML.responseXML);
38 40
41 // Must run asynchronous to use responseType.
39 var xhrForHTML = new XMLHttpRequest(); 42 var xhrForHTML = new XMLHttpRequest();
40 xhrForHTML.open("GET", "resources/hello-xhr-event.html", false); 43 xhrForHTML.open("GET", "resources/hello-xhr-event.html", true);
41 xhrForHTML.responseType = "document"; 44 xhrForHTML.responseType = "document";
45 xhrForHTML.onload = function() {
46 testEventsFiredOn(xhrForHTML.response);
47 finishJSTest();
48 };
42 xhrForHTML.send(); 49 xhrForHTML.send();
43 testEventsFiredOn(xhrForHTML.response);
44 50
45 </script> 51 </script>
46 </body> 52 </body>
47 </html> 53 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/events/xhr-onclick-crash.html » ('j') | LayoutTests/fast/events/xhr-onclick-crash.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698