submitted/mosquito/DeviceMotion/t030.html
changeset 0 80de249b382e
child 1 e0aec940fb46
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceMotion/t030.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+	<title>Implementations that are unable to provide the acceleration property must set the values to null:</title>
+	<meta name=viewport content="width=device-width, maximum-scale=1.0, user-scalable=no" />
+	<script src="http://w3c-test.org/resources/testharness.js"></script>
+	<script src="http://w3c-test.org/resources/testharnessreport.js"></script>
+	<script src="http://w3c-test.org/resources/WebIDLParser.js"></script>
+	<script src="http://w3c-test.org/resources/idlharness.js"></script>
+  </head>
+
+  <body>
+
+  
+  	<h1>Implementations that are unable to provide the acceleration property must set the values to null:</h1>
+	<div id="log">
+	</div>
+
+	<script type="text/javascript">
+		tgvt = async_test("acceleration property must be set to null");
+		tx = async_test("x property of acceleration must be set to null");
+		ty = async_test("y property of acceleration must be set to null");
+		tz = async_test("z property of acceleration must be set to null");
+
+		vgvt = 0;
+		vx = 0;
+		vy = 0;
+		vz = 0;
+		window.addEventListener('devicemotion', function (e){
+			acc = e.acceleration;
+			vgvt = acc;
+			vx = acc.x;
+			vy = acc.y;
+			vz = acc.z;
+		}, false);
+		
+		setTimeout("testing()", 200);
+		
+		function testing(){
+			tgvt.step(function() {assert_equals(vgvt, null)});
+			tgvt.done();
+			tx.step(function() {assert_equals(vx, null)});
+			tx.done();
+			ty.step(function() {assert_equals(vy, null)});
+			ty.done();
+			tz.step(function() {assert_equals(vz, null)});				
+			tz.done();
+		}
+	</script>
+	
+  </body>
+  
+</html>