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

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: address nit 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 var image = document.createElement("img");
12 callback(); 12 image.src = "content/abe.png";
13 } else { 13 // With this we can be reasonably sure that the poster is loaded.
14 // This uses a 20ms sleep loop to accomplish the wait, since the 14 image.onload = t.step_func_done(function() {
15 // standard specifies no events that fire on poster load or error. 15 assert_equals(video.clientWidth, 76);
16 window.setTimeout(listenForWidthAndHeight, 20, expectedWidth, expect edHeight, callback); 16 assert_equals(video.clientHeight, 103);
17 } 17 });
18 } 18 });
19 19
20 function expected() { 20 video.src = "content/bogus";
21 testExpected("video.clientWidth", 76); 21 });
22 testExpected("video.clientHeight", 103); 22 </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