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

Unified Diff: third_party/WebKit/LayoutTests/media/video-controls-muted-video-can-unmute.html

Issue 2114393002: Convert video-controls-[mouse, muted, no]* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/video-controls-muted-video-can-unmute.html
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-muted-video-can-unmute.html b/third_party/WebKit/LayoutTests/media/video-controls-muted-video-can-unmute.html
index fdf9035a129dfb6599365659b64e11a0c9925462..c12fe6e3d16f1a36e094126313069934d4d3138d 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-muted-video-can-unmute.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-muted-video-can-unmute.html
@@ -1,19 +1,22 @@
+<!DOCTYPE html>
+<title>Test that muted video has an unmute button.</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></video>
-<p>Test that muted video has an unmute button.<p>
-<script src=media-file.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>
-<script src=media-controls.js></script>
<script>
- run("video.muted = true");
- video.src = findMediaFile("video", "content/test");
- run("video.load()");
- waitForEvent("canplaythrough", function () {
- testExpected("video.muted", true);
- muteButton = mediaControlsButton(video, "mute-button");
+async_test(function(t) {
+ var video = document.querySelector("video");
+ video.muted = true;
+
+ video.oncanplaythrough = t.step_func_done(function() {
+ assert_true(video.muted);
+ var muteButton = mediaControlsButton(video, "mute-button");
// Make sure that the mute button is visible.
- testExpected("getComputedStyle(muteButton).display", "none", '!=');
- endTest();
+ assert_not_equals(getComputedStyle(muteButton).display, "none");
});
-</script>
+
+ video.src = findMediaFile("video", "content/test");
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698