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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/sendbeacon/beacon-cross-origin.html

Issue 2702113003: Move tests for sendBeacon to a separate dedicated directory for clearer ownership (Closed)
Patch Set: a Created 3 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
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="/js-test-resources/js-test.js"></script> 4 <script src="/js-test-resources/js-test.js"></script>
5 <script> 5 <script>
6 description("Testing navigator.sendBeacon() cross-origin."); 6 description("Testing navigator.sendBeacon() cross-origin.");
7 7
8 window.jsTestIsAsync = true; 8 window.jsTestIsAsync = true;
9 9
10 function test() { 10 function test() {
11 if (window.testRunner) { 11 if (window.testRunner) {
12 testRunner.dumpAsText(); 12 testRunner.dumpAsText();
13 testRunner.waitUntilDone(); 13 testRunner.waitUntilDone();
14 testRunner.dumpPingLoaderCallbacks(); 14 testRunner.dumpPingLoaderCallbacks();
15 } 15 }
16 16
17 shouldBeTrue('navigator.sendBeacon("http://localhost:8000/navigation/resourc es/save-beacon.php?name=cross-origin", "CrossOrigin");'); 17 shouldBeTrue('navigator.sendBeacon("http://localhost:8000/sendbeacon/resourc es/save-beacon.php?name=cross-origin", "CrossOrigin");');
18 var xhr = new XMLHttpRequest(); 18 var xhr = new XMLHttpRequest();
19 xhr.open("GET", "resources/check-beacon.php?name=cross-origin"); 19 xhr.open("GET", "resources/check-beacon.php?name=cross-origin");
20 xhr.onload = function () { 20 xhr.onload = function () {
21 var lines = xhr.responseText.split("\n"); 21 var lines = xhr.responseText.split("\n");
22 for (var i in lines) 22 for (var i in lines)
23 testPassed(lines[i]); 23 testPassed(lines[i]);
24 finishJSTest(); 24 finishJSTest();
25 }; 25 };
26 xhr.onerror = function () { 26 xhr.onerror = function () {
27 testFailed("Unable to fetch beacon status"); 27 testFailed("Unable to fetch beacon status");
28 finishJSTest(); 28 finishJSTest();
29 }; 29 };
30 xhr.send(); 30 xhr.send();
31 } 31 }
32 </script> 32 </script>
33 </head> 33 </head>
34 <body onload="test();"> 34 <body onload="test();">
35 </body> 35 </body>
36 </html> 36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698