t012-manual.https.html (1676B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Implementations that are unable to provide all three angles must set the values of the unknown angles to null</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-12 --> 10 </head> 11 <body> 12 <p>Precondition: implementation is unable to provide all three angles</p> 13 <p>Rotate the device to run the test.</p> 14 <div id="log"></div> 15 <script> 16 var t1 = async_test("Alpha, Beta and Gamma are null. absolute is false."); 17 var run = false; 18 window.addEventListener("deviceorientation", function(e) { 19 if (!run) { 20 run = true; 21 t1.step(function() { 22 assert_equals(e.alpha, null, "alpha is set to null"); 23 assert_equals(e.beta, null, "beta is set to null"); 24 assert_equals(e.gamma, null, "gamma is set to null"); 25 assert_false(e.absolute, "absolute is set to false"); 26 }); 27 t1.done(); 28 } 29 }, false); 30 31 test(function() { 32 var evt = new DeviceOrientationEvent("foo"); 33 assert_equals(evt.alpha, null, "alpha is set to null"); 34 assert_equals(evt.beta, null, "beta is set to null"); 35 assert_equals(evt.gamma, null, "gamma is set to null"); 36 assert_false(evt.absolute, "absolute is set to false"); 37 }, "User created event is initialized properly"); 38 </script> 39 </body> 40 </html>