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

Unified Diff: LayoutTests/inspector/sources/debugger/event-listener-breakpoints.html

Issue 320933003: DevTools: Expand protocol to allow setting DOM event breakpoints on a given event target. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: skip test on mac 10.6 dbg 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/inspector/sources/debugger/event-listener-breakpoints.html
diff --git a/LayoutTests/inspector/sources/debugger/event-listener-breakpoints.html b/LayoutTests/inspector/sources/debugger/event-listener-breakpoints.html
index dba4a734722654248e934121f12faf6e4cc47dad..c3ade10a218a559b86b86764c832f38839241e96 100644
--- a/LayoutTests/inspector/sources/debugger/event-listener-breakpoints.html
+++ b/LayoutTests/inspector/sources/debugger/event-listener-breakpoints.html
@@ -21,6 +21,29 @@ function timerFired()
return 0;
}
+function addLoadListeners()
+{
+ var xhr = new XMLHttpRequest();
+ xhr.onload = loadCallback;
+ xhr.onerror = loadCallback;
+ xhr.open("GET", "http://localhost/", true);
+
+ var img = new Image();
+ img.onload = sendXHR;
+ img.onerror = sendXHR;
+ img.src = "foo/bar/dummy";
+
+ function sendXHR()
+ {
+ xhr.send();
+ }
+}
+
+function loadCallback()
+{
+ return 0;
+}
+
function test()
{
WebInspector.inspectorView.showPanel("sources");
@@ -32,16 +55,17 @@ function test()
InspectorTest.waitUntilPaused(paused);
InspectorTest.evaluateInPageWithTimeout("addListenerAndClick()");
- function paused(callFrames)
+ function paused(callFrames, reason, breakpointIds, asyncStackTrace, auxData)
{
InspectorTest.captureStackTrace(callFrames);
+ printEventTargetName(auxData);
pane._removeBreakpoint("listener:click");
InspectorTest.resumeExecution(resumed);
}
function resumed()
{
- InspectorTest.evaluateInPage("addListenerAndClick())", next);
+ InspectorTest.evaluateInPage("addListenerAndClick()", next);
}
},
@@ -57,8 +81,39 @@ function test()
pane._removeBreakpoint("instrumentation:timerFired");
InspectorTest.resumeExecution(next);
}
+ },
+
+ function testLoadBreakpointOnXHR(next)
+ {
+ DOMDebuggerAgent.setEventListenerBreakpoint("load", "xmlHTTPrequest"); // test case-insensitive match
+ DOMDebuggerAgent.setEventListenerBreakpoint("error", "XMLHttpRequest");
+ InspectorTest.waitUntilPaused(paused);
+ InspectorTest.evaluateInPageWithTimeout("addLoadListeners()");
+
+ function paused(callFrames, reason, breakpointIds, asyncStackTrace, auxData)
+ {
+ InspectorTest.captureStackTrace(callFrames);
+ printEventTargetName(auxData);
+ DOMDebuggerAgent.removeEventListenerBreakpoint("load", "XMLHttpRequest");
+ DOMDebuggerAgent.removeEventListenerBreakpoint("error", "xmlHTTPrequest");
+ InspectorTest.resumeExecution(resumed);
+ }
+
+ function resumed()
+ {
+ InspectorTest.evaluateInPage("addLoadListeners()", next);
+ }
}
]);
+
+ function printEventTargetName(auxData)
+ {
+ var targetName = auxData && auxData.targetName;
+ if (targetName)
+ InspectorTest.addResult("Event target: " + targetName);
+ else
+ InspectorTest.addResult("FAIL: No event target name received!");
+ }
}
</script>

Powered by Google App Engine
This is Rietveld 408576698