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

Unified Diff: LayoutTests/inspector/sources/debugger/frameworks-dom-xhr-event-breakpoints.html

Issue 304563002: DevTools: Make frameworks work with "custom" breakpoints (DOM, XHR, Events). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
Index: LayoutTests/inspector/sources/debugger/frameworks-dom-xhr-event-breakpoints.html
diff --git a/LayoutTests/inspector/sources/debugger/frameworks-dom-xhr-event-breakpoints.html b/LayoutTests/inspector/sources/debugger/frameworks-dom-xhr-event-breakpoints.html
new file mode 100644
index 0000000000000000000000000000000000000000..31daa56dd3931112a2c0a2d08880ce383d2226a8
--- /dev/null
+++ b/LayoutTests/inspector/sources/debugger/frameworks-dom-xhr-event-breakpoints.html
@@ -0,0 +1,85 @@
+<html>
+<head>
+<script src="../../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../../http/tests/inspector/elements-test.js"></script>
+<script src="../../../http/tests/inspector/debugger-test.js"></script>
+<script src="resources/framework.js"></script>
+<script>
+
+function appendElement(parentId, childId)
+{
+ var child = document.createElement("div");
+ child.id = childId;
+ var parent = document.getElementById(parentId);
+ Framework.appendChild(parent, child);
+}
+
+function sendXHR(url)
+{
+ Framework.sendXHR(url);
+}
+
+function addListenerAndClick()
+{
+ function testElementClicked()
+ {
+ return 0;
+ }
+
+ var button = document.getElementById("test");
+ Framework.addEventListener(button, "click", Framework.bind(testElementClicked, null), true);
+ button.click();
+}
+
+function test()
+{
+ var frameworkRegexString = "/framework\\.js$";
+ WebInspector.experimentsSettings.frameworksDebuggingSupport.enableForTest();
+ WebInspector.settings.skipStackFramesSwitch.set(true);
+ WebInspector.settings.skipStackFramesPattern.set(frameworkRegexString);
+
+ InspectorTest.setQuiet(true);
+
+ InspectorTest.runDebuggerTestSuite([
+ function testDOMBreakpoint(next)
+ {
+ InspectorTest.nodeWithId("rootElement", step1);
+
+ function step1(node)
+ {
+ var pane = WebInspector.domBreakpointsSidebarPane;
+ pane._setBreakpoint(node, pane._breakpointTypes.SubtreeModified, true);
+ InspectorTest.evaluateInPageWithTimeout("appendElement('rootElement', 'childElement')");
+ InspectorTest.waitUntilPausedAndDumpStackAndResume(next);
+ }
+ },
+
+ function testXHRBreakpoint(next)
+ {
+ var pane = WebInspector.panels.sources.sidebarPanes.xhrBreakpoints;
+ pane._setBreakpoint("foo", true);
+ InspectorTest.evaluateInPageWithTimeout("sendXHR('/foo?a=b')");
+ InspectorTest.waitUntilPausedAndDumpStackAndResume(next);
+ },
+
+ function testEventListenerBreakpoint(next)
+ {
+ var pane = WebInspector.panels.sources.sidebarPanes.eventListenerBreakpoints;
+ pane._setBreakpoint("listener:click");
+ InspectorTest.evaluateInPageWithTimeout("addListenerAndClick()");
+ InspectorTest.waitUntilPausedAndDumpStackAndResume(next);
+ }
+ ]);
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests framework black-boxing on DOM, XHR and Event breakpoints.
+</p>
+<div id="rootElement"></div>
+<input type=button id="test"></input>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698