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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-log-handle-navigate.html

Issue 2318853002: [DevTools] Handle navigation in console.log (Closed)
Patch Set: addressed comments Created 4 years, 3 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 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());
dgozman 2016/09/07 23:52:14 Just InspectorTest.completeTest?
kozy 2016/09/10 00:20:12 I'd like to be pretty sure about this and use the
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) => InspectorTest.logObject(r));
dgozman 2016/09/07 23:52:14 Just InspectorTest.logObject?
kozy 2016/09/10 00:20:12 ditto.
39 }
40 }
41 </script>
42 </head>
43 <body onload="createIframeAndRunTest()">
44 This tests how navigation is handled from inside debugger code (console.log).
45 </body>
46 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698