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

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

Issue 568703002: IDL: Values for dictionaries should be a object, null or undefined (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/idl-dictionary-unittest-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script> 2 <script src="../../resources/js-test.js"></script>
3 <script> 3 <script>
4 description('IDL dictionary unittest'); 4 description('IDL dictionary unittest');
5 5
6 if (window.internals && internals.dictionaryTest) { 6 if (window.internals && internals.dictionaryTest) {
7 var dictionaryTest = window.internals.dictionaryTest(); 7 var dictionaryTest = window.internals.dictionaryTest();
8 8
9 debug('Test for setting an empty dictionary'); 9 debug('Test for setting an empty dictionary');
10 dictionaryTest.set({}); 10 dictionaryTest.set({});
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 debug('Test for setting invalid member'); 100 debug('Test for setting invalid member');
101 dictionaryTest.set({invalidMember: 'shouldNotBeSet'}); 101 dictionaryTest.set({invalidMember: 'shouldNotBeSet'});
102 dict = dictionaryTest.get(); 102 dict = dictionaryTest.get();
103 shouldBeUndefined('dict.invalidMember'); 103 shouldBeUndefined('dict.invalidMember');
104 debug(''); 104 debug('');
105 105
106 debug('Test for setting invalid enum value'); 106 debug('Test for setting invalid enum value');
107 shouldThrow("dictionaryTest.set({enumMember: 'invalid'})"); 107 shouldThrow("dictionaryTest.set({enumMember: 'invalid'})");
108 debug(''); 108 debug('');
109
110 debug('Test for passing invalid dictionary values');
111 shouldThrow("dictionaryTest.set(42)");
112 shouldThrow("dictionaryTest.set('string')");
113 debug('');
109 } 114 }
110 </script> 115 </script>
OLDNEW
« 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