| OLD | NEW |
| 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/resource
s/inspector-protocol-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 | 5 |
| 6 function testFunction() | 6 function testFunction() |
| 7 { | 7 { |
| 8 Promise.resolve().then(function(){ console.log(239); }); | 8 Promise.resolve().then(function(){ console.log(239); }); |
| 9 console.log(42); | 9 console.log(42); |
| 10 console.log(43); | 10 console.log(43); |
| 11 } | 11 } |
| 12 | 12 |
| 13 function test() | 13 function test() |
| 14 { | 14 { |
| 15 InspectorTest.sendCommandOrDie("Runtime.enable", {}); | 15 InspectorTest.sendCommandOrDie("Runtime.enable", {}); |
| 16 InspectorTest.eventHandler["Runtime.consoleAPICalled"] = messageAdded; | 16 InspectorTest.eventHandler["Runtime.consoleAPICalled"] = messageAdded; |
| 17 InspectorTest.sendCommandOrDie("Runtime.evaluate", { "expression": "testFunc
tion()" }); | 17 InspectorTest.sendCommandOrDie("Runtime.evaluate", { "expression": "testFunc
tion()" }); |
| 18 InspectorTest.sendCommandOrDie("Runtime.evaluate", { "expression": "setTimeo
ut(() => console.log(\"finished\"), 0)" }); | 18 InspectorTest.sendCommandOrDie("Runtime.evaluate", { "expression": "setTimeo
ut(() => console.log(\"finished\"), 0)" }); |
| 19 | 19 |
| 20 function messageAdded(result) | 20 function messageAdded(result) |
| 21 { | 21 { |
| 22 InspectorTest.logObject(result.params.args[0]); | 22 InspectorTest.logObject(result.params.args[0]); |
| 23 if (result.params.args[0].value === "finished") | 23 if (result.params.args[0].value === "finished") |
| 24 InspectorTest.completeTest(); | 24 InspectorTest.completeTest(); |
| 25 } | 25 } |
| 26 } | 26 } |
| 27 </script> | 27 </script> |
| 28 </head> | 28 </head> |
| 29 <body onLoad="runTest();"> | 29 <body onLoad="runTest();"> |
| 30 Check that console.log doesn't run microtasks. | 30 Check that console.log doesn't run microtasks. |
| 31 </body> | 31 </body> |
| 32 </html> | 32 </html> |
| OLD | NEW |