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

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

Issue 704503002: IDL: Union type support for attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@union-arraybuffer
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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/idl-union-type-unittest-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..399a37d72f74eb5e6c190ed010aa588cd511e42b 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');
+ shouldBe('unionTypesTest.doubleOrStringAttribute', '0');
+ unionTypesTest.doubleOrStringAttribute = 3.14;
+ shouldBe('unionTypesTest.doubleOrStringAttribute', '3.14');
+ unionTypesTest.doubleOrStringAttribute = "foo";
+ shouldBeEqualToString('unionTypesTest.doubleOrStringAttribute', 'foo');
+ unionTypesTest.doubleOrStringAttribute = undefined;
+ shouldBeEqualToString('unionTypesTest.doubleOrStringAttribute', 'undefined');
+ unionTypesTest.doubleOrStringAttribute = null;
+ shouldBeEqualToString('unionTypesTest.doubleOrStringAttribute', 'null');
+ 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]');
« no previous file with comments | « no previous file | LayoutTests/fast/dom/idl-union-type-unittest-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698