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

Side by Side Diff: LayoutTests/inspector-protocol/page/javascriptDialogEvents.html

Issue 1180843006: [DevTools] Add dialog type and return value to Page.javascriptDialog{Opening,Closed}. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: frontend Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/page/javascriptDialogEvents-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script> 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script> 4 <script>
5 5
6 window.onbeforeunload = onBeforeUnload; 6 window.onbeforeunload = onBeforeUnload;
7 7
8 function onBeforeUnload() 8 function onBeforeUnload()
9 { 9 {
10 window.removeEventListener("beforeunload", onBeforeUnload); 10 window.removeEventListener("beforeunload", onBeforeUnload);
11 return "beforeunload in javascriptDialogEvents"; 11 return "beforeunload in javascriptDialogEvents";
12 } 12 }
13 13
14 function test() 14 function test()
15 { 15 {
16 InspectorTest.eventHandler["Page.javascriptDialogOpening"] = onOpening; 16 InspectorTest.eventHandler["Page.javascriptDialogOpening"] = onOpening;
17 InspectorTest.eventHandler["Page.javascriptDialogClosed"] = onClosed; 17 InspectorTest.eventHandler["Page.javascriptDialogClosed"] = onClosed;
18 InspectorTest.sendCommand("Page.enable", {}); 18 InspectorTest.sendCommand("Page.enable", {});
19 19
20 function onOpening(event) 20 function onOpening(event)
21 { 21 {
22 InspectorTest.log("Opening with message: " + event.params.message); 22 InspectorTest.log("Opening dialog: type=" + event.params.type + "; messa ge=" + event.params.message);
23 } 23 }
24 function onClosed() 24
25 function onClosed(event)
25 { 26 {
26 InspectorTest.log("Closed"); 27 InspectorTest.log("Closed dialog: result=" + event.params.result);
27 } 28 }
28 29
29 InspectorTest.sendCommand("Page.navigate", { "url": "http://nosuchurl" }); 30 InspectorTest.sendCommand("Page.navigate", { "url": "http://nosuchurl" });
30 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "alert('alert' )" }, onDoneAlert); 31 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "alert('alert' )" }, onDoneAlert);
31 32
32 function onDoneAlert() 33 function onDoneAlert()
33 { 34 {
34 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "confirm(' confirm')" }, onDoneConfirm); 35 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "confirm(' confirm')" }, onDoneConfirm);
35 } 36 }
36 37
37 function onDoneConfirm() 38 function onDoneConfirm()
38 { 39 {
39 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "prompt('p rompt')" }, onDone); 40 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "prompt('p rompt')" }, onDone);
40 } 41 }
41 42
42 function onDone() 43 function onDone()
43 { 44 {
44 InspectorTest.completeTest(); 45 InspectorTest.completeTest();
45 } 46 }
46 } 47 }
47 48
48 </script> 49 </script>
49 </head> 50 </head>
50 <body onload="runTest()"> 51 <body onload="runTest()">
51 </body> 52 </body>
52 </html> 53 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/page/javascriptDialogEvents-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698