| 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 var testObject1 = { foo: 'x' }; | 6 var testObject1 = { foo: 'x' }; |
| 7 var testObject2 = { bar: 'y' }; | 7 var testObject2 = { bar: 'y' }; |
| 8 | 8 |
| 9 if (window.internals && internals.dictionaryTest) { | 9 if (window.internals && internals.dictionaryTest) { |
| 10 var dictionaryTest = window.internals.dictionaryTest(); | 10 var dictionaryTest = window.internals.dictionaryTest(); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 120 |
| 121 debug('Test for setting invalid object value'); | 121 debug('Test for setting invalid object value'); |
| 122 shouldThrow("dictionaryTest.set({objectMember: 42})"); | 122 shouldThrow("dictionaryTest.set({objectMember: 42})"); |
| 123 shouldThrow("dictionaryTest.set({objectMember: 'invalid'})"); | 123 shouldThrow("dictionaryTest.set({objectMember: 'invalid'})"); |
| 124 debug(''); | 124 debug(''); |
| 125 | 125 |
| 126 debug('Test for passing invalid dictionary values'); | 126 debug('Test for passing invalid dictionary values'); |
| 127 shouldThrow("dictionaryTest.set(42)"); | 127 shouldThrow("dictionaryTest.set(42)"); |
| 128 shouldThrow("dictionaryTest.set('string')"); | 128 shouldThrow("dictionaryTest.set('string')"); |
| 129 debug(''); | 129 debug(''); |
| 130 |
| 131 debug('Test for [Clamp] member'); |
| 132 dictionaryTest.set({ |
| 133 longMember: 2147483648, |
| 134 longMemberWithClamp: 2147483648 |
| 135 }); |
| 136 dict = dictionaryTest.get(); |
| 137 shouldBe('dict.longMember', '-2147483648'); |
| 138 shouldBe('dict.longMemberWithClamp', '2147483647'); |
| 139 debug(''); |
| 130 } | 140 } |
| 131 </script> | 141 </script> |
| OLD | NEW |