Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html> | |
| 2 <head> | |
| 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script> | |
| 4 <script> | |
| 5 | |
| 6 function testFunction() | |
| 7 { | |
| 8 Promise.resolve().then(function(){ console.log(239); }); | |
| 9 console.log(42); | |
| 10 console.log(43); | |
| 11 } | |
| 12 | |
| 13 function test() | |
| 14 { | |
| 15 InspectorTest.sendCommandOrDie("Console.enable", {}); | |
| 16 InspectorTest.eventHandler["Console.messageAdded"] = messageAdded; | |
| 17 InspectorTest.sendCommandOrDie("Runtime.evaluate", { "expression": "setTimeo ut(testFunction, 0)" }); | |
| 18 | |
| 19 var messageCount = 3; | |
|
dgozman
2016/04/30 00:07:01
If something goes wrong, this test will timeout. C
| |
| 20 function messageAdded(result) | |
| 21 { | |
| 22 InspectorTest.logObject(result.params.message.parameters[0]); | |
| 23 if (!--messageCount) | |
| 24 InspectorTest.completeTest(); | |
| 25 } | |
| 26 } | |
| 27 </script> | |
| 28 </head> | |
| 29 <body onLoad="runTest();"> | |
| 30 Check that console.log doesn't run microtasks. | |
| 31 </body> | |
| 32 </html> | |
| OLD | NEW |