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

Side by Side 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 unified diff | Download patch
OLDNEW
1 <html> 1 <!DOCTYPE html>
2 <head> 2 <title>Test that video(media) documents scale to fit undersized containers.</tit le>
3 <script src="media-file.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 4 <script src="../resources/testharnessreport.js"></script>
5 (Please avoid writing new tests using video-test.js) --> 5 <script src="media-file.js"></script>
6 <script src="video-test.js"></script> 6 <iframe style="width: 200px; height: 200px;"></iframe>
7 <script> 7 <script>
8 function canPlayThrough(event) { 8 async_test(function(t) {
9 var video = event.target; 9 var iframe = document.querySelector("iframe");
10 testExpected(video.offsetWidth, 200);
11 testExpected(video.offsetHeight, 164);
12 endTest();
13 }
14 10
15 function iframeLoad() { 11 iframe.onload = t.step_func(function() {
16 var iframe = document.querySelector("iframe"); 12 var video = iframe.contentDocument.querySelector("video");
17 var video = iframe.contentDocument.querySelector("video"); 13 video.oncanplaythrough = t.step_func_done(function() {
18 video.addEventListener("canplaythrough", canPlayThrough); 14 assert_equals(video.offsetWidth, 200);
19 video.load() 15 assert_equals(video.offsetHeight, 164);
20 } 16 });
21 17
22 function load() { 18 video.load();
23 var iframe = document.querySelector("iframe"); 19 });
24 iframe.onload = iframeLoad;
25 iframe.src = findMediaFile("video", "content/counting");
26 }
27 </script>
28 </head>
29 20
30 <body onload="load()"> 21 iframe.src = findMediaFile("video", "content/counting");
31 <p>Test that video media documents scale to fit undersized containers.</ p> 22 });
32 <iframe style="width: 200px; height: 200px;"></iframe> 23 </script>
33 </body>
34 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698