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

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: 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
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..56ba559cbd48bae4cad27b8d6b82c76a16fd1285 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_not_equals(video.controls, null);
fs 2016/07/01 09:21:22 'controls' is a boolean attribute, so assert_true
Srirama 2016/07/01 09:34:04 Done.
+
+ video.oncanplaythrough = t.step_func_done(function() {
+ assert_not_equals(video.controls, null);
+ video.removeAttribute("controls");
+ assert_false(video.controls);
+ video.controls = true;
+ assert_equals(video.getAttribute("controls"), "");
+ video.controls = false;
+ assert_false(video.controls, false);
fs 2016/07/01 09:21:22 Nit: Drop second arg (false is a poor description
Srirama 2016/07/01 09:34:04 Done.
+ video.setAttribute("controls", "controls");
+ assert_not_equals(video.controls, null);
+ });
+
video.src = findMediaFile("video", "content/test");
-</script>
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698