Index: LayoutTests/fast/dom/idl-union-type-unittest.html |
diff --git a/LayoutTests/fast/dom/idl-union-type-unittest.html b/LayoutTests/fast/dom/idl-union-type-unittest.html |
index 0b8927fc7b93df57968d27f1c6e08417fb89d3e7..399a37d72f74eb5e6c190ed010aa588cd511e42b 100644 |
--- a/LayoutTests/fast/dom/idl-union-type-unittest.html |
+++ b/LayoutTests/fast/dom/idl-union-type-unittest.html |
@@ -4,12 +4,30 @@ |
description('IDL union types unittests'); |
if (window.internals) { |
+ // The conversion rule prefers string over double, hence a value which |
+ // is neither double nor string will be converted using ToString(). |
+ |
var unionTypesTest = internals.unionTypesTest(); |
+ |
+ debug('Tests for attributes'); |
+ shouldBe('unionTypesTest.doubleOrStringAttribute', '0'); |
+ unionTypesTest.doubleOrStringAttribute = 3.14; |
+ shouldBe('unionTypesTest.doubleOrStringAttribute', '3.14'); |
+ unionTypesTest.doubleOrStringAttribute = "foo"; |
+ shouldBeEqualToString('unionTypesTest.doubleOrStringAttribute', 'foo'); |
+ unionTypesTest.doubleOrStringAttribute = undefined; |
+ shouldBeEqualToString('unionTypesTest.doubleOrStringAttribute', 'undefined'); |
+ unionTypesTest.doubleOrStringAttribute = null; |
+ shouldBeEqualToString('unionTypesTest.doubleOrStringAttribute', 'null'); |
+ unionTypesTest.doubleOrStringAttribute = {}; |
+ shouldBeEqualToString('unionTypesTest.doubleOrStringAttribute', '[object Object]'); |
+ unionTypesTest.doubleOrStringAttribute = []; |
+ shouldBeEqualToString('unionTypesTest.doubleOrStringAttribute', ''); |
+ debug(''); |
+ |
debug('Tests for method arguments'); |
shouldBeEqualToString('unionTypesTest.doubleOrStringArg(3.14)', 'double is passed: 3.14'); |
shouldBeEqualToString('unionTypesTest.doubleOrStringArg("foo")', 'string is passed: foo'); |
- // The conversion rule prefers string over double, hence a value which |
- // is neither double nor string will be converted using ToString(). |
shouldBeEqualToString('unionTypesTest.doubleOrStringArg(undefined)', 'string is passed: undefined'); |
shouldBeEqualToString('unionTypesTest.doubleOrStringArg(null)', 'string is passed: null'); |
shouldBeEqualToString('unionTypesTest.doubleOrStringArg({})', 'string is passed: [object Object]'); |