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: LayoutTests/fast/events/scroll-event-handler-reused-window.html

Issue 240343002: Track event handlers on windows (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Better description for window reuse test. Created 6 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: LayoutTests/fast/events/scroll-event-handler-reused-window.html
diff --git a/LayoutTests/fast/events/scroll-event-handler-reused-window.html b/LayoutTests/fast/events/scroll-event-handler-reused-window.html
new file mode 100644
index 0000000000000000000000000000000000000000..07b6c98a770300a7576d7afb40b3f9456002c515
--- /dev/null
+++ b/LayoutTests/fast/events/scroll-event-handler-reused-window.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<script>
+description('Test tracking event handlers with a reused DOMWindow.');
+
+if (window.testRunner) {
+ testRunner.setCanOpenWindows();
+ testRunner.waitUntilDone();
+}
+
+// |window.open| returns a DOMWindow synchronously without waiting for the
+// network load to finish. Once the load completes, we transition the existing
+// window object to the document instead of creating a new one like we normally
+// would. The purpose of this test is to ensure event handlers added on the
+// window are still present after the window is reused with the new document.
+// See DocumentLoader.cpp for details.
+var newWindow = window.open('resources/conclude-test-in-parent.html');
+newWindow.onscroll = function() {};
+
+function concludeTest() {
+ shouldBe('window.internals.scrollEventHandlerCount(newWindow.document)', '1');
+ testRunner.notifyDone();
+}
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698