Commit 34a297f0 authored by dcheng@chromium.org's avatar dcheng@chromium.org

Revert of DevTools: Expand protocol to allow setting DOM event breakpoints on...

Revert of DevTools: Expand protocol to allow setting DOM event breakpoints on a given event target. (https://codereview.chromium.org/320933003/)

Reason for revert:
event-listener-breakpoints.html always timing out on Mac 10.6 (dbg):
http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.6%20(dbg)

Original issue's description:
> DevTools: Expand protocol to allow setting DOM event breakpoints on a given event target.
> 
> This will allow debugger to pause on "load", "error" and etc. event breakpoints only
> when they happen on XHR event targets.
> 
> BUG=381470
> R=yurys, pfeldman@chromium.org
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175882

TBR=pfeldman@chromium.org,yurys@chromium.org,aandrey@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=381470

Review URL: https://codereview.chromium.org/322893006

git-svn-id: svn://svn.chromium.org/blink/trunk@175909 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e587fadc
......@@ -223,7 +223,7 @@ InspectorTest._pausedScript = function(callFrames, reason, auxData, breakpointId
{
if (!InspectorTest._quiet)
InspectorTest.addResult("Script execution paused.");
InspectorTest._pausedScriptArguments = [WebInspector.DebuggerModel.CallFrame.fromPayloadArray(WebInspector.targetManager.activeTarget(), callFrames), reason, breakpointIds, asyncStackTrace, auxData];
InspectorTest._pausedScriptArguments = [WebInspector.DebuggerModel.CallFrame.fromPayloadArray(WebInspector.targetManager.activeTarget(), callFrames), reason, breakpointIds, asyncStackTrace];
if (InspectorTest._waitUntilPausedCallback) {
var callback = InspectorTest._waitUntilPausedCallback;
delete InspectorTest._waitUntilPausedCallback;
......
......@@ -8,7 +8,6 @@ Call stack:
0) testElementClicked (event-listener-breakpoints.html:7)
1) addListenerAndClick (event-listener-breakpoints.html:16)
2) (:1)
Event target: Node
Script execution resumed.
Running: testTimerFiredBreakpoint
......@@ -17,10 +16,3 @@ Call stack:
0) timerFired (event-listener-breakpoints.html:19)
Script execution resumed.
Running: testLoadBreakpointOnXHR
Script execution paused.
Call stack:
0) loadCallback (event-listener-breakpoints.html:42)
Event target: XMLHttpRequest
Script execution resumed.
......@@ -21,29 +21,6 @@ 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");
......@@ -55,17 +32,16 @@ function test()
InspectorTest.waitUntilPaused(paused);
InspectorTest.evaluateInPageWithTimeout("addListenerAndClick()");
function paused(callFrames, reason, breakpointIds, asyncStackTrace, auxData)
function paused(callFrames)
{
InspectorTest.captureStackTrace(callFrames);
printEventTargetName(auxData);
pane._removeBreakpoint("listener:click");
InspectorTest.resumeExecution(resumed);
}
function resumed()
{
InspectorTest.evaluateInPage("addListenerAndClick()", next);
InspectorTest.evaluateInPage("addListenerAndClick())", next);
}
},
......@@ -81,39 +57,8 @@ 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>
......
......@@ -68,8 +68,8 @@ public:
// DOMDebugger API for InspectorFrontend
virtual void setXHRBreakpoint(ErrorString*, const String& url) OVERRIDE;
virtual void removeXHRBreakpoint(ErrorString*, const String& url) OVERRIDE;
virtual void setEventListenerBreakpoint(ErrorString*, const String& eventName, const String* targetName) OVERRIDE;
virtual void removeEventListenerBreakpoint(ErrorString*, const String& eventName, const String* targetName) OVERRIDE;
virtual void setEventListenerBreakpoint(ErrorString*, const String& eventName) OVERRIDE;
virtual void removeEventListenerBreakpoint(ErrorString*, const String& eventName) OVERRIDE;
virtual void setInstrumentationBreakpoint(ErrorString*, const String& eventName) OVERRIDE;
virtual void removeInstrumentationBreakpoint(ErrorString*, const String& eventName) OVERRIDE;
virtual void setDOMBreakpoint(ErrorString*, int nodeId, const String& type) OVERRIDE;
......@@ -104,7 +104,7 @@ private:
InspectorDOMDebuggerAgent(InspectorDOMAgent*, InspectorDebuggerAgent*);
void pauseOnNativeEventIfNeeded(PassRefPtr<JSONObject> eventData, bool synchronous);
PassRefPtr<JSONObject> preparePauseOnNativeEventData(const String& eventName, const AtomicString* targetName);
PassRefPtr<JSONObject> preparePauseOnNativeEventData(bool isDOMEvent, const String& eventName);
// InspectorDOMAgent::Listener implementation.
virtual void domAgentWasEnabled() OVERRIDE;
......@@ -120,8 +120,8 @@ private:
void descriptionForDOMEvent(Node* target, int breakpointType, bool insertion, JSONObject* description);
void updateSubtreeBreakpoints(Node*, uint32_t rootMask, bool set);
bool hasBreakpoint(Node*, int type);
void setBreakpoint(ErrorString*, const String& eventName, const String* targetName);
void removeBreakpoint(ErrorString*, const String& eventName, const String* targetName);
void setBreakpoint(ErrorString*, const String& eventName);
void removeBreakpoint(ErrorString*, const String& eventName);
void clear();
......
......@@ -3348,16 +3348,14 @@
{
"name": "setEventListenerBreakpoint",
"parameters": [
{ "name": "eventName", "type": "string", "description": "DOM Event name to stop on (any DOM event will do)." },
{ "name": "targetName", "type": "string", "optional": true, "description": "EventTarget interface name to stop on. If equal to <code>\"*\"</code> or not provided, will stop on any EventTarget.", "hidden": true }
{ "name": "eventName", "type": "string", "description": "DOM Event name to stop on (any DOM event will do)." }
],
"description": "Sets breakpoint on particular DOM event."
},
{
"name": "removeEventListenerBreakpoint",
"parameters": [
{ "name": "eventName", "type": "string", "description": "Event name." },
{ "name": "targetName", "type": "string", "optional": true, "description": "EventTarget interface name.", "hidden": true }
{ "name": "eventName", "type": "string", "description": "Event name." }
],
"description": "Removes breakpoint on particular DOM event."
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment