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

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

Issue 724733002: Support for [Clamp] and [EnforceRange] to IDL dictionary. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
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 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
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>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/idl-dictionary-unittest-expected.txt » ('j') | Source/bindings/templates/dictionary_v8.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698