OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
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 <!-- | 5 <!-- |
6 Touch tests that involve the ontouchstart, ontouchmove, ontouchend or ontouchc
ancel callbacks | 6 Touch tests that involve the ontouchstart, ontouchmove, ontouchend or ontouchc
ancel callbacks |
7 should be written in an asynchronous fashion so they can be run on mobile plat
forms like Android. | 7 should be written in an asynchronous fashion so they can be run on mobile plat
forms like Android. |
8 You will need to invoke isSuccessfullyParsed() in your test script when the te
st completes. | 8 You will need to invoke isSuccessfullyParsed() in your test script when the te
st completes. |
9 --> | 9 --> |
10 </head> | 10 </head> |
(...skipping 18 matching lines...) Expand all Loading... |
29 shouldBe("touch.identifier", "1"); | 29 shouldBe("touch.identifier", "1"); |
30 shouldBe("touch.pageX", "100"); | 30 shouldBe("touch.pageX", "100"); |
31 shouldBe("touch.pageY", "101"); | 31 shouldBe("touch.pageY", "101"); |
32 shouldBe("touch.screenX", "102"); | 32 shouldBe("touch.screenX", "102"); |
33 shouldBe("touch.screenY", "103"); | 33 shouldBe("touch.screenY", "103"); |
34 shouldBe("touch.radiusX", "5"); | 34 shouldBe("touch.radiusX", "5"); |
35 shouldBe("touch.radiusY", "3"); | 35 shouldBe("touch.radiusY", "3"); |
36 shouldBe("touch.rotationAngle", "10"); | 36 shouldBe("touch.rotationAngle", "10"); |
37 shouldBe("touch.force", "10"); | 37 shouldBe("touch.force", "10"); |
38 | 38 |
39 var emptyTouch = document.createTouch(); | 39 shouldThrow("document.createTouch()", '"TypeError: Failed to execute \'createTou
ch\' on \'Document\': 7 arguments required, but only 0 present."'); |
40 shouldBeNonNull("emptyTouch"); | 40 |
41 shouldBeNull("emptyTouch.target"); | 41 var incompleteTouch = document.createTouch(window, target, 1, 100, 101, 102, 103
); |
42 shouldBe("emptyTouch.identifier", "0"); | 42 shouldBeNonNull("incompleteTouch"); |
43 shouldBe("emptyTouch.pageX", "0"); | 43 shouldBeNonNull("incompleteTouch.target"); |
44 shouldBe("emptyTouch.pageY", "0"); | 44 shouldBe("incompleteTouch.identifier", "1"); |
45 shouldBe("emptyTouch.screenX", "0"); | 45 shouldBe("incompleteTouch.pageX", "100"); |
46 shouldBe("emptyTouch.screenY", "0"); | 46 shouldBe("incompleteTouch.pageY", "101"); |
47 shouldBe("emptyTouch.radiusX", "0"); | 47 shouldBe("incompleteTouch.screenX", "102"); |
48 shouldBe("emptyTouch.radiusY", "0"); | 48 shouldBe("incompleteTouch.screenY", "103"); |
49 shouldBe("emptyTouch.rotationAngle", "0"); | 49 shouldBe("incompleteTouch.radiusX", "0"); |
50 shouldBe("emptyTouch.force", "0"); | 50 shouldBe("incompleteTouch.radiusY", "0"); |
| 51 shouldBe("incompleteTouch.rotationAngle", "0"); |
| 52 shouldBe("incompleteTouch.force", "0"); |
| 53 |
| 54 shouldThrow("document.createTouch(window, target, 1, 'b', 101, 102, 103, 0, 0, 0
, 0)", '"TypeError: Failed to execute \'createTouch\' on \'Document\': The provi
ded double value is non-finite."'); |
51 | 55 |
52 // Try invoking with incorrect parameter types. | 56 // Try invoking with incorrect parameter types. |
53 var badParamsTouch = document.createTouch(function(x) { return x; }, 12, 'a', 'b
', 'c', function(x) { return x; }, 104, 'a', 'b', 'c', 'd'); | 57 var badParamsTouch = document.createTouch(function(x) { return x; }, 12, 'a', 0,
0, 0, 104, function(x) { return x; }, 'a', 'b', 'c'); |
54 shouldBeNonNull("badParamsTouch"); | 58 shouldBeNonNull("badParamsTouch"); |
55 shouldBeNull("badParamsTouch.target"); | 59 shouldBeNull("badParamsTouch.target"); |
56 shouldBe("badParamsTouch.identifier", "0"); | 60 shouldBe("badParamsTouch.identifier", "0"); |
57 shouldBe("badParamsTouch.pageX", "0"); | 61 shouldBe("badParamsTouch.pageX", "0"); |
58 shouldBe("badParamsTouch.pageY", "0"); | 62 shouldBe("badParamsTouch.pageY", "0"); |
59 shouldBe("badParamsTouch.screenX", "0"); | 63 shouldBe("badParamsTouch.screenX", "0"); |
60 shouldBe("badParamsTouch.screenY", "104"); | 64 shouldBe("badParamsTouch.screenY", "104"); |
61 shouldBe("badParamsTouch.radiusX", "0"); | 65 shouldBe("badParamsTouch.radiusX", "0"); |
62 shouldBe("badParamsTouch.radiusY", "0"); | 66 shouldBe("badParamsTouch.radiusY", "0"); |
63 shouldBe("badParamsTouch.rotationAngle", "0"); | 67 shouldBe("badParamsTouch.rotationAngle", "0"); |
64 shouldBe("badParamsTouch.force", "0"); | 68 shouldBe("badParamsTouch.force", "0"); |
65 | 69 |
66 // Should not crash when invoked on a detached Document. | 70 // Should not crash when invoked on a detached Document. |
67 var detachedTouch; | 71 var detachedTouch; |
68 shouldBeNonNull("detachedTouch = document.implementation.createDocument('a', 'b'
).createTouch()"); | 72 shouldBeNonNull("detachedTouch = document.implementation.createDocument('a', 'b'
).createTouch(window, null, 0, 0, 0, 0, 0)"); |
69 shouldBeNull("detachedTouch.target"); | 73 shouldBeNull("detachedTouch.target"); |
70 shouldBe("detachedTouch.identifier", "0"); | 74 shouldBe("detachedTouch.identifier", "0"); |
71 shouldBe("detachedTouch.pageX", "0"); | 75 shouldBe("detachedTouch.pageX", "0"); |
72 shouldBe("detachedTouch.pageY", "0"); | 76 shouldBe("detachedTouch.pageY", "0"); |
73 shouldBe("detachedTouch.screenX", "0"); | 77 shouldBe("detachedTouch.screenX", "0"); |
74 shouldBe("detachedTouch.screenY", "0"); | 78 shouldBe("detachedTouch.screenY", "0"); |
75 shouldBe("detachedTouch.radiusX", "0"); | 79 shouldBe("detachedTouch.radiusX", "0"); |
76 shouldBe("detachedTouch.radiusY", "0"); | 80 shouldBe("detachedTouch.radiusY", "0"); |
77 shouldBe("detachedTouch.rotationAngle", "0"); | 81 shouldBe("detachedTouch.rotationAngle", "0"); |
78 shouldBe("detachedTouch.force", "0"); | 82 shouldBe("detachedTouch.force", "0"); |
79 | 83 |
80 isSuccessfullyParsed(); | 84 isSuccessfullyParsed(); |
| 85 |
81 </script> | 86 </script> |
82 </body> | 87 </body> |
83 </html> | 88 </html> |
OLD | NEW |