Index: third_party/WebKit/LayoutTests/typedcssom/computedstyle/computedStylePropertyMap.html |
diff --git a/third_party/WebKit/LayoutTests/typedcssom/computedstyle/computedStylePropertyMap.html b/third_party/WebKit/LayoutTests/typedcssom/computedstyle/computedStylePropertyMap.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..abe65910c71541c733e46688e06f7acfd6037f88 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/typedcssom/computedstyle/computedStylePropertyMap.html |
@@ -0,0 +1,37 @@ |
+<!DOCTYPE html> |
+<script src='../../resources/testharness.js'></script> |
+<script src='../../resources/testharnessreport.js'></script> |
+ |
+<div id="testElement"></div> |
+ |
+<script> |
+ |
+var computedStyleMap = getComputedStyleMap(testElement); |
+var computedStyle = getComputedStyle(testElement); |
+ |
+test(function() { |
+ var properties = computedStyleMap.getProperties(); |
+ |
+ assert_equals(properties.length, computedStyle.length); |
+}, "Computed StyleMap.getProperties returns the same number of properties as ComputedStyle"); |
+ |
+test(function() { |
+ var properties = computedStyleMap.getProperties(); |
+ for (var i = 0; i < properties.length; i++) { |
+ var property = properties[i]; |
+ var styleValues = computedStyleMap.getAll(property); |
+ if (styleValues.length == 1) { |
+ // TODO(meade): Remove this if statement once all properties are supported. |
+ // TODO(meade): Handle sequence types. |
+ assert_equals(computedStyleMap.get(property).cssString, computedStyle[property]); |
+ } |
+ } |
+}, 'Properties retrieved from ComputedStyleMap reflect the same values as from ComputedStyle'); |
+ |
+test(function() { |
+ assert_throws(new TypeError(), function() { |
+ getComputedStyleMap(null); |
+ }); |
+}, 'Test that passing null to getComputedStyleMap does not crash'); |
+ |
+</script> |