Chromium Code Reviews| 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..b25257981ba2df7f3eb6fafdfe8a299dcaa001f2 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'); |
| + shouldBeNull('unionTypesTest.doubleOrStringAttribute'); |
|
bashi
2014/11/05 00:17:32
I noticed this is wrong. This attribute is non-nul
|
| + unionTypesTest.doubleOrStringAttribute = 3.14; |
| + shouldBe('unionTypesTest.doubleOrStringAttribute', '3.14'); |
| + unionTypesTest.doubleOrStringAttribute = "foo"; |
| + shouldBeEqualToString('unionTypesTest.doubleOrStringAttribute', 'foo'); |
| + unionTypesTest.doubleOrStringAttribute = undefined; |
| + shouldBeEqualToString('unionTypesTest.doubleOrStringAttribute', 'undefined'); |
|
haraken
2014/11/04 23:50:09
Nit: shouldBeUndefined
bashi
2014/11/05 00:17:32
The expected result is "undefined" (of type string
|
| + unionTypesTest.doubleOrStringAttribute = null; |
| + shouldBeEqualToString('unionTypesTest.doubleOrStringAttribute', 'null'); |
|
haraken
2014/11/04 23:50:09
Nit: shouldBeNull
bashi
2014/11/05 00:17:33
Same as above.
|
| + 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]'); |