Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 | 5 |
| 6 function test() | 6 async function test() |
| 7 { | 7 { |
| 8 var messages = []; | 8 var messages = []; |
| 9 function collectMessages(message) | 9 function collectMessages(message) |
| 10 { | 10 { |
| 11 messages.push(message); | 11 messages.push(message); |
| 12 } | 12 } |
| 13 Protocol.TargetBase.prototype._dumpProtocolMessage = collectMessages; | 13 Protocol.TargetBase.prototype._dumpProtocolMessage = collectMessages; |
| 14 Protocol.InspectorBackend.Options.dumpInspectorProtocolMessages = 1; | 14 Protocol.InspectorBackend.Options.dumpInspectorProtocolMessages = 1; |
| 15 messages.push("--> SDK.targetManager.suspendAllTargets();"); | 15 messages.push("--> SDK.targetManager.suspendAllTargets();"); |
| 16 SDK.targetManager.suspendAllTargets(); | 16 await SDK.targetManager.suspendAllTargets(); |
| 17 messages.push(""); | 17 messages.push(""); |
| 18 messages.push("--> SDK.targetManager.resumeAllTargets();"); | 18 messages.push("--> SDK.targetManager.resumeAllTargets();"); |
| 19 SDK.targetManager.resumeAllTargets(); | 19 await SDK.targetManager.resumeAllTargets(); |
| 20 messages.push(""); | 20 messages.push(""); |
| 21 messages.push("--> done"); | 21 messages.push("--> done"); |
| 22 Protocol.InspectorBackend.Options.dumpInspectorProtocolMessages = 0; | 22 Protocol.InspectorBackend.Options.dumpInspectorProtocolMessages = 0; |
| 23 for (var i = 0; i < messages.length; ++i) { | 23 for (var i = 0; i < messages.length; ++i) { |
| 24 var message = messages[i]; | 24 var message = messages[i]; |
| 25 if (message.startsWith('backend')) | |
|
dgozman
2017/05/05 06:10:54
Why this?
lushnikov
2017/05/05 20:58:26
This is needed since i await for suspension and re
| |
| 26 continue; | |
| 25 message = message.replace(/"id":\d+,/, '"id":<number>,'); | 27 message = message.replace(/"id":\d+,/, '"id":<number>,'); |
| 26 InspectorTest.addResult(message); | 28 InspectorTest.addResult(message); |
| 27 } | 29 } |
| 28 InspectorTest.completeTest(); | 30 InspectorTest.completeTest(); |
| 29 } | 31 } |
| 30 | 32 |
| 31 </script> | 33 </script> |
| 32 </head> | 34 </head> |
| 33 | 35 |
| 34 <body onload="runTest()"> | 36 <body onload="runTest()"> |
| 35 <p> | 37 <p> |
| 36 Test that if a profiler is working all the agents are disabled. | 38 Test that if a profiler is working all the agents are disabled. |
| 37 </p> | 39 </p> |
| 38 | 40 |
| 39 </body> | 41 </body> |
| 40 </html> | 42 </html> |
| OLD | NEW |