t006-manual.https.html (989B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Rotate the device frame around its z axis</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>Rotate the device frame around its z axis to run the test.</p> 13 <div id="log"></div> 14 <script> 15 var t1 = async_test("Alpha is in [0, 360)"); 16 var run = false; 17 window.addEventListener("deviceorientation", function(e) { 18 if (!run && e.alpha !== null) { 19 run = true; 20 t1.step(function() { 21 assert_greater_than_equal(e.alpha, 0); 22 assert_less_than(e.alpha, 360); 23 }); 24 t1.done(); 25 } 26 }, false); 27 </script> 28 </body> 29 </html>