3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
6 function testFunction()
8 setTimeout(hotFunction, 0);
11 var terminated = false;
12 function hotFunction() {
13 evaluateInFrontend("InspectorTest.didFireTimer()");
18 // Without this try/catch v8 will optimize the function and break will not work.
20 if (Date.now() - ts > 1000) {
22 console.error("Message #" + message_id++);
31 InspectorTest.sendCommand("Inspector.enable", {});
32 InspectorTest.sendCommand("Debugger.enable", {}, didEnableDebugger);
33 function didEnableDebugger()
35 // Start tight loop in page.
36 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "testFunction()" }, didEval);
39 InspectorTest.log("didEval");
43 InspectorTest.didFireTimer = function()
45 InspectorTest.log("didFireTimer");
46 InspectorTest.sendCommand("Debugger.pause", { });
49 InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
51 var message = messageObject["params"]["message"];
52 InspectorTest.log("SUCCESS: Paused");
53 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "terminated = true;" });
54 InspectorTest.sendCommand("Debugger.resume", { });
55 InspectorTest.completeTest();
60 <body onLoad="runTest();">