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

Side by Side 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, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/elements-test.js"></script>
5 <script src="../../../http/tests/inspector/debugger-test.js"></script>
6 <script src="resources/framework.js"></script>
7 <script>
8
9 function appendElement(parentId, childId)
10 {
11 var child = document.createElement("div");
12 child.id = childId;
13 var parent = document.getElementById(parentId);
14 Framework.appendChild(parent, child);
15 }
16
17 function sendXHR(url)
18 {
19 Framework.sendXHR(url);
20 }
21
22 function addListenerAndClick()
23 {
24 function testElementClicked()
25 {
26 return 0;
27 }
28
29 var button = document.getElementById("test");
30 Framework.addEventListener(button, "click", Framework.bind(testElementClicke d, null), true);
31 button.click();
32 }
33
34 function test()
35 {
36 var frameworkRegexString = "/framework\\.js$";
37 WebInspector.experimentsSettings.frameworksDebuggingSupport.enableForTest();
38 WebInspector.settings.skipStackFramesSwitch.set(true);
39 WebInspector.settings.skipStackFramesPattern.set(frameworkRegexString);
40
41 InspectorTest.setQuiet(true);
42
43 InspectorTest.runDebuggerTestSuite([
44 function testDOMBreakpoint(next)
45 {
46 InspectorTest.nodeWithId("rootElement", step1);
47
48 function step1(node)
49 {
50 var pane = WebInspector.domBreakpointsSidebarPane;
51 pane._setBreakpoint(node, pane._breakpointTypes.SubtreeModified, true);
52 InspectorTest.evaluateInPageWithTimeout("appendElement('rootElem ent', 'childElement')");
53 InspectorTest.waitUntilPausedAndDumpStackAndResume(next);
54 }
55 },
56
57 function testXHRBreakpoint(next)
58 {
59 var pane = WebInspector.panels.sources.sidebarPanes.xhrBreakpoints;
60 pane._setBreakpoint("foo", true);
61 InspectorTest.evaluateInPageWithTimeout("sendXHR('/foo?a=b')");
62 InspectorTest.waitUntilPausedAndDumpStackAndResume(next);
63 },
64
65 function testEventListenerBreakpoint(next)
66 {
67 var pane = WebInspector.panels.sources.sidebarPanes.eventListenerBre akpoints;
68 pane._setBreakpoint("listener:click");
69 InspectorTest.evaluateInPageWithTimeout("addListenerAndClick()");
70 InspectorTest.waitUntilPausedAndDumpStackAndResume(next);
71 }
72 ]);
73 }
74
75 </script>
76 </head>
77
78 <body onload="runTest()">
79 <p>
80 Tests framework black-boxing on DOM, XHR and Event breakpoints.
81 </p>
82 <div id="rootElement"></div>
83 <input type=button id="test"></input>
84 </body>
85 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698