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

Side by Side Diff: third_party/WebKit/LayoutTests/media/video-controls-overlay-play-button.html

Issue 2728133002: Media Controls: make the MediaControlsOverlayPlayButton a runtime enabled flag. (Closed)
Patch Set: should create a cast target Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Test that the overlay play button respects the controls attribute.</title >
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script src="media-file.js"></script>
6 <script src="media-controls.js"></script>
7 <body>
8 <script>
9 async_test(function(t) {
10 internals.settings.setMediaControlsOverlayPlayButtonEnabled(true);
11
12 // Add video dynamically, since otherwise the controls are created, but
13 // hidden, before the setting is set, causing the setting to be ignored.
14 var video = document.createElement("video");
15 document.body.appendChild(video);
16
17 video.controls = true;
18 var button = mediaControlsButton(video, "overlay-play-button")
19 assert_equals(getComputedStyle(button).display, "flex");
20
21 var watcher = new EventWatcher(t, video, ["loadeddata", "play", "pause"]);
22 watcher.wait_for("loadeddata").then(t.step_func(function() {
23 video.play();
24 return watcher.wait_for("play");
25 })).then(t.step_func(function() {
26 assert_equals(getComputedStyle(button).display, "none");
27 video.pause();
28 return watcher.wait_for("pause");
29 })).then(t.step_func(function() {
30 assert_equals(getComputedStyle(button).display, "flex");
31 video.controls = false;
32 assert_equals(getComputedStyle(button).display, "none");
33 video.play();
34 return watcher.wait_for("play");
35 })).then(t.step_func(function() {
36 assert_equals(getComputedStyle(button).display, "none");
37 video.pause();
38 return watcher.wait_for("pause");
39 })).then(t.step_func_done(function() {
40 assert_equals(getComputedStyle(button).display, "none");
41 video.controls = true;
42 assert_equals(getComputedStyle(button).display, "flex");
43 }));
44
45 video.src = findMediaFile("video", "content/test");
46 });
47 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698