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

Side by Side Diff: third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button-document-move.html

Issue 2701433003: Hide overlay play button if it can't be shown without clipping (Closed)
Patch Set: Fix compile warning for uninitialized variable 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>media controls overlay play button document move</title>
mlamouri (slow - plz ping) 2017/03/08 19:13:04 Could you get these tests in media/controls/ but n
steimel 2017/03/09 16:42:23 Done.
3 <script src="../../../../resources/testharness.js"></script>
4 <script src="../../../../resources/testharnessreport.js"></script>
5 <script src="../../../../media/media-file.js"></script>
6 <script src="../../../../media/media-controls.js"></script>
7 <script src="overlay-play-button.js"></script>
8 <body>
9 <script>
10 async_test(function(t) {
11 // Make sure the overlay play button is turned on, as it's typically off
12 // unless we're dealing with Android.
13 enableOverlayPlayButtonForTest(t);
14
15 var video = createAndMoveVideo();
16
17 video.onloadedmetadata = t.step_func(function() {
18 // Large-enough video should have an overlay play button.
19 assertOverlayPlayButtonVisible(video);
20
21 // If the width goes under the minimum, the button should be hidden.
22 video.width = NARROW_VIDEO_WIDTH;
23 testRunner.layoutAndPaintAsyncThen(t.step_func(function() {
24 assertOverlayPlayButtonNotVisible(video);
25
26 // Re-widening the video should display the button.
27 video.width = NORMAL_VIDEO_WIDTH;
28 testRunner.layoutAndPaintAsyncThen(t.step_func(function() {
29 assertOverlayPlayButtonVisible(video);
30
31 // If the height goes under the minimum, the button should be hidden.
32 video.height = NARROW_VIDEO_HEIGHT;
33 testRunner.layoutAndPaintAsyncThen(t.step_func(function() {
34 assertOverlayPlayButtonNotVisible(video);
35
36 // Re-heightening the video should display the button.
37 video.height = NORMAL_VIDEO_HEIGHT;
38 testRunner.layoutAndPaintAsyncThen(t.step_func_done(function() {
39 assertOverlayPlayButtonVisible(video);
40 }));
41 }));
42 }));
43 }));
44 });
45
46 function createAndMoveVideo() {
47 var doc = document.implementation.createHTMLDocument();
48 var v = doc.createElement('video');
49 v.src = findMediaFile('video', '../../../../media/content/test');
50 v.width = NORMAL_VIDEO_WIDTH;
51 v.height = NORMAL_VIDEO_HEIGHT;
52 v.controls = true;
53 doc.body.appendChild(v);
54 doc.body.removeChild(v);
55 document.body.appendChild(v);
56 return v;
57 }
58 });
59 </script>
60 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698