| <script src=video-test.js></script> |
| <video poster="content/abe.png"> |
| <source src="content/bogus" type="bogus"> |
| function listenForWidthAndHeight(expectedWidth, expectedHeight, callback) { |
| if (video.clientWidth == expectedWidth && video.clientHeight == expectedHeight) { |
| // This uses a 20ms sleep loop to accomplish the wait, since the |
| // standard specifies no events that fire on poster load or error. |
| window.setTimeout(listenForWidthAndHeight, 20, expectedWidth, expectedHeight, callback); |
| testExpected("video.clientWidth", 76); |
| testExpected("video.clientHeight", 103); |
| waitForEvent("loadstart", function () { |
| listenForWidthAndHeight(76, 103, expected); |