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

Unified Diff: third_party/WebKit/LayoutTests/media/video-scales-in-media-document.html

Issue 2123573002: Convert video-[enter, mouse, scales]* 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-scales-in-media-document.html
diff --git a/third_party/WebKit/LayoutTests/media/video-scales-in-media-document.html b/third_party/WebKit/LayoutTests/media/video-scales-in-media-document.html
index e3854c69f863f5164affa925b927710413684cd1..5f0c12e43c09af8251a70fc21c9489f2a953411c 100644
--- a/third_party/WebKit/LayoutTests/media/video-scales-in-media-document.html
+++ b/third_party/WebKit/LayoutTests/media/video-scales-in-media-document.html
@@ -1,34 +1,23 @@
-<html>
- <head>
- <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>
- function canPlayThrough(event) {
- var video = event.target;
- testExpected(video.offsetWidth, 200);
- testExpected(video.offsetHeight, 164);
- endTest();
- }
+<!DOCTYPE html>
+<title>Test that video(media) documents scale to fit undersized containers.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<iframe style="width: 200px; height: 200px;"></iframe>
+<script>
+async_test(function(t) {
+ var iframe = document.querySelector("iframe");
- function iframeLoad() {
- var iframe = document.querySelector("iframe");
- var video = iframe.contentDocument.querySelector("video");
- video.addEventListener("canplaythrough", canPlayThrough);
- video.load()
- }
+ iframe.onload = t.step_func(function() {
+ var video = iframe.contentDocument.querySelector("video");
+ video.oncanplaythrough = t.step_func_done(function() {
+ assert_equals(video.offsetWidth, 200);
+ assert_equals(video.offsetHeight, 164);
+ });
- function load() {
- var iframe = document.querySelector("iframe");
- iframe.onload = iframeLoad;
- iframe.src = findMediaFile("video", "content/counting");
- }
- </script>
- </head>
+ video.load();
+ });
- <body onload="load()">
- <p>Test that video media documents scale to fit undersized containers.</p>
- <iframe style="width: 200px; height: 200px;"></iframe>
- </body>
-</html>
+ iframe.src = findMediaFile("video", "content/counting");
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698