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

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

Issue 2115833002: Convert video-controls* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nits Created 4 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-controls-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-controls-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698