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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4
5 </head>
6 <body>
7 <video controls></video>
8 <p>This tests that a mouse click event on the controls will not be seen by t he video element.</p>
9 <script src=media-file.js></script>
10 <script src=video-test.js></script>
11 <script src=media-controls.js></script>
12 <script>
13 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.
14 {
15 failTest(event.type + " reached video element");
16 };
17 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.
18 video.addEventListener("dblclick", badEventHandler)
19 video.addEventListener("mousedown", badEventHandler)
20 video.addEventListener("mouseup", badEventHandler)
21
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
22 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().
23 {
24 if (window.eventSender) {
25 // click the play button
26 var coords = mediaControlsButtonCoordinates(video, "play-button" );
27 eventSender.mouseMoveTo(coords[0], coords[1]);
28
29 eventSender.mouseDown();
30 eventSender.mouseUp();
31
32 // Click the current time display, which should not respond to e vents, but
33 // should still capture them
34 coords = mediaControlsButtonCoordinates(video, "current-time-dis play");
35 eventSender.mouseMoveTo(coords[0], coords[1]);
36
37 eventSender.mouseDown();
38 eventSender.mouseUp();
39
40 // Click the timeline - this tests that multilevel shadow DOM el ements work
41 coords = mediaControlsButtonCoordinates(video, "timeline");
42 eventSender.mouseMoveTo(coords[0], coords[1]);
43
44 eventSender.mouseDown();
45 eventSender.mouseUp();
46
47 video.addEventListener("mousemove", badEventHandler)
acolwell GONE FROM CHROMIUM 2014/07/29 16:23:26 ditto
aberent 2014/07/31 10:52:46 Done.
48
49 // 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.
50 eventSender.mouseMoveTo(coords[0]+10, coords[1]+10)
51
52 endTest();
53 }
54 });
55 video.src = findMediaFile("video", "content/test");
56 </script>
57 </body>
58 </html>
OLDNEW
« 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