Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / debugger-breakpoints / xhr-breakpoints.html
blobfedace4f1a207c2e503f0195c2412d729303f4f9
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>
7 function sendRequest(url)
9 var request = new XMLHttpRequest();
10 request.open("GET", url, true);
11 request.send()
14 function test()
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);
30 function step2()
32 InspectorTest.evaluateInPage("sendRequest('/bar?a=b')", step3);
35 function 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)
50 function resumed()
52 InspectorTest.waitUntilPaused(pausedBar);
53 InspectorTest.evaluateInPage("sendRequest('/bar?a=b')");
55 InspectorTest.resumeExecution(resumed);
58 function pausedBar(callFrames)
60 function resumed()
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)
77 function resumed()
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.");
89 next();
92 ]);
95 </script>
96 </head>
98 <body onload="runTest()">
99 <p>
100 Tests XHR breakpoints.
101 </p>
103 </body>
104 </html>