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

Unified Diff: third_party/WebKit/LayoutTests/media/controls-cast-do-not-fade-out.html

Issue 2016323003: Convert controls-cast-* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nit Created 4 years, 7 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
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..6d608be104e63dfdd61e93bf728ce06f18ac64ca 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,29 @@
-<!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;
+<!DOCTYPE html>
+<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()
- {
- internals.mediaPlayerPlayingRemotelyChanged(video, true);
- runAfterHideMediaControlsTimerFired(function()
- {
- controls = mediaControlsButton(video, "panel");
- testExpected("getComputedStyle(controls).opacity", 1);
+ video.onplaying = t.step_func(function() {
+ internals.mediaPlayerPlayingRemotelyChanged(video, true);
+ runAfterHideMediaControlsTimerFired(function() {
+ var controls = mediaControlsButton(video, "panel");
+ assert_equals(getComputedStyle(controls).opacity, "1");
- consoleWrite("");
-
- internals.mediaPlayerPlayingRemotelyChanged(video, false);
- runAfterHideMediaControlsTimerFired(function()
- {
- testExpected("getComputedStyle(controls).opacity", 0);
-
- consoleWrite("");
-
- test.done();
- },
- video);
+ internals.mediaPlayerPlayingRemotelyChanged(video, false);
+ runAfterHideMediaControlsTimerFired(function() {
+ 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>

Powered by Google App Engine
This is Rietveld 408576698