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

Unified Diff: LayoutTests/media/video-controls-fullscreen.js

Issue 196793021: Ignore MediaController in the video fullscreen button logic (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 9 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-fullscreen.js
diff --git a/LayoutTests/media/video-controls-fullscreen.js b/LayoutTests/media/video-controls-fullscreen.js
new file mode 100644
index 0000000000000000000000000000000000000000..6de12908d3e40f112f870adc326c0c2dbca261df
--- /dev/null
+++ b/LayoutTests/media/video-controls-fullscreen.js
@@ -0,0 +1,54 @@
+"use strict";
+
+function fullscreen_test(controller, fullScreenEnabled)
+{
+ if (window.internals)
+ window.internals.settings.setFullScreenEnabled(fullScreenEnabled);
+
+ async_test(function(t)
+ {
+ var v1 = document.createElement("video");
+ var v2 = document.createElement("video");
+ v1.controls = v2.controls = true;
+ v1.controller = v2.controller = controller;
+ v1.src = findMediaFile("video", "content/test");
+ v2.src = findMediaFile("audio", "content/test");
+ document.body.appendChild(v1);
+ document.body.appendChild(v2);
+
+ // load event fires when both video elements are ready
+ window.addEventListener("load", t.step_func(function()
+ {
+ function assert_button_hidden(elm)
+ {
+ assert_array_equals(mediaControlsButtonDimensions(elm, "fullscreen-button"), [0, 0]);
+ }
+
+ // no fullscreen button for a video element with no video track
+ assert_button_hidden(v2);
+
+ if (fullScreenEnabled) {
+ // click the fullscreen button
+ var coords = mediaControlsButtonCoordinates(v1, "fullscreen-button");
+ eventSender.mouseMoveTo(coords[0], coords[1]);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ // wait for the fullscreenchange event
+ } else {
+ // no fullscreen button when fullscreen is disabled
+ assert_button_hidden(v1);
+ t.done();
+ }
+ }));
+
+ v1.addEventListener("webkitfullscreenchange", t.step_func(function()
+ {
+ t.done();
+ }));
+
+ v2.addEventListener("webkitfullscreenchange", t.step_func(function()
+ {
+ assert_unreached();
+ }));
+ });
+}
« no previous file with comments | « LayoutTests/media/video-controls-fullscreen.html ('k') | LayoutTests/media/video-controls-fullscreen-disabled.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698