OLD | NEW |
| (Empty) |
1 <!doctype html> | |
2 <html> | |
3 <head> | |
4 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> | |
5 <script> | |
6 function appendIframe() | |
7 { | |
8 var frame = document.createElement("iframe"); | |
9 frame.src = "resources/console-log-navigate.html"; | |
10 document.body.appendChild(frame); | |
11 return new Promise((resolve) => frame.onload = resolve); | |
12 } | |
13 | |
14 function createIframeAndRunTest() | |
15 { | |
16 var frame = document.createElement("iframe"); | |
17 frame.id = "iframe"; | |
18 frame.src = "resources/console-log-navigate-on-load.html"; | |
19 frame.onload = () => runTest(); | |
20 document.body.appendChild(frame); | |
21 } | |
22 | |
23 function test() | |
24 { | |
25 InspectorTest.sendCommandPromise("Runtime.enable", {}) | |
26 .then(() => checkExpression("logArray()")) | |
27 .then(() => checkExpression("logDate()")) | |
28 .then(() => checkExpression("logDateWithArg()")) | |
29 .then(() => InspectorTest.completeTest()); | |
30 | |
31 function checkExpression(expression) | |
32 { | |
33 var contextId; | |
34 InspectorTest.waitForEventPromise("Runtime.executionContextCreated") | |
35 .then((result) => contextId = result.params.context.id); | |
36 return InspectorTest.sendCommandPromise("Runtime.evaluate", { expression
: "appendIframe()", awaitPromise: true}) | |
37 .then(() => InspectorTest.sendCommandPromise("Runtime.evaluate", { e
xpression: expression, contextId: contextId })) | |
38 .then((r) => logObject(r)); | |
39 } | |
40 | |
41 function logObject(result) | |
42 { | |
43 result.id = 0; | |
44 InspectorTest.logObject(result); | |
45 } | |
46 } | |
47 </script> | |
48 </head> | |
49 <body onload="createIframeAndRunTest()"> | |
50 This tests how navigation is handled from inside debugger code (console.log). | |
51 </body> | |
52 </html> | |
OLD | NEW |