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

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

Issue 2094993002: Convert video-volume*, video-width* and viewport* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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-width-height.html
diff --git a/third_party/WebKit/LayoutTests/media/video-width-height.html b/third_party/WebKit/LayoutTests/media/video-width-height.html
index 56d63350e02e4d562fe072988cd56126de5335a2..c7200f9c37a041b22b327f2df3bc92abd9767560 100644
--- a/third_party/WebKit/LayoutTests/media/video-width-height.html
+++ b/third_party/WebKit/LayoutTests/media/video-width-height.html
@@ -1,23 +1,28 @@
-<video width=100 height=50 controls></video>
-<!-- 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>
+<!DOCTYPE html>
+<title>Test video dimensions.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<video width="100" height="50"></video>
<script>
- testExpected("video.width", 100);
- testExpected("video.height", 50);
- testExpected("video.offsetWidth", 100);
- testExpected("video.offsetHeight", 50);
- video.setAttribute('width', '200');
- video.setAttribute('height', '100');
- testExpected("video.width", 200);
- testExpected("video.height", 100);
- testExpected("video.offsetWidth", 200);
- testExpected("video.offsetHeight", 100);
+test(function() {
+ var video = document.querySelector("video");
+ assert_equals(video.width, 100);
+ assert_equals(video.height, 50);
+ assert_equals(video.offsetWidth, 100);
+ assert_equals(video.offsetHeight, 50);
+
+ video.setAttribute("width", "200");
+ video.setAttribute("height", "100");
+ assert_equals(video.width, 200);
+ assert_equals(video.height, 100);
+ assert_equals(video.offsetWidth, 200);
+ assert_equals(video.offsetHeight, 100);
+
video.width = 400;
video.height = 200;
- testExpected("video.getAttribute('width')", 400);
- testExpected("video.getAttribute('height')", 200);
- testExpected("video.offsetWidth", 400);
- testExpected("video.offsetHeight", 200);
- endTest();
-</script>
+ assert_equals(video.getAttribute("width"), "400");
+ assert_equals(video.getAttribute("height"), "200");
+ assert_equals(video.offsetWidth, 400);
+ assert_equals(video.offsetHeight, 200);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698