| OLD | NEW |
| 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 Loading... |
| 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> |
| OLD | NEW |