Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-memory.js |
| diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-memory.js b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-memory.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1720c060fd38f7708559cfc6e821acb4a3fd3c78 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-memory.js |
| @@ -0,0 +1,21 @@ |
| +(async function(testRunner) { |
| + let {page, session, dp} = await testRunner.startHTML(` |
| + <div id='mydiv'>div from page</div> |
| + `, `Tests that console.memory works correct.`); |
| + |
| + dp.Runtime.enable(); |
| + session.evaluate(` |
| + var frame = document.documentElement.appendChild(document.createElement('iframe')); |
| + frame.src = '${testRunner.url('../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.querySelector("#mydiv").textContent')()); |
|
einbinder
2017/06/26 22:59:23
The constructor is a function, so constructor.cons
dgozman
2017/06/26 23:28:54
I have no idea, but I preserved the original code.
|
| + } |
| + `); |
| + var result = await dp.Runtime.onceConsoleAPICalled(); |
| + testRunner.log('=== Dump console message ==='); |
| + testRunner.log(result.params.args[0].value); |
| + testRunner.completeTest(); |
| +}) |