Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: LayoutTests/fast/dom/idl-union-type-unittest.html

Issue 854113002: IDL: Enumeration support in union types (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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');
« no previous file with comments | « no previous file | LayoutTests/fast/dom/idl-union-type-unittest-expected.txt » ('j') | Source/bindings/scripts/v8_union.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698