| Index: third_party/WebKit/LayoutTests/media/controls-cast-do-not-fade-out.html
|
| diff --git a/third_party/WebKit/LayoutTests/media/controls-cast-do-not-fade-out.html b/third_party/WebKit/LayoutTests/media/controls-cast-do-not-fade-out.html
|
| index d63926ee8df28745715fce38f73e625c5d5ddd1d..137523e073e1ab798d6f003a9f2d283f48701bca 100644
|
| --- a/third_party/WebKit/LayoutTests/media/controls-cast-do-not-fade-out.html
|
| +++ b/third_party/WebKit/LayoutTests/media/controls-cast-do-not-fade-out.html
|
| @@ -1,52 +1,32 @@
|
| <!doctype html>
|
| -<html>
|
| - <head>
|
| - <title>This tests that controls do not fade out when the video is playing remotely.</title>
|
| - <script src="../resources/testharness.js"></script>
|
| - <script src="../resources/testharnessreport.js"></script>
|
| - <script src="media-file.js"></script>
|
| - <script src="media-controls.js"></script>
|
| - <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
|
| - (Please avoid writing new tests using video-test.js) -->
|
| - <script src="video-test.js"></script>
|
| - </head>
|
| - <body>
|
| - <video controls loop></video>
|
| - <script>
|
| - var controls;
|
| - var test;
|
| +<title>This tests that controls do not fade out when the video is playing remotely.</title>
|
| +<script src="../resources/testharness.js"></script>
|
| +<script src="../resources/testharnessreport.js"></script>
|
| +<script src="media-file.js"></script>
|
| +<script src="media-controls.js"></script>
|
| +<video controls loop></video>
|
| +<script>
|
| +async_test(function(t)
|
| +{
|
| + var video = document.querySelector("video");
|
| + video.src = findMediaFile("video", "content/test");
|
|
|
| - function playing()
|
| + video.onplaying = t.step_func(function() {
|
| + internals.mediaPlayerPlayingRemotelyChanged(video, true);
|
| + runAfterHideMediaControlsTimerFired(function()
|
| {
|
| - internals.mediaPlayerPlayingRemotelyChanged(video, true);
|
| + var controls = mediaControlsButton(video, "panel");
|
| + assert_equals(getComputedStyle(controls).opacity, "1");
|
| +
|
| + internals.mediaPlayerPlayingRemotelyChanged(video, false);
|
| runAfterHideMediaControlsTimerFired(function()
|
| {
|
| - controls = mediaControlsButton(video, "panel");
|
| - testExpected("getComputedStyle(controls).opacity", 1);
|
| -
|
| - consoleWrite("");
|
| -
|
| - internals.mediaPlayerPlayingRemotelyChanged(video, false);
|
| - runAfterHideMediaControlsTimerFired(function()
|
| - {
|
| - testExpected("getComputedStyle(controls).opacity", 0);
|
| -
|
| - consoleWrite("");
|
| -
|
| - test.done();
|
| - },
|
| - video);
|
| + assert_equals(getComputedStyle(controls).opacity, "0");
|
| + t.done();
|
| }, video);
|
| - }
|
| + }, video);
|
| + });
|
|
|
| - async_test(function(t)
|
| - {
|
| - test = t;
|
| - findMediaElement();
|
| - video.src = findMediaFile("video", "content/test");
|
| - video.addEventListener("playing", playing);
|
| - video.play();
|
| - });
|
| - </script>
|
| - </body>
|
| -</html>
|
| + video.play();
|
| +});
|
| +</script>
|
|
|