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

Side by Side Diff: LayoutTests/http/tests/navigation/beacon-detached-no-crash.html

Issue 915033002: BatteryManager.getBattery(): gracefully bail on context-detached use. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tidying up test Created 5 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("Accessing Navigator sendBeacon methods on a closed window."); 6 description("Accessing Navigator sendBeacon methods on a closed window.");
7 7
8 window.jsTestIsAsync = true; 8 window.jsTestIsAsync = true;
9 9
10 var w; 10 var w;
11 function processMessage(event) { 11 function processMessage(event) {
12 if (event.data == "opened") { 12 if (event.data == "opened") {
13 w.close(); 13 w.close();
14 } else if (event.data == "closed") { 14 } else if (event.data == "closed") {
15 shouldThrow("w.navigator.sendBeacon()"); 15 shouldThrow("w.navigator.sendBeacon()");
16 shouldBeFalse("w.navigator.sendBeacon('resources/blank.txt', 'detached-s hould-return false')"); 16 shouldBeFalse("w.navigator.sendBeacon('resources/blank.txt', 'detached-s hould-return false')");
17 finishJSTest(); 17 finishJSTest();
18 } 18 }
19 } 19 }
20 20
21 if (window.testRunner) { 21 if (window.testRunner) {
22 testRunner.dumpAsText(); 22 testRunner.dumpAsText();
23 testRunner.setCanOpenWindows(); 23 testRunner.setCanOpenWindows();
24 testRunner.waitUntilDone(); 24 testRunner.waitUntilDone();
25 } 25 }
26 w = window.open('resources/beacon-detached-no-crash-new-window.html'); 26 w = window.open('/js-test-resources/window-postmessage-open-close.html');
Michael van Ouwerkerk 2015/02/12 14:31:32 Can we maybe use relative urls so that things also
sof 2015/02/12 15:51:15 That would be useful to also support for http/test
27 window.addEventListener("message", processMessage, false); 27 window.addEventListener("message", processMessage, false);
28 </script> 28 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698