Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/typedcssom/computedstyle/left.html |
| diff --git a/third_party/WebKit/LayoutTests/typedcssom/computedstyle/left.html b/third_party/WebKit/LayoutTests/typedcssom/computedstyle/left.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c23c3764145be41fb3f9e04be21aa379d10952ae |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/typedcssom/computedstyle/left.html |
| @@ -0,0 +1,40 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<script src='../../resources/testharness.js'></script> |
| +<script src='../../resources/testharnessreport.js'></script> |
| +</head> |
| +<body> |
| +<div id='testElement'></div> |
| + |
| +<script> |
| + |
| +testElement.style.left = '10px'; |
| +var computedStyleMap; |
| + |
| +var t1 = async_test("Getting a 10px left results in a CSSSimpleLength"); |
| +var t2 = async_test("getAll for left returns a single value"); |
|
sashab
2017/01/09 02:19:04
Even though its a bit longer, I think its clearer
|
| + |
| +document.onreadystatechange = function() { |
| + if(document.readyState == 'complete') { |
|
sashab
2017/01/09 02:19:04
Space after if
|
| + computedStyleMap = getComputedStyleMap(testElement); |
| + t1.step(function() { |
| + var result = computedStyleMap.get('left'); |
| + assert_true(result instanceof CSSSimpleLength); |
| + assert_equals(result.cssText, '10px'); |
| + }); |
| + t1.done(); |
| + |
| + t2.step(function() { |
| + testElement.style.left = '20px'; |
| + var result = computedStyleMap.getAll('left'); |
| + assert_equals(result.length, 1); |
| + assert_equals(result[0].cssText, '20px'); |
| + }); |
| + t2.done(); |
| + } |
| +}; |
| + |
| +</script> |
| +</body> |
| +</html> |