Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button-document-move.html |
| diff --git a/third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button-document-move.html b/third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button-document-move.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f01ee998f143ba095c89345ecbc00650771a6cd0 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button-document-move.html |
| @@ -0,0 +1,60 @@ |
| +<!DOCTYPE html> |
| +<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.
|
| +<script src="../../../../resources/testharness.js"></script> |
| +<script src="../../../../resources/testharnessreport.js"></script> |
| +<script src="../../../../media/media-file.js"></script> |
| +<script src="../../../../media/media-controls.js"></script> |
| +<script src="overlay-play-button.js"></script> |
| +<body> |
| +<script> |
| +async_test(function(t) { |
| + // Make sure the overlay play button is turned on, as it's typically off |
| + // unless we're dealing with Android. |
| + enableOverlayPlayButtonForTest(t); |
| + |
| + var video = createAndMoveVideo(); |
| + |
| + video.onloadedmetadata = t.step_func(function() { |
| + // Large-enough video should have an overlay play button. |
| + assertOverlayPlayButtonVisible(video); |
| + |
| + // If the width goes under the minimum, the button should be hidden. |
| + video.width = NARROW_VIDEO_WIDTH; |
| + testRunner.layoutAndPaintAsyncThen(t.step_func(function() { |
| + assertOverlayPlayButtonNotVisible(video); |
| + |
| + // Re-widening the video should display the button. |
| + video.width = NORMAL_VIDEO_WIDTH; |
| + testRunner.layoutAndPaintAsyncThen(t.step_func(function() { |
| + assertOverlayPlayButtonVisible(video); |
| + |
| + // If the height goes under the minimum, the button should be hidden. |
| + video.height = NARROW_VIDEO_HEIGHT; |
| + testRunner.layoutAndPaintAsyncThen(t.step_func(function() { |
| + assertOverlayPlayButtonNotVisible(video); |
| + |
| + // Re-heightening the video should display the button. |
| + video.height = NORMAL_VIDEO_HEIGHT; |
| + testRunner.layoutAndPaintAsyncThen(t.step_func_done(function() { |
| + assertOverlayPlayButtonVisible(video); |
| + })); |
| + })); |
| + })); |
| + })); |
| + }); |
| + |
| + function createAndMoveVideo() { |
| + var doc = document.implementation.createHTMLDocument(); |
| + var v = doc.createElement('video'); |
| + v.src = findMediaFile('video', '../../../../media/content/test'); |
| + v.width = NORMAL_VIDEO_WIDTH; |
| + v.height = NORMAL_VIDEO_HEIGHT; |
| + v.controls = true; |
| + doc.body.appendChild(v); |
| + doc.body.removeChild(v); |
| + document.body.appendChild(v); |
| + return v; |
| + } |
| +}); |
| +</script> |
| +</body> |