| 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')");
|
|
|