t025-manual.https.html (1441B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Implementations that are unable to provide acceleration data without the effect of gravity may instead supply the acceleration including the effect of gravity</title> 5 <meta name=viewport content="width=device-width, maximum-scale=1.0"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <link rel="author" title="Mosquito FP7"> 9 <link rel="reviewer author" title="Zhiqiang Zhang" href="mailto:zhiqiang.zhang@intel.com"> <!-- 2013-10-14 --> 10 </head> 11 <body> 12 <p>Move the device to run the test.</p> 13 <div id="log"></div> 14 <script> 15 var t1 = async_test("Implementation is unable to provide 'acceleration' property"); 16 var t2 = async_test("Implementation is able to provide 'acceleration IncludingGravity' property"); 17 var run = false; 18 window.ondevicemotion = function(e) { 19 if (!run) { 20 run = true; 21 t1.step(function() { 22 assert_equals(e.acceleration, null); 23 }); 24 t1.done(); 25 t2.step(function() { 26 var eaccgvt = e.accelerationIncludingGravity; 27 assert_equals(typeof eaccgvt, "object"); 28 assert_not_equals(eaccgvt.x, 0); 29 assert_not_equals(eaccgvt.y, 0); 30 assert_not_equals(eaccgvt.z, 0); 31 }); 32 t2.done(); 33 } 34 }; 35 </script> 36 </body> 37 </html>