submitted/mosquito/DeviceOrientation/Unable%20to%20provide%20angles%20must%20set%20values%20to%20null.html
changeset 0 80de249b382e
child 1 e0aec940fb46
equal deleted inserted replaced
-1:000000000000 0:80de249b382e
       
     1 <!DOCTYPE html>
       
     2 <html>
       
     3 
       
     4   <head>
       
     5     <title>Unable to provide angles must set values to null:</title>
       
     6  	<meta name=viewport content="width=device-width, maximum-scale=1.0, user-scalable=no" />
       
     7    <script src="http://w3c-test.org/resources/testharness.js"></script>
       
     8     <script src="http://w3c-test.org/resources/testharnessreport.js"></script>
       
     9   </head>
       
    10 
       
    11   <body>
       
    12 
       
    13   
       
    14   		<h1>Unable to provide angles must set values to null:</h1>
       
    15     <div id="log">
       
    16     </div>
       
    17 	
       
    18 	<script>
       
    19 	absolute = null;
       
    20 	   if (window.DeviceOrientationEvent) {
       
    21 	  		window.addEventListener('deviceorientation', function(eventData) {
       
    22 	
       
    23 				// Gamma : angle par rapport a x
       
    24 				gamma = eventData.gamma;
       
    25 				// Beta : angle par rapport a y
       
    26 				beta = eventData.beta;
       
    27 				// Alpha : orientation (N-S-E-O)
       
    28 				alpha = eventData.alpha;
       
    29 				absolute = eventData.absolute;
       
    30 				
       
    31 			}, false);
       
    32 			
       
    33 		}
       
    34 	
       
    35 	alert("Launch Test.");
       
    36 	alert(absolute);
       
    37 	test(function() {assert_equals(gamma, null)}, "gamma must be to null");
       
    38 	test(function() {assert_equals(beta, null)}, "beta must be to null");
       
    39 	test(function() {assert_equals(alpha, null)}, "alpha must be to null");
       
    40 	  
       
    41 	</script>
       
    42 	
       
    43   </body>
       
    44   
       
    45 </html>