Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-log-handle-navigate.html |
| diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-log-handle-navigate.html b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-log-handle-navigate.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cfee1584d52917e40535755b5bfa0ac21ad5dddf |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-log-handle-navigate.html |
| @@ -0,0 +1,46 @@ |
| +<!doctype html> |
| +<html> |
| +<head> |
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script> |
| +<script> |
| +function appendIframe() |
| +{ |
| + var frame = document.createElement("iframe"); |
| + frame.src = "resources/console-log-navigate.html"; |
| + document.body.appendChild(frame); |
| + return new Promise((resolve) => frame.onload = resolve); |
| +} |
| + |
| +function createIframeAndRunTest() |
| +{ |
| + var frame = document.createElement("iframe"); |
| + frame.id = "iframe"; |
| + frame.src = "resources/console-log-navigate-on-load.html"; |
| + frame.onload = () => runTest(); |
| + document.body.appendChild(frame); |
| +} |
| + |
| +function test() |
| +{ |
| + InspectorTest.sendCommandPromise("Runtime.enable", {}) |
| + .then(() => checkExpression("logArray()")) |
| + .then(() => checkExpression("logDate()")) |
| + .then(() => checkExpression("logDateWithArg()")) |
| + .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
|
| + |
| + function checkExpression(expression) |
| + { |
| + var contextId; |
| + InspectorTest.waitForEventPromise("Runtime.executionContextCreated") |
| + .then((result) => contextId = result.params.context.id); |
| + return InspectorTest.sendCommandPromise("Runtime.evaluate", { expression: "appendIframe()", awaitPromise: true}) |
| + .then(() => InspectorTest.sendCommandPromise("Runtime.evaluate", { expression: expression, contextId: contextId })) |
| + .then((r) => InspectorTest.logObject(r)); |
|
dgozman
2016/09/07 23:52:14
Just InspectorTest.logObject?
kozy
2016/09/10 00:20:12
ditto.
|
| + } |
| +} |
| +</script> |
| +</head> |
| +<body onload="createIframeAndRunTest()"> |
| +This tests how navigation is handled from inside debugger code (console.log). |
| +</body> |
| +</html> |