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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners.html

Issue 1950403002: Add the ability to return descedant event listeners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address pfeldman's comments 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
Index: third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners.html b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners.html
index a6eda1f6860aeba5c9e864813a7a37993884aa73..68ffac5c05cc0c8828a8b72b17dbba248bce03f0 100644
--- a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners.html
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners.html
@@ -83,10 +83,28 @@ function test()
function callbackListenersWindow(result)
{
logGetListenersResult("window", result);
- return {callback: calbackStartDivWithListeners};
+ return {callback: callbackGetWindowWithDescendants};
}
-
- function calbackStartDivWithListeners()
+ function callbackGetWindowWithDescendants()
+ {
+ var expression = "window";
+ return { command: "Runtime.evaluate", params: {expression: expression, objectGroup: "event-listeners-test"}, callback: callbackEvalWindowWithDescendants };
+ }
+ function callbackEvalWindowWithDescendants(result)
+ {
+ var id = result.result.objectId;
+ if (id === undefined)
+ throw new Error("objectId is expected");
+ return {
+ command: "DOMDebugger.getEventListeners", params: {objectId: id, descendants: true}, callback: callbackListenersWindowWithDescendants
+ };
+ }
+ function callbackListenersWindowWithDescendants(result)
+ {
+ logGetListenersResult("window & descendants", result);
+ return {callback: callbackStartDivWithListeners};
+ }
+ function callbackStartDivWithListeners()
{
var expression = "(function(){\n\
var div = document.getElementById(\"listeners1\");\n\
@@ -109,10 +127,28 @@ function test()
function callbackListenersDivWithListeners(result)
{
logGetListenersResult("div#listeners1", result);
- return {callback: calbackStartDivWithoutListeners};
+ return {callback: callbackStartDivWithListenersAndDescendants};
}
-
- function calbackStartDivWithoutListeners()
+ function callbackStartDivWithListenersAndDescendants()
+ {
+ var expression = "document.getElementById(\"listeners1\")";
+ return { command: "Runtime.evaluate", params: {expression: expression, objectGroup: "event-listeners-test"}, callback: callbackEvalDivWithListenersAndDescendants };
+ }
+ function callbackEvalDivWithListenersAndDescendants(result)
+ {
+ var id = result.result.objectId;
+ if (id === undefined)
+ throw new Error("objectId is expected");
+ return {
+ command: "DOMDebugger.getEventListeners", params: {objectId: id, descendants: true}, callback: callbackListenersDivWithListenersAndDescendants
+ };
+ }
+ function callbackListenersDivWithListenersAndDescendants(result)
+ {
+ logGetListenersResult("div#listeners1 and descendants", result);
+ return {callback: callbackStartDivWithoutListeners};
+ }
+ function callbackStartDivWithoutListeners()
{
var expression = "(function(){\n\
return document.getElementById(\"listeners2\");\n\
@@ -160,7 +196,9 @@ function test()
}
</script>
</head>
-<div id="listeners1" onload="return 42;"></div>
+<div id="listeners1" onload="return 42;">
+ <div id="listeners1-child" onblur="return 50;"></div>
+</div>
<div id="listeners2"></div>
<body onLoad="runTest();">
</body>

Powered by Google App Engine
This is Rietveld 408576698