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

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

Issue 590443002: IDL: object type support for IDL dictionary (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 3 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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/idl-dictionary-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-dictionary-unittest.html
diff --git a/LayoutTests/fast/dom/idl-dictionary-unittest.html b/LayoutTests/fast/dom/idl-dictionary-unittest.html
index 567e6ab7483e832df33ef0f03e7648e280245ecc..2de66ef7c1a83fa04ad28437aba71dcdf141f48c 100644
--- a/LayoutTests/fast/dom/idl-dictionary-unittest.html
+++ b/LayoutTests/fast/dom/idl-dictionary-unittest.html
@@ -3,6 +3,9 @@
<script>
description('IDL dictionary unittest');
+var testObject1 = { foo: 'x' };
+var testObject2 = { bar: 'y' };
+
if (window.internals && internals.dictionaryTest) {
var dictionaryTest = window.internals.dictionaryTest();
@@ -24,6 +27,8 @@ if (window.internals && internals.dictionaryTest) {
shouldBeUndefined('dict.enumMember');
shouldBeEqualToString('dict.enumMemberWithDefault', 'foo');
shouldBeUndefined('dict.enumOrNullMember');
+ shouldBeUndefined('dict.objectMember');
+ shouldBeNull('dict.objectOrNullMemberWithDefault');
debug('');
debug('Test for setting undefined');
@@ -41,6 +46,8 @@ if (window.internals && internals.dictionaryTest) {
shouldBeUndefined('dict.stringSequenceOrNullMember');
shouldBeUndefined('dict.elementMember');
shouldBeUndefined('dict.elementOrNullMember');
+ shouldBeUndefined('dict.objectMember');
+ shouldBeNull('dict.objectOrNullMemberWithDefault');
debug('');
var element1 = document.createElement('div');
@@ -62,6 +69,8 @@ if (window.internals && internals.dictionaryTest) {
enumMember: 'foo',
enumMemberWithDefault: 'bar',
enumOrNullMember: 'baz',
+ objectMember: testObject1,
+ objectOrNullMemberWithDefault: testObject2,
});
dict = dictionaryTest.get();
shouldBe('dict.longMember', '1');
@@ -80,6 +89,8 @@ if (window.internals && internals.dictionaryTest) {
shouldBeEqualToString('dict.enumMember', 'foo');
shouldBeEqualToString('dict.enumMemberWithDefault', 'bar');
shouldBeEqualToString('dict.enumOrNullMember', 'baz');
+ shouldBe('dict.objectMember', 'testObject1');
+ shouldBe('dict.objectOrNullMemberWithDefault', 'testObject2');
debug('');
debug('Test for explicit undefined or null, and missing members');
@@ -107,6 +118,11 @@ if (window.internals && internals.dictionaryTest) {
shouldThrow("dictionaryTest.set({enumMember: 'invalid'})");
debug('');
+ debug('Test for setting invalid object value');
+ shouldThrow("dictionaryTest.set({objectMember: 42})");
+ shouldThrow("dictionaryTest.set({objectMember: 'invalid'})");
+ debug('');
+
debug('Test for passing invalid dictionary values');
shouldThrow("dictionaryTest.set(42)");
shouldThrow("dictionaryTest.set('string')");
« no previous file with comments | « no previous file | LayoutTests/fast/dom/idl-dictionary-unittest-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698