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

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
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..b25257981ba2df7f3eb6fafdfe8a299dcaa001f2 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');
+ shouldBeNull('unionTypesTest.doubleOrStringAttribute');
bashi 2014/11/05 00:17:32 I noticed this is wrong. This attribute is non-nul
+ unionTypesTest.doubleOrStringAttribute = 3.14;
+ shouldBe('unionTypesTest.doubleOrStringAttribute', '3.14');
+ unionTypesTest.doubleOrStringAttribute = "foo";
+ shouldBeEqualToString('unionTypesTest.doubleOrStringAttribute', 'foo');
+ unionTypesTest.doubleOrStringAttribute = undefined;
+ shouldBeEqualToString('unionTypesTest.doubleOrStringAttribute', 'undefined');
haraken 2014/11/04 23:50:09 Nit: shouldBeUndefined
bashi 2014/11/05 00:17:32 The expected result is "undefined" (of type string
+ unionTypesTest.doubleOrStringAttribute = null;
+ shouldBeEqualToString('unionTypesTest.doubleOrStringAttribute', 'null');
haraken 2014/11/04 23:50:09 Nit: shouldBeNull
bashi 2014/11/05 00:17:33 Same as above.
+ 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') | Source/bindings/scripts/v8_attributes.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698