OLD | NEW |
---|---|
(Empty) | |
1 (async function(testRunner) { | |
2 let {page, session, dp} = await testRunner.startHTML(` | |
3 <div id='mydiv'>div from page</div> | |
4 `, `Tests that console.memory works correct.`); | |
5 | |
6 dp.Runtime.enable(); | |
7 session.evaluate(` | |
8 var frame = document.documentElement.appendChild(document.createElement('ifr ame')); | |
9 frame.src = '${testRunner.url('../resources/iframe.html')}'; | |
10 frame.onload = function() { | |
11 var location = frame.contentWindow.location; | |
12 frame.remove(); | |
13 memory = console.__lookupGetter__('memory').call(location); | |
14 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.
| |
15 } | |
16 `); | |
17 var result = await dp.Runtime.onceConsoleAPICalled(); | |
18 testRunner.log('=== Dump console message ==='); | |
19 testRunner.log(result.params.args[0].value); | |
20 testRunner.completeTest(); | |
21 }) | |
OLD | NEW |