Index: third_party/WebKit/LayoutTests/typedcssom/cssURLImageValue.html |
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssURLImageValue.html b/third_party/WebKit/LayoutTests/typedcssom/cssURLImageValue.html |
index c5737bcbbe649cc9901d3929555094e55b2f03a9..a1bbe2d9312333754d0d2eaefb4a371ad143d93f 100644 |
--- a/third_party/WebKit/LayoutTests/typedcssom/cssURLImageValue.html |
+++ b/third_party/WebKit/LayoutTests/typedcssom/cssURLImageValue.html |
@@ -5,6 +5,7 @@ |
<div id="test-image1"></div> |
<div id="test-image2"></div> |
<div id="test-image3"></div> |
+<div id="test-image4"></div> |
<script> |
@@ -21,6 +22,15 @@ function base64Image() { |
return "data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA="; |
} |
+function assertCorrectURLImageValue(image, expectedUrl, expectedWidth, expectedHeight, expectedRatio) { |
+ assert_true(image instanceof CSSURLImageValue); |
+ assert_equals(image.url, expectedUrl); |
+ assert_equals(image.state, "loaded"); |
+ assert_equals(image.intrinsicWidth, expectedWidth); |
+ assert_equals(image.intrinsicHeight, expectedHeight); |
+ assert_equals(image.intrinsicRatio, expectedRatio); |
+} |
+ |
test(function() { |
var bg = new CSSURLImageValue(urlImage); |
assert_equals(bg.state, "unloaded"); |
@@ -109,4 +119,16 @@ test(function() { |
}; |
} |
+test(function() { |
+ var url4 = base64Image(); |
+ var div4 = document.getElementById("test-image4"); |
+ |
+ for (var i = 0; i < imageProperties.length; ++i) |
+ div4.style[imageProperties[i]] = 'url(' + url4 + ')'; |
meade_UTC10
2016/08/12 05:23:16
For JS style we use curly braces ({}) everywhere,
|
+ |
+ for (var i = 0; i < imageProperties.length; ++i) { |
+ assertCorrectURLImageValue(getComputedStyleMap(div4).get(imageProperties[i]), url4, 1, 1, 1); |
+ assertCorrectURLImageValue(div4.styleMap.get(imageProperties[i]), url4, 1, 1, 1); |
+ } |
+}, "Getting CSSURLImageValue from StyleMap"); |
</script> |