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

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

Issue 692993003: Named getter of HTMLAllCollection etc should be nullable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@union-nullable
Patch Set: 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 7264fc990663ec309ba38cd3eccf4add2084e07b..42996f813970941250fae09296f84175f6740aa5 100644
--- a/LayoutTests/fast/dom/idl-union-type-unittest.html
+++ b/LayoutTests/fast/dom/idl-union-type-unittest.html
@@ -3,6 +3,9 @@
<script>
description('IDL union types unittests');
+var element = document.createElement('div');
+var nodeList = document.querySelectorAll('script');
+
if (window.internals) {
// The conversion rule prefers string over double, hence a value which
// is neither double nor string will be converted using ToString().
@@ -68,6 +71,21 @@ if (window.internals) {
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');
+ debug('');
+
+ debug('Tests for nullable method arguments');
+ shouldBeEqualToString('unionTypesTest.nodeListOrElementOrNullArg(undefined)', 'null or undefined is passed');
+ shouldBeEqualToString('unionTypesTest.nodeListOrElementOrNullArg(null)', 'null or undefined is passed');
+ shouldBeEqualToString('unionTypesTest.nodeListOrElementOrNullArg(nodeList)', 'nodelist is passed');
+ shouldBeEqualToString('unionTypesTest.nodeListOrElementOrNullArg(element)', 'element is passed');
+ shouldThrow('unionTypesTest.nodeListOrElementOrNullArg(3.14)');
+ shouldThrow('unionTypesTest.nodeListOrElementOrNullArg("foo")');
+ shouldThrow('unionTypesTest.nodeListOrElementOrNullArg({})');
+ shouldThrow('unionTypesTest.nodeListOrElementOrNullArg([])');
+ shouldThrow('unionTypesTest.nodeListOrElementArg(undefined)');
+ shouldThrow('unionTypesTest.nodeListOrElementArg(null)');
+ shouldBeEqualToString('unionTypesTest.nodeListOrElementArg(nodeList)', 'nodelist is passed');
+ shouldBeEqualToString('unionTypesTest.nodeListOrElementArg(element)', 'element is passed');
}
</script>

Powered by Google App Engine
This is Rietveld 408576698