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

Side by Side Diff: LayoutTests/http/tests/navigation/beacon-cookie.html

Issue 232053005: Implement navigator.sendBeacon() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Revert CSP checking on redirects Created 6 years, 7 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 <html>
3 <head>
4 <script src="/js-test-resources/js-test.js"></script>
5 <script>
6 description("Checking transmission of Beacons involving cookies.");
7
8 window.jsTestIsAsync = true;
9
10 function test() {
11 if (window.testRunner) {
12 testRunner.dumpAsText();
13 testRunner.waitUntilDone();
14 testRunner.dumpPingLoaderCallbacks();
15 }
16 try {
17 var xhr = new XMLHttpRequest();
18 xhr.open("GET", "../cookies/resources/setCookies.cgi", false);
19 xhr.setRequestHeader("SET-COOKIE", "hello=world;path=/");
20 xhr.send(null);
21 if (xhr.status != 200) {
22 testFailed("cookie not set");
23 finishJSTest();
24 }
25 } catch (e) {
26 testFailed("cookie not set");
27 finishJSTest();
28 }
29
30 shouldBeTrue('navigator.sendBeacon("resources/save-beacon.php?name=cookie", "Blip");');
31 var xhr = new XMLHttpRequest();
32 xhr.open("GET", "resources/check-beacon.php?name=cookie");
33 xhr.onload = function () {
34 var lines = xhr.responseText.split("\n");
35 for (var i in lines)
36 testPassed(lines[i]);
37 finishJSTest();
38 };
39 xhr.onerror = function () {
40 testFailed("Unable to fetch beacon status");
41 finishJSTest();
42 };
43
44 xhr.send();
45 }
46 </script>
47 </head>
48 <body onload="test();">
49 </body>
50 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698