Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/svg/as-object/sizing/svg-in-object.js |
| diff --git a/third_party/WebKit/LayoutTests/svg/as-object/sizing/svg-in-object.js b/third_party/WebKit/LayoutTests/svg/as-object/sizing/svg-in-object.js |
| index b704e5e27afcd619d455a2dfb7ec0be9d42fa86f..5cdd6f0ed949645166cbc8271ee01a4f67a316a0 100644 |
| --- a/third_party/WebKit/LayoutTests/svg/as-object/sizing/svg-in-object.js |
| +++ b/third_party/WebKit/LayoutTests/svg/as-object/sizing/svg-in-object.js |
| @@ -386,13 +386,11 @@ if (window.location.search) { |
| debugHint = function(id) { return ""; }; |
| } |
| -function testSVGInObjectWithPlaceholderHeightAttr(placeholderHeightAttr) { |
| - // Separated over placeholderHeightAttr so that the test count is around ~200 |
| - |
| +function testSVGInObjectWithPlaceholder(placeholderWidthAttr, placeholderHeightAttr) { |
| doCombinationTest( |
| [["containerWidthStyle", [null, "400px"]], |
| ["containerHeightStyle", [null, "400px"]], |
| - ["placeholderWidthAttr", [null, "100", "50%"]], |
| + ["placeholderWidthAttr", [placeholderWidthAttr]], |
| ["placeholderHeightAttr", [placeholderHeightAttr]], |
| ["svgViewBoxAttr", [ null, "0 0 100 200" ]], |
| ["svgWidthAttr", [ null, "200", "25%" ]], |
| @@ -413,12 +411,14 @@ function testSVGInObjectWithPlaceholderHeightAttr(placeholderHeightAttr) { |
| placeholder.getBoundingClientRect(); |
| try { |
| - assert_equals(placeholderRect.width, |
| - expectedRect.width, |
| - debugHint(id) + "Wrong width"); |
| - assert_equals(placeholderRect.height, |
| - expectedRect.height, |
| - debugHint(id) + "Wrong height"); |
| + assert_approx_equals(placeholderRect.width, |
| + expectedRect.width, |
| + 1, |
|
fs
2015/10/29 09:52:46
One full (CSS) pixel seems a bit high as an error
davve
2015/10/29 10:16:10
Yes, I had roughly the same thought but it felt sl
fs
2015/10/29 10:19:41
0.5 would be "within one pixel" (rather than "with
davve
2015/10/29 10:30:33
Done.
|
| + debugHint(id) + "Wrong width"); |
| + assert_approx_equals(placeholderRect.height, |
| + expectedRect.height, |
| + 1, |
| + debugHint(id) + "Wrong height"); |
| } finally { |
| testContainer.removeChild(container); |
| if (testSingleId) |