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

Unified Diff: third_party/WebKit/LayoutTests/inspector/console/command-line-api-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/console/command-line-api-getEventListeners.html
diff --git a/third_party/WebKit/LayoutTests/inspector/console/command-line-api-getEventListeners.html b/third_party/WebKit/LayoutTests/inspector/console/command-line-api-getEventListeners.html
index cbd67914d02719734363fb20019fc4a64feddbcd..c12975027349fea34e52e1903c396a89c1bb2b14 100644
--- a/third_party/WebKit/LayoutTests/inspector/console/command-line-api-getEventListeners.html
+++ b/third_party/WebKit/LayoutTests/inspector/console/command-line-api-getEventListeners.html
@@ -24,6 +24,7 @@ Tests getEventListeners() method of console command line API.
</div>
<button id="button" onclick="alert(1)" onmouseover="listener2()"></button>
<button id="invalid" onclick="Invalid JavaScript"></button>
+<iframe id="aframe" src="resources/eventlistener-in-iframe.html"></iframe>
<script>
function listener1()
{
@@ -38,6 +39,8 @@ document.getElementById("inner").addEventListener("wheel", listener2, {"passive"
document.getElementById("outer").addEventListener("mousemove", listener1, false);
document.getElementById("outer").addEventListener("mousedown", listener2, true);
document.getElementById("outer").addEventListener("keydown", listener2, true);
+document.getElementById("aframe").addEventListener("wheel", listener2, {"passive": true});
+document.getElementById("aframe").addEventListener("keydown", listener2, true);
window.addEventListener("popstate", listener1, false);
function dumpObject(object, prefix)
@@ -102,6 +105,16 @@ function runTestsInPage(getEventListeners)
output(typeof getEventListeners(null));
output("- undefined -");
output(typeof getEventListeners(undefined));
+ output("- descendants window -");
+ dumpObject(getEventListeners(window, {descendants: true}));
+ output("- descendants document -");
+ dumpObject(getEventListeners(document, {descendants: true}));
+ output("- descendants iframe -");
+ dumpObject(getEventListeners(document.getElementById("aframe"), {descendants: true}));
+ output("- descendants window passive -");
+ dumpObject(getEventListeners(window, {descendants: true, passive: true}));
+ output("- descendants window blocking -");
+ dumpObject(getEventListeners(window, {descendants: true, passive: false}));
}
</script>

Powered by Google App Engine
This is Rietveld 408576698