| OLD | NEW |
| 1 var All_Pointer_Events = [ | 1 var All_Pointer_Events = [ |
| 2 "pointerdown", | 2 "pointerdown", |
| 3 "pointerup", | 3 "pointerup", |
| 4 "pointercancel", | 4 "pointercancel", |
| 5 "pointermove", | 5 "pointermove", |
| 6 "pointerover", | 6 "pointerover", |
| 7 "pointerout", | 7 "pointerout", |
| 8 "pointerenter", | 8 "pointerenter", |
| 9 "pointerleave", | 9 "pointerleave", |
| 10 "gotpointercapture", | 10 "gotpointercapture", |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 const NOHOVER_POINTERS = ['touch']; | 206 const NOHOVER_POINTERS = ['touch']; |
| 207 | 207 |
| 208 function MultiPointerTypeTest(testName, types) { | 208 function MultiPointerTypeTest(testName, types) { |
| 209 this.testName = testName; | 209 this.testName = testName; |
| 210 this.types = types; | 210 this.types = types; |
| 211 this.currentTypeIndex = 0; | 211 this.currentTypeIndex = 0; |
| 212 this.currentTest = null; | 212 this.currentTest = null; |
| 213 this.createNextTest(); | 213 this.createNextTest(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 MultiPointerTypeTest.prototype.step = function(op) { |
| 217 this.currentTest.step(op); |
| 218 } |
| 219 |
| 216 MultiPointerTypeTest.prototype.skip = function() { | 220 MultiPointerTypeTest.prototype.skip = function() { |
| 217 var prevTest = this.currentTest; | 221 var prevTest = this.currentTest; |
| 218 this.createNextTest(); | 222 this.createNextTest(); |
| 219 prevTest.timeout(); | 223 prevTest.timeout(); |
| 220 } | 224 } |
| 221 | 225 |
| 222 MultiPointerTypeTest.prototype.done = function() { | 226 MultiPointerTypeTest.prototype.done = function() { |
| 223 var prevTest = this.currentTest; | 227 if (this.currentTest.status != 1) { |
| 224 this.createNextTest(); | 228 var prevTest = this.currentTest; |
| 225 if (prevTest != null) | 229 this.createNextTest(); |
| 226 prevTest.done(); | 230 if (prevTest != null) |
| 231 prevTest.done(); |
| 232 } |
| 227 } | 233 } |
| 228 | 234 |
| 229 MultiPointerTypeTest.prototype.step = function(stepFunction) { | 235 MultiPointerTypeTest.prototype.step = function(stepFunction) { |
| 230 this.currentTest.step(stepFunction); | 236 this.currentTest.step(stepFunction); |
| 231 } | 237 } |
| 232 | 238 |
| 233 MultiPointerTypeTest.prototype.createNextTest = function() { | 239 MultiPointerTypeTest.prototype.createNextTest = function() { |
| 234 if (this.currentTypeIndex < this.types.length) { | 240 if (this.currentTypeIndex < this.types.length) { |
| 235 var pointerTypeDescription = document.getElementById('pointerTypeDescrip
tion'); | 241 var pointerTypeDescription = document.getElementById('pointerTypeDescrip
tion'); |
| 236 document.getElementById('pointerTypeDescription').innerHTML = "Follow th
e test instructions with <span style='color: red'>" + this.types[this.currentTyp
eIndex] + "</span>. If you don't have the device <a href='javascript:;' onclick=
'globalPointerEventTest.skip()'>skip it</a>."; | 242 document.getElementById('pointerTypeDescription').innerHTML = "Follow th
e test instructions with <span style='color: red'>" + this.types[this.currentTyp
eIndex] + "</span>. If you don't have the device <a href='javascript:;' onclick=
'globalPointerEventTest.skip()'>skip it</a>."; |
| 237 this.currentTest = async_test(this.types[this.currentTypeIndex] + ' ' +
this.testName); | 243 this.currentTest = async_test(this.types[this.currentTypeIndex] + ' ' +
this.testName); |
| 238 expectedPointerType = this.types[this.currentTypeIndex]; | 244 expectedPointerType = this.types[this.currentTypeIndex]; |
| 239 this.currentTypeIndex++; | 245 this.currentTypeIndex++; |
| 240 } else { | 246 } else { |
| 241 document.getElementById('pointerTypeDescription').innerHTML = ""; | 247 document.getElementById('pointerTypeDescription').innerHTML = ""; |
| 242 } | 248 } |
| 243 resetTestState(); | 249 resetTestState(); |
| 244 } | 250 } |
| 245 | 251 |
| 246 | |
| 247 function setup_pointerevent_test(testName, supportedPointerTypes) { | 252 function setup_pointerevent_test(testName, supportedPointerTypes) { |
| 248 return globalPointerEventTest = new MultiPointerTypeTest(testName, supported
PointerTypes); | 253 return globalPointerEventTest = new MultiPointerTypeTest(testName, supported
PointerTypes); |
| 249 } | 254 } |
| 250 | 255 |
| 251 function checkPointerEventType(event) { | 256 function checkPointerEventType(event) { |
| 252 assert_equals(event.pointerType, expectedPointerType, "pointerType should be
the same as the requested device."); | 257 assert_equals(event.pointerType, expectedPointerType, "pointerType should be
the same as the requested device."); |
| 253 } | 258 } |
| OLD | NEW |