OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../js/resources/js-test-pre.js"></script> | 4 <script src="../../js/resources/js-test-pre.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <script> | 7 <script> |
8 | 8 |
9 description("This tests the constructor for the KeyboardEvent DOM class."); | 9 description("This tests the constructor for the KeyboardEvent DOM class."); |
10 | 10 |
11 var testObject = {nyannyan: 123}; | 11 var testObject = {nyannyan: 123}; |
12 | 12 |
13 // No initializer is passed. | 13 // No initializer is passed. |
14 shouldBe("new KeyboardEvent('eventType').bubbles", "false"); | 14 shouldBe("new KeyboardEvent('eventType').bubbles", "false"); |
15 shouldBe("new KeyboardEvent('eventType').cancelable", "false"); | 15 shouldBe("new KeyboardEvent('eventType').cancelable", "false"); |
16 shouldBe("new KeyboardEvent('eventType').view", "null"); | 16 shouldBe("new KeyboardEvent('eventType').view", "null"); |
17 shouldBe("new KeyboardEvent('eventType').detail", "0"); | 17 shouldBe("new KeyboardEvent('eventType').detail", "0"); |
18 shouldBeEqualToString("new KeyboardEvent('eventType').keyIdentifier", ""); | 18 shouldBeEqualToString("new KeyboardEvent('eventType').keyIdentifier", ""); |
19 shouldBe("new KeyboardEvent('eventType').location", "0"); | 19 shouldBe("new KeyboardEvent('eventType').location", "0"); |
20 shouldBe("new KeyboardEvent('eventType').ctrlKey", "false"); | 20 shouldBe("new KeyboardEvent('eventType').ctrlKey", "false"); |
21 shouldBe("new KeyboardEvent('eventType').altKey", "false"); | 21 shouldBe("new KeyboardEvent('eventType').altKey", "false"); |
22 shouldBe("new KeyboardEvent('eventType').shiftKey", "false"); | 22 shouldBe("new KeyboardEvent('eventType').shiftKey", "false"); |
23 shouldBe("new KeyboardEvent('eventType').metaKey", "false"); | 23 shouldBe("new KeyboardEvent('eventType').metaKey", "false"); |
| 24 shouldBe("new KeyboardEvent('eventType').repeat", "false"); |
24 | 25 |
25 // bubbles is passed. | 26 // bubbles is passed. |
26 shouldBe("new KeyboardEvent('eventType', { bubbles: false }).bubbles", "false"); | 27 shouldBe("new KeyboardEvent('eventType', { bubbles: false }).bubbles", "false"); |
27 shouldBe("new KeyboardEvent('eventType', { bubbles: true }).bubbles", "true"); | 28 shouldBe("new KeyboardEvent('eventType', { bubbles: true }).bubbles", "true"); |
28 | 29 |
29 // cancelable is passed. | 30 // cancelable is passed. |
30 shouldBe("new KeyboardEvent('eventType', { cancelable: false }).cancelable", "fa
lse"); | 31 shouldBe("new KeyboardEvent('eventType', { cancelable: false }).cancelable", "fa
lse"); |
31 shouldBe("new KeyboardEvent('eventType', { cancelable: true }).cancelable", "tru
e"); | 32 shouldBe("new KeyboardEvent('eventType', { cancelable: true }).cancelable", "tru
e"); |
32 | 33 |
33 // view is passed. | 34 // view is passed. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 shouldBe("new KeyboardEvent('eventType', { location: '12345' }).location", "1234
5"); | 101 shouldBe("new KeyboardEvent('eventType', { location: '12345' }).location", "1234
5"); |
101 shouldBe("new KeyboardEvent('eventType', { location: '12345a' }).location", "Key
boardEvent.DOM_KEY_LOCATION_STANDARD"); | 102 shouldBe("new KeyboardEvent('eventType', { location: '12345a' }).location", "Key
boardEvent.DOM_KEY_LOCATION_STANDARD"); |
102 shouldBe("new KeyboardEvent('eventType', { location: 'abc' }).location", "Keyboa
rdEvent.DOM_KEY_LOCATION_STANDARD"); | 103 shouldBe("new KeyboardEvent('eventType', { location: 'abc' }).location", "Keyboa
rdEvent.DOM_KEY_LOCATION_STANDARD"); |
103 shouldBe("new KeyboardEvent('eventType', { location: [] }).location", "KeyboardE
vent.DOM_KEY_LOCATION_STANDARD"); | 104 shouldBe("new KeyboardEvent('eventType', { location: [] }).location", "KeyboardE
vent.DOM_KEY_LOCATION_STANDARD"); |
104 shouldBe("new KeyboardEvent('eventType', { location: [12345] }).location", "1234
5"); | 105 shouldBe("new KeyboardEvent('eventType', { location: [12345] }).location", "1234
5"); |
105 shouldBe("new KeyboardEvent('eventType', { location: [12345, 67890] }).location"
, "KeyboardEvent.DOM_KEY_LOCATION_STANDARD"); | 106 shouldBe("new KeyboardEvent('eventType', { location: [12345, 67890] }).location"
, "KeyboardEvent.DOM_KEY_LOCATION_STANDARD"); |
106 shouldBe("new KeyboardEvent('eventType', { location: {} }).location", "KeyboardE
vent.DOM_KEY_LOCATION_STANDARD"); | 107 shouldBe("new KeyboardEvent('eventType', { location: {} }).location", "KeyboardE
vent.DOM_KEY_LOCATION_STANDARD"); |
107 shouldBe("new KeyboardEvent('eventType', { location: {moemoe: 12345} }).location
", "KeyboardEvent.DOM_KEY_LOCATION_STANDARD"); | 108 shouldBe("new KeyboardEvent('eventType', { location: {moemoe: 12345} }).location
", "KeyboardEvent.DOM_KEY_LOCATION_STANDARD"); |
108 shouldBe("new KeyboardEvent('eventType', { location: {valueOf: function () { ret
urn 12345; }} }).location", "12345"); | 109 shouldBe("new KeyboardEvent('eventType', { location: {valueOf: function () { ret
urn 12345; }} }).location", "12345"); |
109 | 110 |
110 // ctrlKey, altKey, shiftKey and metaKey are passed. | 111 // ctrlKey, altKey, shiftKey, metaKey and repeat are passed. |
111 ["ctrlKey", "altKey", "shiftKey", "metaKey"].forEach(function (attr) { | 112 ["ctrlKey", "altKey", "shiftKey", "metaKey", "repeat"].forEach(function (attr) { |
112 shouldBe("new KeyboardEvent('eventType', { " + attr + ": false })." + attr,
"false"); | 113 shouldBe("new KeyboardEvent('eventType', { " + attr + ": false })." + attr,
"false"); |
113 shouldBe("new KeyboardEvent('eventType', { " + attr + ": true })." + attr, "
true"); | 114 shouldBe("new KeyboardEvent('eventType', { " + attr + ": true })." + attr, "
true"); |
114 }); | 115 }); |
115 | 116 |
116 // All initializers are passed. | 117 // All initializers are passed. |
117 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true }).bubbles", "true"); | 118 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true, repeat: true }).bubbles", "true"); |
118 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true }).cancelable", "true"); | 119 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true, repeat: true }).cancelable", "true
"); |
119 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true }).view", "window"); | 120 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true, repeat: true }).view", "window"); |
120 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true }).detail", "111"); | 121 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true, repeat: true }).detail", "111"); |
121 shouldBeEqualToString("new KeyboardEvent('eventType', { bubbles: true, cancelabl
e: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, c
trlKey: true, altKey: true, shiftKey: true, metaKey: true }).keyIdentifier", "ch
ocolate"); | 122 shouldBeEqualToString("new KeyboardEvent('eventType', { bubbles: true, cancelabl
e: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, c
trlKey: true, altKey: true, shiftKey: true, metaKey: true, repeat: true }).keyId
entifier", "chocolate"); |
122 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true }).location", "222"); | 123 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true, repeat: true }).location", "222"); |
123 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true }).ctrlKey", "true"); | 124 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true, repeat: true }).ctrlKey", "true"); |
124 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true }).altKey", "true"); | 125 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true, repeat: true }).altKey", "true"); |
125 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true }).shiftKey", "true"); | 126 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true, repeat: true }).shiftKey", "true")
; |
126 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true }).metaKey", "true"); | 127 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true, repeat: true }).metaKey", "true"); |
| 128 shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view
: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true,
altKey: true, shiftKey: true, metaKey: true, repeat: true }).repeat", "true"); |
127 </script> | 129 </script> |
128 <script src="../../js/resources/js-test-post.js"></script> | 130 <script src="../../js/resources/js-test-post.js"></script> |
129 </body> | 131 </body> |
130 </html> | 132 </html> |
OLD | NEW |