| OLD | NEW |
| (Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script> |
| 6 |
| 7 function testFunction() |
| 8 { |
| 9 var workerScript = ` |
| 10 eval("function foo() {}"); |
| 11 postMessage("ready")`; |
| 12 var blob = new Blob([workerScript], { type: "text/javascript" }); |
| 13 worker = new Worker(URL.createObjectURL(blob)); |
| 14 worker.onmessage = () => { |
| 15 eval("debugger;" + "\n".repeat(10) + "function foo() { }"); |
| 16 } |
| 17 } |
| 18 |
| 19 async function test() |
| 20 { |
| 21 await InspectorTest.startDebuggerTestPromise(); |
| 22 InspectorTest.evaluateInPageWithTimeout("testFunction()"); |
| 23 var sourceFrame = await waitForPausedUISourceCode(); |
| 24 InspectorTest.createNewBreakpoint(sourceFrame, 10, "", true); |
| 25 await InspectorTest.waitJavaScriptSourceFrameBreakpoints(sourceFrame); |
| 26 await InspectorTest.dumpJavaScriptSourceFrameBreakpoints(sourceFrame); |
| 27 InspectorTest.completeDebuggerTest(); |
| 28 |
| 29 function waitForPausedUISourceCode() { |
| 30 return new Promise(resolve => { |
| 31 InspectorTest.addSniffer(Sources.JavaScriptSourceFrame.prototype, "s
etExecutionLocation", function() { |
| 32 InspectorTest.showUISourceCodePromise(this.uiSourceCode()).then(()
=> { |
| 33 resolve(this); |
| 34 }); |
| 35 }); |
| 36 }); |
| 37 } |
| 38 } |
| 39 |
| 40 </script> |
| 41 </head> |
| 42 |
| 43 <body onload="runTest()"> |
| 44 <p>Tests that breakpoints work in anonymous scripts with >1 targets.</p> |
| 45 </body> |
| 46 </html> |
| OLD | NEW |