OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 <script> | 5 <script> |
6 description("Tests that document.createEvent() works with DeviceMotionEvent."); | 6 description("Tests that document.createEvent() works with DeviceMotionEvent."); |
7 | 7 |
8 var event = document.createEvent('DeviceMotionEvent'); | 8 var event = document.createEvent('DeviceMotionEvent'); |
9 var newEvent = new CustomEvent("devicemotion", { | 9 var newEvent = new CustomEvent("devicemotion", { |
10 bubbles: false, cancelable: false, | 10 bubbles: false, cancelable: false, |
11 acceleration: {x:1.5,y:2.5,z:3.5}, | 11 acceleration: {x:1.5,y:2.5,z:3.5}, |
12 accelerationIncludingGravity: {x:4.5,y:5.5,z:6.5}, | 12 accelerationIncludingGravity: {x:4.5,y:5.5,z:6.5}, |
13 rotationRate: {alpha:7.5,beta:8.5,gamma:9.5}, | 13 rotationRate: {alpha:7.5,beta:8.5,gamma:9.5}, |
14 interval: 0.5 | 14 interval: 0.5 |
(...skipping 19 matching lines...) Expand all Loading... |
34 shouldBeFalse("event.cancelable"); | 34 shouldBeFalse("event.cancelable"); |
35 shouldBeFalse("newEvent.cancelable"); | 35 shouldBeFalse("newEvent.cancelable"); |
36 shouldBeTrue("typeof event.acceleration == 'object'"); | 36 shouldBeTrue("typeof event.acceleration == 'object'"); |
37 shouldBeTrue("typeof event.accelerationIncludingGravity == 'object'"); | 37 shouldBeTrue("typeof event.accelerationIncludingGravity == 'object'"); |
38 shouldBeTrue("typeof event.rotationRate == 'object'"); | 38 shouldBeTrue("typeof event.rotationRate == 'object'"); |
39 shouldBeTrue("typeof event.interval == 'object'"); | 39 shouldBeTrue("typeof event.interval == 'object'"); |
40 | 40 |
41 </script> | 41 </script> |
42 </body> | 42 </body> |
43 </html> | 43 </html> |
OLD | NEW |