OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
5 <script src="../resources/input-modifiers.js"></script> | 5 <script src="../resources/input-modifiers.js"></script> |
6 </head> | 6 </head> |
7 <body> | 7 <body> |
8 <script> | 8 <script> |
9 | 9 |
10 description("This tests the constructor for the KeyboardEvent DOM class."); | 10 description("This tests the constructor for the KeyboardEvent DOM class."); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 shouldBeEqualToString("new KeyboardEvent('eventType', { key: {koakuma: 12345} })
.key", "[object Object]"); | 109 shouldBeEqualToString("new KeyboardEvent('eventType', { key: {koakuma: 12345} })
.key", "[object Object]"); |
110 shouldBeEqualToString("new KeyboardEvent('eventType', { key: {valueOf: function
() { return 'koakuma'; } } }).key", "[object Object]"); | 110 shouldBeEqualToString("new KeyboardEvent('eventType', { key: {valueOf: function
() { return 'koakuma'; } } }).key", "[object Object]"); |
111 | 111 |
112 // location is passed. | 112 // location is passed. |
113 // numbers within the unsigned long range. | 113 // numbers within the unsigned long range. |
114 shouldBe("new KeyboardEvent('eventType', { location: KeyboardEvent.DOM_KEY_LOCAT
ION_STANDARD }).location", "KeyboardEvent.DOM_KEY_LOCATION_STANDARD"); | 114 shouldBe("new KeyboardEvent('eventType', { location: KeyboardEvent.DOM_KEY_LOCAT
ION_STANDARD }).location", "KeyboardEvent.DOM_KEY_LOCATION_STANDARD"); |
115 shouldBe("new KeyboardEvent('eventType', { location: KeyboardEvent.DOM_KEY_LOCAT
ION_LEFT }).location", "KeyboardEvent.DOM_KEY_LOCATION_LEFT"); | 115 shouldBe("new KeyboardEvent('eventType', { location: KeyboardEvent.DOM_KEY_LOCAT
ION_LEFT }).location", "KeyboardEvent.DOM_KEY_LOCATION_LEFT"); |
116 shouldBe("new KeyboardEvent('eventType', { location: 4294967294 }).location", "4
294967294"); | 116 shouldBe("new KeyboardEvent('eventType', { location: 4294967294 }).location", "4
294967294"); |
117 shouldBe("new KeyboardEvent('eventType', { location: 4294967295 }).location", "4
294967295"); | 117 shouldBe("new KeyboardEvent('eventType', { location: 4294967295 }).location", "4
294967295"); |
118 | 118 |
119 // test for deprecated 'keyLocation'. | |
120 shouldBe("new KeyboardEvent('eventType', { keyLocation: 0 }).keyLocation", "0"); | |
121 shouldBe("new KeyboardEvent('eventType', { keyLocation: 1 }).keyLocation", "1"); | |
122 shouldBe("new KeyboardEvent('eventType', { keyLocation: 1 }).location", "1"); | |
123 shouldBe("new KeyboardEvent('eventType', { location: 1 }).keyLocation", "1"); | |
124 | |
125 // numbers out of the unsigned long range. | 119 // numbers out of the unsigned long range. |
126 // 2^{53}-1, the largest number that can be exactly represented by double. | 120 // 2^{53}-1, the largest number that can be exactly represented by double. |
127 shouldBe("new KeyboardEvent('eventType', { location: 9007199254740991 }).locatio
n", "4294967295"); | 121 shouldBe("new KeyboardEvent('eventType', { location: 9007199254740991 }).locatio
n", "4294967295"); |
128 // 2^{64}-1 | 122 // 2^{64}-1 |
129 shouldBe("new KeyboardEvent('eventType', { location: 18446744073709551615 }).loc
ation", "KeyboardEvent.DOM_KEY_LOCATION_STANDARD"); | 123 shouldBe("new KeyboardEvent('eventType', { location: 18446744073709551615 }).loc
ation", "KeyboardEvent.DOM_KEY_LOCATION_STANDARD"); |
130 shouldBe("new KeyboardEvent('eventType', { location: 12345678901234567890 }).loc
ation", "3944679424"); | 124 shouldBe("new KeyboardEvent('eventType', { location: 12345678901234567890 }).loc
ation", "3944679424"); |
131 shouldBe("new KeyboardEvent('eventType', { location: -1 }).location", "429496729
5"); | 125 shouldBe("new KeyboardEvent('eventType', { location: -1 }).location", "429496729
5"); |
132 shouldBe("new KeyboardEvent('eventType', { location: 123.45 }).location", "123")
; | 126 shouldBe("new KeyboardEvent('eventType', { location: 123.45 }).location", "123")
; |
133 shouldBe("new KeyboardEvent('eventType', { location: NaN }).location", "Keyboard
Event.DOM_KEY_LOCATION_STANDARD"); | 127 shouldBe("new KeyboardEvent('eventType', { location: NaN }).location", "Keyboard
Event.DOM_KEY_LOCATION_STANDARD"); |
134 | 128 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 shouldBeEqualToString("new KeyboardEvent('eventType', { bubbles: true, cancelabl
e: true, view: window, detail: 111, keyIdentifier: 'chocolate', code: 'chocode',
key: 'chokey', location: 222, ctrlKey: true, altKey: true, shiftKey: true, meta
Key: true, repeat: true }).key", "chokey"); | 162 shouldBeEqualToString("new KeyboardEvent('eventType', { bubbles: true, cancelabl
e: true, view: window, detail: 111, keyIdentifier: 'chocolate', code: 'chocode',
key: 'chokey', location: 222, ctrlKey: true, altKey: true, shiftKey: true, meta
Key: true, repeat: true }).key", "chokey"); |
169 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', code: 'chocode', key: 'chokey
', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true, re
peat: true }).location", "222"); | 163 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', code: 'chocode', key: 'chokey
', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true, re
peat: true }).location", "222"); |
170 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', code: 'chocode', key: 'chokey
', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true, re
peat: true }).ctrlKey", "true"); | 164 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', code: 'chocode', key: 'chokey
', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true, re
peat: true }).ctrlKey", "true"); |
171 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', code: 'chocode', key: 'chokey
', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true, re
peat: true }).altKey", "true"); | 165 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', code: 'chocode', key: 'chokey
', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true, re
peat: true }).altKey", "true"); |
172 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', code: 'chocode', key: 'chokey
', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true, re
peat: true }).shiftKey", "true"); | 166 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', code: 'chocode', key: 'chokey
', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true, re
peat: true }).shiftKey", "true"); |
173 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', code: 'chocode', key: 'chokey
', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true, re
peat: true }).metaKey", "true"); | 167 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', code: 'chocode', key: 'chokey
', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true, re
peat: true }).metaKey", "true"); |
174 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', code: 'chocode', key: 'chokey
', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true, re
peat: true }).repeat", "true"); | 168 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', code: 'chocode', key: 'chokey
', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true, re
peat: true }).repeat", "true"); |
175 </script> | 169 </script> |
176 </body> | 170 </body> |
177 </html> | 171 </html> |
OLD | NEW |