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

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

Issue 713683003: IDL: Support optional union type arguments with default values (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add unit tests Created 6 years, 1 month 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 399a37d72f74eb5e6c190ed010aa588cd511e42b..b55991ced2ed3b7f694a0d73abfd6a10105737e0 100644
--- a/LayoutTests/fast/dom/idl-union-type-unittest.html
+++ b/LayoutTests/fast/dom/idl-union-type-unittest.html
@@ -36,5 +36,20 @@ if (window.internals) {
// Just check that doubleOrStringArg() doesn't throw an exception.
shouldBeEqualToString('typeof unionTypesTest.doubleOrStringArg(new Date)', 'string');
shouldThrow('unionTypesTest.doubleOrStringArg()');
+ debug('');
+
+ debug('Tests for method arguments with defaults');
+ shouldBeEqualToString('unionTypesTest.doubleOrStringDefaultDoubleArg()', 'double is passed: 3.14');
+ shouldBeEqualToString('unionTypesTest.doubleOrStringDefaultDoubleArg(undefined)', 'double is passed: 3.14');
+ shouldBeEqualToString('unionTypesTest.doubleOrStringDefaultDoubleArg("foo")', 'string is passed: foo');
+ shouldBeEqualToString('unionTypesTest.doubleOrStringDefaultStringArg()', 'string is passed: foo');
+ shouldBeEqualToString('unionTypesTest.doubleOrStringDefaultStringArg(undefined)', 'string is passed: foo');
+ shouldBeEqualToString('unionTypesTest.doubleOrStringDefaultStringArg(3.14)', 'double is passed: 3.14');
+ shouldBeEqualToString('unionTypesTest.doubleOrStringDefaultNullArg()', 'null is passed');
+ shouldBeEqualToString('unionTypesTest.doubleOrStringDefaultNullArg(undefined)', 'null is passed');
+ shouldBeEqualToString('unionTypesTest.doubleOrStringDefaultNullArg(null)', 'null is passed');
+ shouldBeEqualToString('unionTypesTest.doubleOrStringDefaultNullArg(3.14)', 'double is passed: 3.14');
+ shouldBeEqualToString('unionTypesTest.doubleOrStringDefaultNullArg("foo")', 'string is passed: foo');
+
}
</script>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/idl-union-type-unittest-expected.txt » ('j') | Source/core/testing/UnionTypesTest.idl » ('J')

Powered by Google App Engine
This is Rietveld 408576698