| Index: third_party/WebKit/LayoutTests/http/tests/inspector/debugger/fetch-breakpoints.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/debugger/fetch-breakpoints.html b/third_party/WebKit/LayoutTests/http/tests/inspector/debugger/fetch-breakpoints.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..689d3d1d114940d0f134696d43f5841d5665200f
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/debugger/fetch-breakpoints.html
|
| @@ -0,0 +1,102 @@
|
| +<html>
|
| +<head>
|
| +<script src="../inspector-test.js"></script>
|
| +<script src="../debugger-test.js"></script>
|
| +<script>
|
| +
|
| +function sendRequest(url)
|
| +{
|
| + fetch(url);
|
| +}
|
| +
|
| +function test()
|
| +{
|
| + var pane = WebInspector.panels.sources.sidebarPanes.xhrBreakpoints;
|
| + InspectorTest.runDebuggerTestSuite([
|
| + function testFetchBreakpoint(next)
|
| + {
|
| + pane._setBreakpoint("foo", true);
|
| + InspectorTest.waitUntilPaused(step1);
|
| + InspectorTest.evaluateInPageWithTimeout("sendRequest('/foo?a=b')");
|
| +
|
| + function step1(callFrames)
|
| + {
|
| + InspectorTest.captureStackTrace(callFrames);
|
| + InspectorTest.resumeExecution(step2);
|
| + }
|
| +
|
| + function step2()
|
| + {
|
| + InspectorTest.evaluateInPage("sendRequest('/bar?a=b')", step3);
|
| + }
|
| +
|
| + function step3()
|
| + {
|
| + pane._removeBreakpoint("foo");
|
| + InspectorTest.evaluateInPage("sendRequest('/foo?a=b')", next);
|
| + }
|
| + },
|
| +
|
| + function testPauseOnAnyFetch(next)
|
| + {
|
| + pane._setBreakpoint("", true);
|
| + InspectorTest.waitUntilPaused(pausedFoo);
|
| + InspectorTest.evaluateInPageWithTimeout("sendRequest('/foo?a=b')");
|
| +
|
| + function pausedFoo(callFrames)
|
| + {
|
| + function resumed()
|
| + {
|
| + InspectorTest.waitUntilPaused(pausedBar);
|
| + InspectorTest.evaluateInPage("sendRequest('/bar?a=b')");
|
| + }
|
| + InspectorTest.resumeExecution(resumed);
|
| + }
|
| +
|
| + function pausedBar(callFrames)
|
| + {
|
| + function resumed()
|
| + {
|
| + pane._removeBreakpoint("");
|
| + InspectorTest.evaluateInPage("sendRequest('/baz?a=b')", next);
|
| + }
|
| + InspectorTest.resumeExecution(resumed);
|
| + }
|
| + },
|
| +
|
| + function testDisableBreakpoint(next)
|
| + {
|
| + pane._setBreakpoint("", true);
|
| + InspectorTest.waitUntilPaused(paused);
|
| + InspectorTest.evaluateInPage("sendRequest('/foo')");
|
| +
|
| + function paused(callFrames)
|
| + {
|
| + function resumed()
|
| + {
|
| + pane._breakpointElements.get("")._checkboxElement.click();
|
| + InspectorTest.waitUntilPaused(pausedAgain);
|
| + InspectorTest.evaluateInPage("sendRequest('/foo')", next);
|
| + }
|
| + InspectorTest.resumeExecution(resumed);
|
| + }
|
| +
|
| + function pausedAgain(callFrames)
|
| + {
|
| + InspectorTest.addResult("Fail, paused again after breakpoint was removed.");
|
| + next();
|
| + }
|
| + }
|
| + ]);
|
| +}
|
| +
|
| +</script>
|
| +</head>
|
| +
|
| +<body onload="runTest()">
|
| +<p>
|
| +Tests fetch() breakpoints.
|
| +</p>
|
| +
|
| +</body>
|
| +</html>
|
|
|