| OLD | NEW |
| 1 <video width=100 height=50 controls></video> | 1 <!DOCTYPE html> |
| 2 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 2 <title>Test video dimensions.</title> |
| 3 (Please avoid writing new tests using video-test.js) --> | 3 <script src="../resources/testharness.js"></script> |
| 4 <script src=video-test.js></script> | 4 <script src="../resources/testharnessreport.js"></script> |
| 5 <video width="100" height="50"></video> |
| 5 <script> | 6 <script> |
| 6 testExpected("video.width", 100); | 7 test(function() { |
| 7 testExpected("video.height", 50); | 8 var video = document.querySelector("video"); |
| 8 testExpected("video.offsetWidth", 100); | 9 assert_equals(video.width, 100); |
| 9 testExpected("video.offsetHeight", 50); | 10 assert_equals(video.height, 50); |
| 10 video.setAttribute('width', '200'); | 11 assert_equals(video.offsetWidth, 100); |
| 11 video.setAttribute('height', '100'); | 12 assert_equals(video.offsetHeight, 50); |
| 12 testExpected("video.width", 200); | 13 |
| 13 testExpected("video.height", 100); | 14 video.setAttribute("width", "200"); |
| 14 testExpected("video.offsetWidth", 200); | 15 video.setAttribute("height", "100"); |
| 15 testExpected("video.offsetHeight", 100); | 16 assert_equals(video.width, 200); |
| 17 assert_equals(video.height, 100); |
| 18 assert_equals(video.offsetWidth, 200); |
| 19 assert_equals(video.offsetHeight, 100); |
| 20 |
| 16 video.width = 400; | 21 video.width = 400; |
| 17 video.height = 200; | 22 video.height = 200; |
| 18 testExpected("video.getAttribute('width')", 400); | 23 assert_equals(video.getAttribute("width"), "400"); |
| 19 testExpected("video.getAttribute('height')", 200); | 24 assert_equals(video.getAttribute("height"), "200"); |
| 20 testExpected("video.offsetWidth", 400); | 25 assert_equals(video.offsetWidth, 400); |
| 21 testExpected("video.offsetHeight", 200); | 26 assert_equals(video.offsetHeight, 200); |
| 22 endTest(); | 27 }); |
| 23 </script> | 28 </script> |
| OLD | NEW |