blob: 2bb3af4da70bd4c9367848453aac855db06f9d1c [file] [log] [blame]
(async function(testRunner) {
var {page, session, dp} = await testRunner.startBlank('Tests Runtime.queryObjects.');
await dp.Runtime.evaluate({expression: 'document.body'});
let {result:{result:{objectId}}} = await dp.Runtime.evaluate({
expression: 'HTMLBodyElement.prototype'
});
let {result:{objects}} = await dp.Runtime.queryObjects({
prototypeObjectId: objectId
});
let {result:{result}} = await dp.Runtime.callFunctionOn({
objectId: objects.objectId,
functionDeclaration: 'function(){ return this.map(n => n.constructor.name);}',
returnByValue: true
});
testRunner.log(result.value);
await dp.HeapProfiler.collectGarbage();
({result:{result}} = await dp.Runtime.callFunctionOn({
objectId: objects.objectId,
functionDeclaration: 'function(){ return this.map(n => n.tagName);}',
returnByValue: true
}));
testRunner.log(result.value);
testRunner.completeTest();
})