Chromium Code Reviews| OLD | NEW |
|---|---|
| (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> | |
| OLD | NEW |