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

Side by Side Diff: third_party/WebKit/LayoutTests/media/video-src-invalid-poster.html

Issue 2096223002: Convert video-src-invalid* and video-src-none* 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-src-invalid-poster-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 1 <!DOCTYPE html>
2 (Please avoid writing new tests using video-test.js) --> 2 <title>Test that media dimensions are equal to poster dimensions when "src" is i nvalid.</title>
3 <script src=video-test.js></script> 3 <script src="../resources/testharness.js"></script>
4 <video poster="content/abe.png"> 4 <script src="../resources/testharnessreport.js"></script>
5 <source src="content/bogus" type="bogus"> 5 <video poster="content/abe.png"></video>
6 </video>
7 <script> 6 <script>
8 findMediaElement(); 7 async_test(function(t) {
8 var video = document.querySelector("video");
9 9
10 function listenForWidthAndHeight(expectedWidth, expectedHeight, callback) { 10 video.onloadstart = t.step_func(function () {
11 if (video.clientWidth == expectedWidth && video.clientHeight == expected Height) { 11 setTimeout(t.step_func_done(function() {
fs 2016/06/25 16:38:39 Can we guarantee that the poster image has finishe
Srirama 2016/06/28 17:02:51 Done.
12 callback(); 12 assert_equals(video.clientWidth, 76);
13 } else { 13 assert_equals(video.clientHeight, 103);
14 // This uses a 20ms sleep loop to accomplish the wait, since the 14 }), 0);
15 // standard specifies no events that fire on poster load or error. 15 });
16 window.setTimeout(listenForWidthAndHeight, 20, expectedWidth, expect edHeight, callback);
17 }
18 }
19 16
20 function expected() { 17 video.src = "content/bogus";
21 testExpected("video.clientWidth", 76); 18 });
22 testExpected("video.clientHeight", 103); 19 </script>
23 endTest();
24 }
25
26 run("video.load()");
27 waitForEvent("loadstart", function () {
28 listenForWidthAndHeight(76, 103, expected);
29 });
30 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-src-invalid-poster-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698