Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-memory.html |
| diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-memory.html b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-memory.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1aa4138c9610ee85a3ab7e096d3db7abd6b90336 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-memory.html |
| @@ -0,0 +1,34 @@ |
| +<html> |
| +<head> |
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script> |
| +<script> |
| + |
| +function dumpInnerHtml() |
| +{ |
| + frame = document.documentElement.appendChild(document.createElement("iframe")); |
| + frame.src = "resources/iframe.html"; |
| + frame.onload = function() |
| + { |
| + var location = frame.contentWindow.location; |
| + frame.remove(); |
| + memory = console.__lookupGetter__("memory").call(location); |
| + console.log(memory.constructor.constructor("return document.body.innerHTML")()); |
|
dgozman
2016/06/03 23:59:07
document.querySelector("#mydiv").textContent
kozy
2016/06/04 00:13:27
Done.
|
| + } |
| +} |
| + |
| +function test() |
| +{ |
| + InspectorTest.sendCommandOrDie("Console.enable", {}); |
| + InspectorTest.eventHandler["Console.messageAdded"] = dumpMessageAndCompleTest; |
| + InspectorTest.sendCommand("Runtime.evaluate", { "expression": "dumpInnerHtml()" }); |
| + |
| + function dumpMessageAndCompleTest(result) |
| + { |
| + InspectorTest.log(result.params.message.text); |
| + InspectorTest.completeTest(); |
| + } |
| +} |
| +</script> |
| +</head> |
| +<body onLoad="runTest();">Tests that console.memory works correct.</body> |
| +</html> |