| <!doctype html> |
| <html> |
| <head> |
| <script src="../../http/tests/inspector/resources/inspector-test.js"></script> |
| <script src="../debugger/resources/breakpoint-options-utilities.js"></script> |
| <script src="../debugger/resources/log-active-stack-trace.js"></script> |
| <script src="../worker/resources/resource-utilities.js"></script> |
| <script src="resources/url-breakpoint-utilities.js"></script> |
| <script> |
| function test() |
| { |
| const type = WI.URLBreakpoint.Type.Text; |
| const url = ""; |
| |
| let suite = InspectorTest.createAsyncSuite("URLBreakpoint.BreakOnAll"); |
| |
| for (let api of ["Fetch", "XHR"]) { |
| suite.addTestCase({ |
| name: "URLBreakpoint.BreakOnAll." + api, |
| description: "Check that debugger pauses for all requests.", |
| async test() { |
| await InspectorTest.URLBreakpoint.createBreakpoint(type, url); |
| |
| InspectorTest.URLBreakpoint.request(api); |
| await WI.debuggerManager.awaitEvent(WI.DebuggerManager.Event.Paused); |
| |
| let targetData = WI.debuggerManager.dataForTarget(WI.debuggerManager.activeCallFrame.target); |
| InspectorTest.log("PAUSED:"); |
| InspectorTest.expectEqual(targetData.pauseReason, WI.DebuggerManager.PauseReason[api], `Pause reason should be ${api}.`); |
| InspectorTest.expectFalse(targetData.pauseData.breakpointURL, "Pause data URL should be empty."); |
| |
| logActiveStackTrace(); |
| |
| await WI.debuggerManager.resume(); |
| }, |
| teardown: InspectorTest.URLBreakpoint.teardown, |
| }); |
| |
| InspectorTest.BreakpointOptions.addTestCases(suite, { |
| testCaseNamePrefix: api + ".", |
| createBreakpoint() { |
| return InspectorTest.URLBreakpoint.createBreakpoint(type, url); |
| }, |
| triggerBreakpoint() { |
| return InspectorTest.URLBreakpoint.request(api); |
| }, |
| }); |
| } |
| |
| suite.runTestCasesAndFinish(); |
| } |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <p>Tests for All Requests URL breakpoint.</p> |
| </body> |
| </html> |