Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(503)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/debugger/fetch-breakpoints.html

Issue 2012873002: [DevTools] Add fetch support for XHR breakpoints (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/debugger/fetch-breakpoints-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/debugger/fetch-breakpoints-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698