Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/images/zoomed-offset-size.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/images/zoomed-offset-size.html b/third_party/WebKit/LayoutTests/fast/images/zoomed-offset-size.html |
| index 12728c1093e4934d0690c1dddf7fa98ec9ca97cf..8032c8e383368f5339be2424003f094818275837 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/images/zoomed-offset-size.html |
| +++ b/third_party/WebKit/LayoutTests/fast/images/zoomed-offset-size.html |
| @@ -1,49 +1,23 @@ |
| <!DOCTYPE html> |
| -<html> |
| - <head> |
| - <style> |
| - #test_wrap { |
| - width: 250px; |
| - height: 166px; |
| - overflow: hidden; |
| - } |
| - |
| - #test_img { |
| - width: 100%; |
| - height: 100%; |
| - } |
| - </style> |
| - <script src="../../resources/js-test.js"></script> |
| - </head> |
| - <body> |
| - <div id="test_wrap"> |
| - <img id="test_img" src="resources/green-256x256.jpg"> |
| - </div> |
| - <p> |
| - Image should return a size of 250x166 regardless of zoom level. |
| - </p> |
| - <script> |
| - var imageElement = document.getElementById('test_img'); |
| - var wrapElement = document.getElementById('test_wrap'); |
| - |
| - function getSize(zoomLevel) |
| - { |
| - document.body.zoom = zoomLevel; |
| - return { |
| - imageWidth: imageElement.offsetWidth, |
| - imageHeight: imageElement.offsetHeight, |
| - wrapWidth: wrapElement.offsetWidth, |
| - wrapHeight: wrapElement.offsetHeight |
| - }; |
| - } |
| - |
| - for (var i = 90; i <= 200; i += 5) { |
| - shouldBe('getSize(' + (i / 100) + ').imageWidth', '250'); |
| - shouldBe('getSize(' + (i / 100) + ').imageHeight', '166'); |
| - shouldBe('getSize(' + (i / 100) + ').wrapWidth', '250'); |
| - shouldBe('getSize(' + (i / 100) + ').wrapHeight', '166'); |
| - } |
| - document.body.zoom = 1.0; |
| - </script> |
| - </body> |
| -</html> |
| +<title>Image should return a size of 250x166 regardless of zoom level.</title> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<div style="height:166px; width:250px; overflow:hidden;"> |
| +<img src="resources/green-256x256.jpg" style="width: 100%; height:100%"> |
| +<script> |
| +test(function() { |
| + document.body.zoom = 1.0; |
|
fs
2016/08/19 08:24:04
I think the intention of this was to reset the zoo
sivag
2016/08/19 09:21:21
Done.
|
| + var imageElement = document.querySelector('img'); |
| + var wrapElement = document.querySelector('div'); |
| + function testSize(zoomLevel) { |
| + document.body.zoom = zoomLevel; |
|
fs
2016/08/19 08:24:03
I'm not aware of any 'zoom' property on HTMLBodyEl
sivag
2016/08/19 09:21:21
Ok, i tried using document.body.style.zoom, instea
fs
2016/08/19 09:38:18
Ok, well it kind of figures I guess =). How many o
|
| + assert_equals(imageElement.offsetWidth, 250); |
| + assert_equals(imageElement.offsetHeight, 166); |
| + assert_equals(wrapElement.offsetWidth, 250); |
| + assert_equals(wrapElement.offsetHeight, 166); |
| + } |
| + for (var i = 90; i <= 200; i += 5) { |
| + testSize(i/100); |
| + } |
|
fs
2016/08/19 08:24:04
You can drop the {}
sivag
2016/08/19 09:21:21
Done.
|
| +}); |
| +</script> |