| OLD | NEW | 
|   1 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |   1 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 
|   2      (Please avoid writing new tests using video-test.js) --> |   2      (Please avoid writing new tests using video-test.js) --> | 
|   3 <script src=video-test.js></script> |   3 <script src=video-test.js></script> | 
|   4 <video poster="content/abe.png"> |   4 <video poster="content/abe.png"> | 
|   5     <source src="content/bogus" type="bogus"> |   5     <source src="content/bogus" type="bogus"> | 
|   6 </video> |   6 </video> | 
|   7 <script> |   7 <script> | 
|   8     findMediaElement(); |   8     findMediaElement(); | 
|   9  |   9  | 
|  10     function listenForWidthAndHeight(expectedWidth, expectedHeight, callback) { |  10     function listenForWidthAndHeight(expectedWidth, expectedHeight, callback) { | 
|  11         if (video.clientWidth == expectedWidth && video.clientHeight == expected
    Height) { |  11         if (video.clientWidth == expectedWidth && video.clientHeight == expected
    Height) { | 
|  12             callback(); |  12             callback(); | 
|  13         } else { |  13         } else { | 
|  14             // This uses a 20ms sleep loop to accomplish the wait, since the |  14             // This uses a 20ms sleep loop to accomplish the wait, since the | 
|  15             // standard specifies no events that fire on poster load or error. |  15             // standard specifies no events that fire on poster load or error. | 
|  16             window.setTimeout(listenForWidthAndHeight, 20, expectedWidth, expect
    edHeight, callback); |  16             window.setTimeout(listenForWidthAndHeight, 20, expectedWidth, expect
    edHeight, callback); | 
|  17         } |  17         } | 
|  18     } |  18     } | 
|  19  |  19  | 
|  20     function expected() { |  20     function expected() { | 
|  21         testExpected("video.clientWidth", 76); |  21         testExpected("video.clientWidth", 76); | 
|  22         testExpected("video.clientHeight", 103); |  22         testExpected("video.clientHeight", 103); | 
|  23         endTest(); |  23         endTest(); | 
|  24     } |  24     } | 
|  25  |  25  | 
|  26     run("video.load()"); |  26     run("video.load()"); | 
|  27     waitForEvent("loadstart", function () { |  27     waitForEvent("loadstart", function () { | 
|  28         listenForWidthAndHeight(76, 103, expected); |  28         listenForWidthAndHeight(76, 103, expected); | 
|  29     }); |  29     }); | 
|  30 </script> |  30 </script> | 
| OLD | NEW |