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

Unified Diff: LayoutTests/media/video-controls-overlay-play-button.html

Issue 363563007: Only show overlay play button when controls are enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@shouldShowControls
Patch Set: Extended test coverage Created 6 years, 6 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
« no previous file with comments | « no previous file | LayoutTests/media/video-controls-overlay-play-button-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/media/video-controls-overlay-play-button.html
diff --git a/LayoutTests/media/video-controls-overlay-play-button.html b/LayoutTests/media/video-controls-overlay-play-button.html
new file mode 100644
index 0000000000000000000000000000000000000000..d8d4bc37af6c0dbd6e8163277bb204b1ea3b711a
--- /dev/null
+++ b/LayoutTests/media/video-controls-overlay-play-button.html
@@ -0,0 +1,72 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Test that the overlay play button respects the controls attribute</title>
+ <script src="media-controls.js"></script>
+ <script src="media-file.js"></script>
+ <script src="video-test.js"></script>
+ <script>
+ function start()
+ {
+ window.internals.settings.setMediaControlsOverlayPlayButtonEnabled(true);
+
+ findMediaElement();
+
+ video.controls = true;
+
+ button = mediaControlsButton(video, 'overlay-play-button')
+ testExpected('getComputedStyle(button).display', 'flex');
+
+ waitForEventOnce('loadeddata', loadeddata);
+ video.src = findMediaFile('video', 'content/test');
+ }
+
+ function loadeddata()
+ {
+ waitForEventOnce('play', play1);
+ run('video.play()');
+ }
+
+ function play1()
+ {
+ testExpected('getComputedStyle(button).display', 'none');
+
+ waitForEventOnce('pause', pause1);
+ run('video.pause()');
+ }
+
+ function pause1()
+ {
+ testExpected('getComputedStyle(button).display', 'flex');
+
+ video.controls = false;
+ testExpected('getComputedStyle(button).display', 'none');
+
+ waitForEventOnce('play', play2);
+ run('video.play()');
+ }
+
+ function play2()
+ {
+ testExpected('getComputedStyle(button).display', 'none');
+
+ waitForEventOnce('pause', pause2);
+ run('video.pause()');
+ }
+
+ function pause2()
+ {
+ testExpected('getComputedStyle(button).display', 'none');
+
+ video.controls = true;
+ testExpected('getComputedStyle(button).display', 'flex');
+
+ endTest();
+ }
+ </script>
+ </head>
+ <body onload="start()">
+ <p>Test that the overlay play button respects the controls attribute</p>
+ <video></video>
+ </body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/media/video-controls-overlay-play-button-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698