| Index: third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_getAll.html
|
| diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_getAll.html b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_getAll.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e1098ee2741f8c5afb4e931b12cf61a1b0404a70
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_getAll.html
|
| @@ -0,0 +1,41 @@
|
| +<!DOCTYPE html>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +
|
| +<div id="testElement"></div>
|
| +
|
| +<script>
|
| +
|
| +test(function() {
|
| + // TODO(meade): Make this a test case for a property with multiple values when that is supported.
|
| + testElement.styleMap.set('width', new SimpleLength(90, 'px'));
|
| + var result = testElement.styleMap.getAll('width');
|
| + assert_equals(result.length, 1);
|
| + assert_equals(result[0].cssString, '90px');
|
| +}, "getAll() returns a list of values");
|
| +
|
| +test(function() {
|
| + testElement.styleMap.set('width', new SimpleLength(100, 'px'));
|
| + var lowerResult = testElement.styleMap.getAll('width');
|
| + var upperResult = testElement.styleMap.getAll('WIDTH');
|
| + var mixedResult = testElement.styleMap.getAll('wIdTh');
|
| +
|
| + assert_equals(lowerResult.length, 1);
|
| + assert_equals(upperResult.length, 1);
|
| + assert_equals(mixedResult.length, 1);
|
| + assert_equals(lowerResult[0].cssString, '100px');
|
| + assert_equals(upperResult[0].cssString, '100px');
|
| + assert_equals(mixedResult[0].cssString, '100px');
|
| +}, "getAll is case-insensitive for the property name");
|
| +
|
| +test(function() {
|
| + assert_array_equals(testElement.styleMap.getAll('height'), []);
|
| +}, "getAll() returns an empty list if the property isn't set");
|
| +
|
| +test(function() {
|
| + assert_throws(new TypeError(), function() {
|
| + testElement.styleMap.getAll('lemons');
|
| + });
|
| +}, "getAll() throws if you try to get an invalid property");
|
| +
|
| +</script>
|
|
|