3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/debugger-test.js"></script>
7 function sendRequest(url
)
9 var request
= new XMLHttpRequest();
10 request
.open("GET", url
, true);
16 var pane
= WebInspector
.panels
.sources
.sidebarPanes
.xhrBreakpoints
;
17 InspectorTest
.runDebuggerTestSuite([
18 function testXHRBreakpoint(next
)
20 pane
._setBreakpoint("foo", true);
21 InspectorTest
.waitUntilPaused(step1
);
22 InspectorTest
.evaluateInPageWithTimeout("sendRequest('/foo?a=b')");
24 function step1(callFrames
)
26 InspectorTest
.captureStackTrace(callFrames
);
27 InspectorTest
.resumeExecution(step2
);
32 InspectorTest
.evaluateInPage("sendRequest('/bar?a=b')", step3
);
37 pane
._removeBreakpoint("foo");
38 InspectorTest
.evaluateInPage("sendRequest('/foo?a=b')", next
);
42 function testPauseOnAnyXHR(next
)
44 pane
._setBreakpoint("", true);
45 InspectorTest
.waitUntilPaused(pausedFoo
);
46 InspectorTest
.evaluateInPageWithTimeout("sendRequest('/foo?a=b')");
48 function pausedFoo(callFrames
)
52 InspectorTest
.waitUntilPaused(pausedBar
);
53 InspectorTest
.evaluateInPage("sendRequest('/bar?a=b')");
55 InspectorTest
.resumeExecution(resumed
);
58 function pausedBar(callFrames
)
62 pane
._removeBreakpoint("");
63 InspectorTest
.evaluateInPage("sendRequest('/baz?a=b')", next
);
65 InspectorTest
.resumeExecution(resumed
);
69 function testDisableBreakpoint(next
)
71 pane
._setBreakpoint("", true);
72 InspectorTest
.waitUntilPaused(paused
);
73 InspectorTest
.evaluateInPage("sendRequest('/foo')");
75 function paused(callFrames
)
79 pane
._breakpointElements
.get("")._checkboxElement
.click();
80 InspectorTest
.waitUntilPaused(pausedAgain
);
81 InspectorTest
.evaluateInPage("sendRequest('/foo')", next
);
83 InspectorTest
.resumeExecution(resumed
);
86 function pausedAgain(callFrames
)
88 InspectorTest
.addResult("Fail, paused again after breakpoint was removed.");
98 <body onload=
"runTest()">
100 Tests XHR breakpoints.