Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-memory.html

Issue 2139543002: [DevTools] Report console API calls through Runtime. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script> 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script> 4 <script>
5 5
6 function dumpInnerHtml() 6 function dumpInnerHtml()
7 { 7 {
8 frame = document.documentElement.appendChild(document.createElement("iframe" )); 8 frame = document.documentElement.appendChild(document.createElement("iframe" ));
9 frame.src = "resources/iframe.html"; 9 frame.src = "resources/iframe.html";
10 frame.onload = function() 10 frame.onload = function()
11 { 11 {
12 var location = frame.contentWindow.location; 12 var location = frame.contentWindow.location;
13 frame.remove(); 13 frame.remove();
14 memory = console.__lookupGetter__("memory").call(location); 14 memory = console.__lookupGetter__("memory").call(location);
15 console.log(memory.constructor.constructor("return document.querySelecto r(\"#mydiv\").textContent")()); 15 console.log(memory.constructor.constructor("return document.querySelecto r(\"#mydiv\").textContent")());
16 } 16 }
17 } 17 }
18 18
19 function test() 19 function test()
20 { 20 {
21 InspectorTest.sendCommandOrDie("Console.enable", {}); 21 InspectorTest.sendCommandOrDie("Runtime.enable", {});
22 InspectorTest.eventHandler["Console.messageAdded"] = dumpMessageAndCompleTes t; 22 InspectorTest.eventHandler["Runtime.consoleAPICalled"] = dumpMessageAndCompl eTest;
23 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "dumpInnerHtml ()" }); 23 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "dumpInnerHtml ()" });
24 24
25 function dumpMessageAndCompleTest(result) 25 function dumpMessageAndCompleTest(result)
26 { 26 {
27 InspectorTest.log("=== Dump console message ==="); 27 InspectorTest.log("=== Dump console message ===");
28 InspectorTest.log(result.params.message.text); 28 InspectorTest.log(result.params.args[0].value);
29 InspectorTest.completeTest(); 29 InspectorTest.completeTest();
30 } 30 }
31 } 31 }
32 </script> 32 </script>
33 </head> 33 </head>
34 <body onLoad="runTest();">Tests that console.memory works correct.</body> 34 <body onLoad="runTest();">Tests that console.memory works correct.</body>
35 <div id="mydiv">div from page</div> 35 <div id="mydiv">div from page</div>
36 </html> 36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698