Index: third_party/WebKit/LayoutTests/media/video-controls.html |
diff --git a/third_party/WebKit/LayoutTests/media/video-controls.html b/third_party/WebKit/LayoutTests/media/video-controls.html |
index e048c8e9b21c888b9461e962aa3d48f30ba6e8ab..c2c26a739aea081ca1a86ed00538a9ac7527137b 100644 |
--- a/third_party/WebKit/LayoutTests/media/video-controls.html |
+++ b/third_party/WebKit/LayoutTests/media/video-controls.html |
@@ -1,22 +1,26 @@ |
+<!DOCTYPE html> |
+<title>Test "controls" attribute.</title> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<script src="media-file.js"></script> |
<video controls></video> |
-<p>Test 'controls' attribute<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> |
- testExpected("video.controls", null, '!='); |
- waitForEvent('canplaythrough', function () { |
- testExpected("video.controls", null, '!='); |
- run("video.removeAttribute('controls')"); |
- testExpected("video.controls", false, '=='); |
- run("video.controls = true"); |
- testExpected("video.getAttribute('controls')", ""); |
- run("video.controls = false"); |
- testExpected("video.controls", false, '=='); |
- run("video.setAttribute('controls','controls')"); |
- testExpected("video.controls", null, '!='); |
- endTest(); |
- } ); |
+async_test(function(t) { |
+ var video = document.querySelector("video"); |
+ assert_true(video.controls); |
+ |
+ video.oncanplaythrough = t.step_func_done(function() { |
+ assert_true(video.controls); |
+ video.removeAttribute("controls"); |
+ assert_false(video.controls); |
+ video.controls = true; |
+ assert_equals(video.getAttribute("controls"), ""); |
+ video.controls = false; |
+ assert_false(video.controls); |
+ video.setAttribute("controls", "controls"); |
+ assert_true(video.controls); |
+ }); |
+ |
video.src = findMediaFile("video", "content/test"); |
-</script> |
+}); |
+</script> |