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

Unified Diff: LayoutTests/media/video-controls-mouse-events-captured.html

Issue 406213002: If the media controls are visible they should always grab clicks (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Test added - now looking for LGTM or detailed comments. Created 6 years, 5 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/media/video-controls-mouse-events-captured.html
diff --git a/LayoutTests/media/video-controls-mouse-events-captured.html b/LayoutTests/media/video-controls-mouse-events-captured.html
new file mode 100644
index 0000000000000000000000000000000000000000..1a81ec44c60941b7afa4c36616d4aaeeff0f88b8
--- /dev/null
+++ b/LayoutTests/media/video-controls-mouse-events-captured.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+<head>
+
+</head>
+<body>
+ <video controls></video>
+ <p>This tests that a mouse click event on the controls will not be seen by the video element.</p>
+ <script src=media-file.js></script>
+ <script src=video-test.js></script>
+ <script src=media-controls.js></script>
+ <script>
+ var badEventHandler = function(event)
philipj_slow 2014/07/29 11:31:07 function badEventHandler(event) { } seems more idi
aberent 2014/07/31 10:52:47 Done.
+ {
+ failTest(event.type + " reached video element");
+ };
+ video.addEventListener("click", badEventHandler);
acolwell GONE FROM CHROMIUM 2014/07/29 16:23:26 nit: Use waitForEventAndFail() from video-test.js
aberent 2014/07/31 10:52:46 Done.
+ video.addEventListener("dblclick", badEventHandler)
+ video.addEventListener("mousedown", badEventHandler)
+ video.addEventListener("mouseup", badEventHandler)
+
philipj_slow 2014/07/29 11:31:07 There's trailing whitespace here and below.
aberent 2014/07/31 10:52:46 Done. And fixed my Eclipse configuration to do it
+ video.addEventListener("loadeddata", function()
acolwell GONE FROM CHROMIUM 2014/07/29 16:23:26 nit: Use waitForEventOnce() here
aberent 2014/07/31 10:52:47 Actually changed to waitForEventAndEnd().
+ {
+ if (window.eventSender) {
+ // click the play button
+ var coords = mediaControlsButtonCoordinates(video, "play-button");
+ eventSender.mouseMoveTo(coords[0], coords[1]);
+
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+
+ // Click the current time display, which should not respond to events, but
+ // should still capture them
+ coords = mediaControlsButtonCoordinates(video, "current-time-display");
+ eventSender.mouseMoveTo(coords[0], coords[1]);
+
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+
+ // Click the timeline - this tests that multilevel shadow DOM elements work
+ coords = mediaControlsButtonCoordinates(video, "timeline");
+ eventSender.mouseMoveTo(coords[0], coords[1]);
+
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+
+ video.addEventListener("mousemove", badEventHandler)
acolwell GONE FROM CHROMIUM 2014/07/29 16:23:26 ditto
aberent 2014/07/31 10:52:46 Done.
+
+ // Check that the timeline also captures mousemove
philipj_slow 2014/07/29 11:31:07 There's no mousemove event handler registered in t
aberent 2014/07/31 10:52:46 I may be missing something here. The line above re
philipj_slow 2014/07/31 11:16:06 Sorry, eye/brain malfunction.
+ eventSender.mouseMoveTo(coords[0]+10, coords[1]+10)
+
+ endTest();
+ }
+ });
+ video.src = findMediaFile("video", "content/test");
+ </script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/media/video-controls-mouse-events-captured-expected.txt » ('j') | Source/core/events/EventPath.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698