Index: third_party/WebKit/LayoutTests/typedcssom/cssSimpleLength.html |
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssSimpleLength.html b/third_party/WebKit/LayoutTests/typedcssom/cssSimpleLength.html |
index 7298c469847b3bec4737369f5c894ed42c2c9858..72fd90b1085902e4d92274c48bb44b8f388806c0 100644 |
--- a/third_party/WebKit/LayoutTests/typedcssom/cssSimpleLength.html |
+++ b/third_party/WebKit/LayoutTests/typedcssom/cssSimpleLength.html |
@@ -5,6 +5,26 @@ |
<script> |
test(function() { |
+ var simpleLength = new CSSSimpleLength(1, 'px'); |
+ assert_equals(simpleLength.value, 1); |
+ assert_equals(simpleLength.type, 'px'); |
+ |
+ simpleLength.value = 2; |
+ simpleLength.type = 'em'; |
+ |
+ assert_equals(simpleLength.value, 1); |
+ assert_equals(simpleLength.type, 'px'); |
+}, 'CSSSimpleLengths are immutable'); |
+ |
+test(function() { |
+ var units = ['px', 'percent', 'em', 'ex', 'ch', 'rem', 'vw', 'vh', 'vmin', 'vmax', 'cm', 'mm', 'in', 'pc', 'pt']; |
+ for (var i = 0; i < units.length; ++i) { |
+ var simpleLength = new CSSSimpleLength(i, units[i]); |
+ assert_equals(simpleLength.type, units[i]); |
+ } |
+}, 'Each unit type is returned according to the spec'); |
+ |
+test(function() { |
var simpleLength1 = new CSSSimpleLength(5.1, 'px'); |
var simpleLength2 = new CSSSimpleLength(10, 'px'); |