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 4f7301d7c0a318e200229e40089690e771e11e3c..f983d4cf8dcd3b0f18f4767bddf0d466318c9f35 100644 |
--- a/LayoutTests/fast/dom/idl-union-type-unittest.html |
+++ b/LayoutTests/fast/dom/idl-union-type-unittest.html |
@@ -43,6 +43,18 @@ if (window.internals) { |
shouldThrow('unionTypesTest.doubleOrStringArg()'); |
debug(''); |
+ shouldBeEqualToString('unionTypesTest.doubleOrInternalEnumArg(3.14)', 'double is passed: 3.14'); |
+ // "foo" is a valid InternalEnum value. |
+ shouldBeEqualToString('unionTypesTest.doubleOrInternalEnumArg("foo")', 'InternalEnum is passed: foo'); |
+ shouldThrow('unionTypesTest.doubleOrInternalEnumArg("invalid")'); |
+ // Implicit string conversion will occur for non-double or non-string values |
+ // and they result in invalid InternalEnum values, so exceptions should be |
+ // thrown. |
+ shouldThrow('unionTypesTest.doubleOrInternalEnumArg(null)'); |
+ shouldThrow('unionTypesTest.doubleOrInternalEnumArg({})'); |
+ shouldThrow('unionTypesTest.doubleOrInternalEnumArg([])'); |
+ debug(''); |
+ |
shouldBeEqualToString('unionTypesTest.doubleOrStringArrayArg([])', ''); |
shouldBeEqualToString('unionTypesTest.doubleOrStringArrayArg([3.14, "foo"])', 'double: 3.14, string: foo'); |
shouldBeEqualToString('unionTypesTest.doubleOrStringArrayArg([1, "foo", "bar", 2])', 'double: 1, string: foo, string: bar, double: 2'); |