import from http://html5.mosquito-fp7.eu/pages/device_orientation_api.html
authorDominique Hazael-Massieux <dom@w3.org>
Wed, 30 May 2012 14:40:41 +0200
changeset 0 80de249b382e
child 1 e0aec940fb46
import from http://html5.mosquito-fp7.eu/pages/device_orientation_api.html
submitted/mosquito/DeviceMotion/020%20-%20A%20device%20lying%20flat%20on%20a%20horizontal%20surface%20with%20the%20screen%20upmost.html
submitted/mosquito/DeviceMotion/030%20-%20A%20device%20with%20the%20screen%20upright.html
submitted/mosquito/DeviceMotion/040%20-%20A%20device%20in%20free-fall,%20with%20the%20screen%20horizontal%20and%20upmost.html
submitted/mosquito/DeviceMotion/t021.html
submitted/mosquito/DeviceMotion/t022.html
submitted/mosquito/DeviceMotion/t023.html
submitted/mosquito/DeviceMotion/t025.html
submitted/mosquito/DeviceMotion/t026.html
submitted/mosquito/DeviceMotion/t028.html
submitted/mosquito/DeviceMotion/t030.html
submitted/mosquito/DeviceMotion/t031.html
submitted/mosquito/DeviceMotion/t032.html
submitted/mosquito/DeviceMotion/test%20values%20set%20to%20null.html
submitted/mosquito/DeviceOrientation/A%20device%20lying%20flat%20on%20a%20horizontal%20surface.html
submitted/mosquito/DeviceOrientation/Unable%20to%20provide%20angles%20must%20set%20values%20to%20null.html
submitted/mosquito/DeviceOrientation/t001.html
submitted/mosquito/DeviceOrientation/t002.html
submitted/mosquito/DeviceOrientation/t003.html
submitted/mosquito/DeviceOrientation/t006.html
submitted/mosquito/DeviceOrientation/t009.html
submitted/mosquito/DeviceOrientation/t010.html
submitted/mosquito/DeviceOrientation/t012.html
submitted/mosquito/pages/device_orientation_api.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceMotion/020%20-%20A%20device%20lying%20flat%20on%20a%20horizontal%20surface%20with%20the%20screen%20upmost.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+	<title>02 - A device lying flat on a horizontal surface with the screen upmost:</title>
+	<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>02 - A device lying flat on a horizontal surface with the screen upmost:</h1>
+	<div id="log">
+	</div>
+	
+	<script>
+	
+	function init(){
+	   if (window.DeviceMotionEvent) {
+			window.addEventListener('devicemotion', DeviceMotionHandler, false);
+			alert("Put your device on a horizontal surface with the screen upmost.");
+		};
+	}
+	
+	function DeviceMotionHandler(eventData){
+			
+		var gravity = eventData.accelerationIncludingGravity;
+		// X : angle par rapport a x
+		x = gravity.x;
+		// Y : angle par rapport a y
+		y = gravity.y;
+		// Z : acceleromètre (de base : -9.81)
+		z = gravity.z;
+		
+		tx.step(function() {assert_approx_equals(x, 0, 1)});
+		ty.step(function() {assert_approx_equals(y, 0, 1)});
+		tz.step(function() {assert_approx_equals(z, -9.81, 1.5)});
+		tx.done();
+		ty.done();
+		tz.done();
+	}
+
+	init();
+	
+	var tx = async_test("X angle");
+	var ty = async_test("Y angle");
+	var tz = async_test("Z angle");
+	</script>
+	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceMotion/030%20-%20A%20device%20with%20the%20screen%20upright.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+	<title>02 - A device with the screen upright:</title>
+	<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>02 - A device with the screen upright:</h1>
+	<div id="log">
+	</div>
+	
+	<script>
+	
+	function init(){
+	   if (window.DeviceMotionEvent) {
+	   	if(confirm("Put your device with the screen upright.")){
+				window.addEventListener('devicemotion', DeviceMotionHandler, false);
+			}
+		};
+	}
+	
+	function DeviceMotionHandler(eventData){
+			
+		var gravity = eventData.accelerationIncludingGravity;
+		// X : angle par rapport a x
+		x = gravity.x;
+		// Y : angle par rapport a y
+		y = gravity.y;
+		// Z : acceleromètre (de base : -9.81)
+		z = gravity.z;
+		
+		tx.step(function() {assert_approx_equals(x, 0, 1)});
+		ty.step(function() {assert_approx_equals(y, -10, 1)});
+		tz.step(function() {assert_approx_equals(z, 0, 1)});
+		tx.done();
+		ty.done();
+		tz.done();
+	}
+
+	init();
+	
+	var tx = async_test("X angle");
+	var ty = async_test("Y angle");
+	var tz = async_test("Z angle");
+	</script>
+	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceMotion/040%20-%20A%20device%20in%20free-fall,%20with%20the%20screen%20horizontal%20and%20upmost.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+	<title>03 - A device in free-fall, with the screen horizontal and upmost:</title>
+	<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>03 - A device in free-fall, with the screen horizontal and upmost:</h1>
+	<div id="log">
+	</div>
+	
+	<script>
+	
+	function init(){
+	   if (window.DeviceMotionEvent) {
+			window.addEventListener('devicemotion', DeviceMotionHandler, false);
+			alert("Launch Test");
+		};
+	}
+	
+	function DeviceMotionHandler(eventData){
+			
+		var gravity = eventData.accelerationIncludingGravity;
+		// X : angle par rapport a x
+		x = gravity.x;
+		// Y : angle par rapport a y
+		y = gravity.y;
+		// Z : acceleromètre (de base : -9.81)
+		z = gravity.z;
+		
+		tx.step(function() {assert_approx_equals(x, 0, 1)});
+		ty.step(function() {assert_approx_equals(y, 0, 1)});
+		tz.step(function() {assert_approx_equals(z, 0, 1)});
+		tx.done();
+		ty.done();
+		tz.done();
+	}
+
+	init();
+	
+	var tx = async_test("X angle");
+	var ty = async_test("Y angle");
+	var tz = async_test("Free-fall");
+	</script>
+	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceMotion/t021.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+	<title>User agents implementing this specification must provide a new DOM event, named devicemotion:</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>
+  </head>
+
+  <body>
+
+  
+  		<h1>User agents implementing this specification must provide a new DOM event, named devicemotion:</h1>
+    <div id="log"></div>
+	
+	<script type="text/javascript">
+		t = null;
+		at = async_test();
+		
+		window.addEventListener('devicemotion', function(e) {t = true}, false);
+		setTimeout("testing()", 200);
+		
+		function testing(){
+			at.step(function() {assert_true(t)}); 
+			at.done();
+		}
+	</script>
+	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceMotion/t022.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+	<title>The corresponding event must be of type DeviceOrientationEvent and must fire on the window object:</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>
+  </head>
+
+  <body>
+
+  
+  		<h1>The corresponding event must be of type DeviceOrientationEvent and must fire on the window object:</h1>
+    <div id="log"></div>
+	
+	<script type="text/javascript">
+		t1 = async_test("The corresponding event must be of type DeviceMotionEvent");
+		t2 = async_test("The corresponding event must fire on the window object");
+		etype = null;
+		ewin = null;
+		window.addEventListener('devicemotion', function(e) {etype = e.type; ewin = this;}, false);
+		
+		setTimeout("testing()", 200);
+		
+		function testing(){
+			t1.step(function() {assert_equals(etype, "devicemotion")});
+			t2.step(function() {assert_equals(ewin, window)});
+			t1.done();
+			t2.done();
+		}
+	</script>	
+	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceMotion/t023.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+	<title>User agents must also provide an event handler IDL attribute HTML5 named ondevicemotion on the window object:</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>
+  </head>
+
+  <body>
+
+  
+  		<h1>User agents must also provide an event handler IDL attribute HTML5 named ondevicemotion on the window object:</h1>
+    <div id="log"></div>
+	
+	<script type="text/javascript">
+		t1 = async_test("User agents provide an event handler IDL attribute HTML5 named ondevicemotion");
+		t2 = async_test("The type of this event handler must be 'DeviceMotionEvent'");
+		ename = null;
+		etype = null;
+		window.ondevicemotion = function(e){
+			ename = e.type;
+			etype = ""+e.constructor
+		};
+		
+		setTimeout("testing()", 200);
+		
+		function testing(){
+			t1.step(function() {assert_equals(ename, "devicemotion")});
+			t2.step(function() {assert_true(etype.lastIndexOf("DeviceMotionEvent") != -1)});
+			t1.done();
+			t2.done();
+		}
+	</script>
+	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceMotion/t025.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+	<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>
+	<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>
+  </head>
+
+  <body>
+
+  
+  		<h1>Implementations that are unable to provide acceleration data without the effect of gravity may instead supply the acceleration including the effect of gravity:</h1>
+    <p id="eaccgvt"></p>
+	<div id="log"></div>
+	
+	<script type="text/javascript">
+		t1 = async_test("Implementation unable to provide 'acceleration' property");
+		t2 = async_test("Implementation able to provide 'acceleration IncludingGravity' property");
+		eacc = 0;
+		eaccgvt = 0;
+		window.ondevicemotion = function(e){
+			eacc = e.acceleration;
+			eaccgvt = e.accelerationIncludingGravity;
+		};
+		
+		setTimeout("testing()", 200);
+		
+		
+		function testing(){
+			t1.step(function() {assert_true(eacc == null)});
+			t2.step(function() {assert_true((typeof eaccgvt == "object") && ((eaccgvt.x != 0) && (eaccgvt.y != 0) && (eaccgvt.z != 0)))});
+			t1.done();
+			t2.done();
+		}
+	</script>	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceMotion/t026.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+	<title>The accelerationIncludingGravity property provide the acceleration plus the acceleration equal and opposite to the gravity:</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>The accelerationIncludingGravity property provide the acceleration plus the acceleration equal and opposite to the gravity:</h1>
+	<div id="log">
+	</div>
+
+	<script>
+		setup({timeout:1500});
+		window.addEventListener('devicemotion', function (e){
+			var gvt = e.accelerationIncludingGravity;
+			// X : angle par rapport a x
+			x = gvt.x;
+			tx.step(function() {assert_approx_equals(x, 0, 1)});
+			tx.done();
+			// Y : angle par rapport a y
+			y = gvt.y;
+			ty.step(function() {assert_approx_equals(y, 0, 1)});
+			ty.done();
+			// Z : acceleromètre (de base : -9.81)
+			z = gvt.z;
+			tz.step(function() {assert_approx_equals(z, -9.81, 1)});
+			tz.done();
+			
+		}, false);
+		alert("Put your device on a horizontal surface with the screen upmost.");
+
+		tx = async_test("X angle must be set to zero");
+		ty = async_test("Y angle must be set to zero");
+		tz = async_test("Z angle must be set to -9.81");
+	
+	</script>
+	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceMotion/t028.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+	<title>The interval property must be expressed in milliseconds. It must be a constant, to simplify filtering of the data by the Web application:</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>The interval property must be expressed in milliseconds. It must be a constant, to simplify filtering of the data by the Web application:</h1>
+	<div id="log">
+	</div>
+
+	<script type="text/javascript">
+		tint = async_test("The interval property must be different to zero and must be a constant");
+		inter1 = 0;
+		inter2 = 0;
+		window.addEventListener('devicemotion', function (e){
+			if(inter1 == 0){
+				inter2 = e.interval;
+			}
+			inter1 = e.interval;
+		}, false);
+		
+		setTimeout("testing()", 400);
+		
+		function testing(){
+			tint.step(function() {assert_true((inter1 != 0) && (inter1 == inter2))});
+			tint.done();
+		}
+	</script>
+	
+  </body>
+  
+</html>
--- /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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceMotion/t031.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 accelerationIncludingGravity 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 accelerationIncludingGravity property must set the values to null:</h1>
+	<div id="log">
+	</div>
+	
+		<script type="text/javascript">
+		tgvt = async_test("accelerationIncludingGravity property must be set to null");
+		tx = async_test("x property of accelerationIncludingGravity must be set to null");
+		ty = async_test("y property of accelerationIncludingGravity must be set to null");
+		tz = async_test("z property of accelerationIncludingGravity must be set to null");
+
+		vgvt = "";
+		vx = "";
+		vy = "";
+		vz = "";
+		window.addEventListener('devicemotion', function (e){
+			acc = e.accelerationIncludingGravity;
+			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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceMotion/t032.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 rotationRate 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 rotationRate property must set the values to null:</h1>
+	<div id="log">
+	</div>
+	
+	<script type="text/javascript">
+		trot = async_test("rotationRate property must be set to null");
+		talpha = async_test("alpha property of rotationRate must be set to null");
+		tbeta = async_test("beta property of rotationRate must be set to null");
+		tgamma = async_test("gamma property of rotationRate must be set to null");
+
+		vrot = "";
+		valpha = "";
+		vbeta = "";
+		vgamma = "";
+		window.addEventListener('devicemotion', function (e){
+			rot = e.rotationRate;
+			vrot = rot;
+			valpha = rot.alpha;
+			vbeta = rot.beta;
+			vgamma = rot.gamma;
+		}, false);
+		
+		setTimeout("testing()", 200);
+		
+		function testing(){
+			trot.step(function() {assert_equals(vrot, null)});
+			trot.done();
+			talpha.step(function() {assert_equals(valpha, null)});
+			talpha.done();
+			tbeta.step(function() {assert_equals(vbeta, null)});
+			tbeta.done();
+			tgamma.step(function() {assert_equals(vgamma, null)});				
+			tgamma.done();
+		}
+	</script>
+	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceMotion/test%20values%20set%20to%20null.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+	<title>values set to null:</title>
+	<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>values set to null:</h1>
+	<div id="log">
+	</div>
+	
+	<script>
+	
+	function init(){
+	   if (window.DeviceMotionEvent) {
+			window.addEventListener('devicemotion', DeviceMotionHandler, false);
+			alert("Put your device on a horizontal surface with the screen upmost.");
+		};
+	}
+	
+	function DeviceMotionHandler(eventData){
+			
+		var gravity = eventData.accelerationIncludingGravity;
+		var rot = eventData.rotationRate;
+		// X : angle par rapport a x
+		x = gravity.x;
+		// Y : angle par rapport a y
+		y = gravity.y;
+		// Z : acceleromètre (de base : -9.81)
+		z = gravity.z;
+		
+		tx.step(function() {assert_equals(rot, null)});
+		tx.done();
+
+	}
+
+	init();
+	
+	var tx = async_test("RotationRate set to null");
+	</script>
+	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceOrientation/A%20device%20lying%20flat%20on%20a%20horizontal%20surface.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+    <title>02 - A device lying flat on a horizontal surface:</title>
+    <script src="http://w3c-test.org/resources/testharness.js"></script>
+    <script src="http://w3c-test.org/resources/testharnessreport.js"></script>
+  </head>
+
+  <body>
+
+  
+  		<h1>02 - A device lying flat on a horizontal surface:</h1>
+    <div id="log">
+    </div>
+	
+	<script>
+	
+	function init(){
+	   if (window.DeviceOrientationEvent) {
+	  		window.addEventListener('deviceorientation', function(eventData) {
+	
+				// Gamma : angle par rapport a x
+				gamma = eventData.gamma;
+				// Beta : angle par rapport a y
+				beta = eventData.beta;
+				// Alpha : orientation (N-S-E-O)
+				alpha = eventData.alpha;
+				
+			}, false);
+			
+		}
+	}
+
+	init();
+	
+	alert("Put your device on a horizontal surface.");
+	
+	test(function() {assert_approx_equals(gamma, 0, 2)}, "X angle");
+	test(function() {assert_approx_equals(beta, 0, 2)}, "Y angle");
+	  
+	</script>
+	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceOrientation/Unable%20to%20provide%20angles%20must%20set%20values%20to%20null.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+    <title>Unable to provide angles must set 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>
+  </head>
+
+  <body>
+
+  
+  		<h1>Unable to provide angles must set values to null:</h1>
+    <div id="log">
+    </div>
+	
+	<script>
+	absolute = null;
+	   if (window.DeviceOrientationEvent) {
+	  		window.addEventListener('deviceorientation', function(eventData) {
+	
+				// Gamma : angle par rapport a x
+				gamma = eventData.gamma;
+				// Beta : angle par rapport a y
+				beta = eventData.beta;
+				// Alpha : orientation (N-S-E-O)
+				alpha = eventData.alpha;
+				absolute = eventData.absolute;
+				
+			}, false);
+			
+		}
+	
+	alert("Launch Test.");
+	alert(absolute);
+	test(function() {assert_equals(gamma, null)}, "gamma must be to null");
+	test(function() {assert_equals(beta, null)}, "beta must be to null");
+	test(function() {assert_equals(alpha, null)}, "alpha must be to null");
+	  
+	</script>
+	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceOrientation/t001.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+	<title>User agents implementing this specification must provide a new DOM event, named deviceorientation:</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>
+  </head>
+
+  <body>
+
+  
+  		<h1>User agents implementing this specification must provide a new DOM event, named deviceorientation:</h1>
+    <div id="log">
+    </div>
+	
+	<script type="text/javascript">
+		t = null;
+		at = async_test();
+		
+		window.addEventListener('deviceorientation', function(e) {t = true}, false);
+		setTimeout("testing()", 500);
+		
+		function testing(){
+			at.step(function() {assert_true(t)});
+			at.done();
+		}
+	</script>
+	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceOrientation/t002.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+    <title>The corresponding event must be of type DeviceOrientationEvent and must fire on the window object.:</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>
+  </head>
+
+  <body>
+
+  
+  		<h1>The corresponding event must be of type DeviceOrientationEvent and must fire on the window object.:</h1>
+    <div id="log">
+    </div>
+	
+	<script type="text/javascript">
+		t1 = async_test("The corresponding event must be of type DeviceOrientationEvent");
+		t2 = async_test("The corresponding event must fire on the window object");
+		etype = null;
+		ewin = null;
+		window.addEventListener('deviceorientation', function(e) {etype = e.type; ewin = this;}, false);
+		
+		setTimeout("testing()", 200);
+		
+		function testing(){
+			t1.step(function() {assert_equals(etype, "deviceorientation")});
+			t2.step(function() {assert_equals(ewin, window)});
+			t1.done();
+			t2.done();
+		}
+	</script>	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceOrientation/t003.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+
+	<head>
+		<title>User agents must also provide an event handler IDL attribute [HTML5] named ondeviceorientation on the window object:</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>
+	</head>
+
+  <body>
+
+  
+  		<h1>User agents must also provide an event handler IDL attribute [HTML5] named ondeviceorientation on the window object:</h1>
+    <div id="log">
+    </div>
+	
+	<script type="text/javascript">
+		t1 = async_test("Provide an event handler IDL attribute [HTML5] named ondeviceorientation");
+		t2 = async_test("The type of this event handler must be 'DeviceOrientationEvent'");
+		ename = null;
+		etype = null;
+		window.ondeviceorientation = function(e){
+			ename = e.type;
+			etype = ""+e.constructor
+		};
+		
+		setTimeout("testing()", 200);
+		
+		function testing(){
+			t1.step(function() {assert_equals(ename, "deviceorientation")});
+			t2.step(function() {assert_true(etype.lastIndexOf("DeviceOrientationEvent") != -1)});
+			t1.done();
+			t2.done();
+		}
+	</script>
+	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceOrientation/t006.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+    <title>Rotate the device frame around its z axis:</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>
+  </head>
+
+  <body>
+
+  
+  		<h1>Rotate the device frame around its z axis:</h1>
+    <div id="log">
+    </div>
+	
+	<script>
+		window.addEventListener('deviceorientation', function(eventData) {
+			alpha = eventData.alpha;
+		}, false);
+
+		alert("Launch Test.");
+		
+		test(function() {assert_true(alpha > 0 && alpha < 360)},"Alpha is between 0 and 360");
+		test(function() {assert_approx_equals(alpha, 0, 2)},"Alpha is not around zero (between 0 and 2)");
+		  
+	</script>
+	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceOrientation/t009.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+    <title>Rotate the device frame around its x axis:</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>
+  </head>
+
+  <body>
+
+  
+  		<h1>Rotate the device frame around its x axis:</h1>
+    <div id="log">
+    </div>
+	
+	<script>
+  		window.addEventListener('deviceorientation', function(eventData) {
+			beta = eventData.beta;
+		}, false);
+	
+		alert("Launch Test.");
+		test(function() {assert_true(beta > -180 && beta < 180)},"Beta is between -180 and 180");
+		test(function() {assert_false(beta > -2 && beta < 2)},"Beta is not around zero (between -2 and 2)");
+		  
+	</script>
+	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceOrientation/t010.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+    <title>Rotate the device frame around its y axis:</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>
+  </head>
+
+  <body>
+
+  
+  		<h1>Rotate the device frame around its y axis:</h1>
+    <div id="log">
+    </div>
+	
+	<script>
+	  	window.addEventListener('deviceorientation', function(eventData) {
+			gamma = eventData.gamma;
+		}, false);
+			
+		alert("Launch Test.");
+		test(function() {assert_true(gamma > -90 && gamma < 90)},"gamma is between -90 and 90");
+		test(function() {assert_false(gamma > -2 && gamma < 2)},"Gamma is not around zero (between -2 and 2)");
+		  
+	</script>
+	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/DeviceOrientation/t012.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+    <title>Implementations must set the values of the unknown angles 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>
+  </head>
+
+  <body>
+
+  
+  		<h1>Implementations must set the values of the unknown angles to null:</h1>
+    <div id="log">
+    </div>
+	
+	<script>
+  		window.addEventListener('deviceorientation', function(eventData) {
+
+			// Gamma : angle par rapport a x
+			gamma = eventData.gamma;
+			// Beta : angle par rapport a y
+			beta = eventData.beta;
+			// Alpha : orientation (N-S-E-O)
+			alpha = eventData.alpha;
+
+		}, false);
+	
+	alert("Launch Test.");
+	
+	test(function() {assert_true(gamma == null)}, "check if gamma is set to null");
+	test(function() {assert_true(beta == null)}, "check if beta is set to null");
+	test(function() {assert_true(alpha == null)}, "check if alpha is set to null");
+		
+	</script>
+	
+  </body>
+  
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/mosquito/pages/device_orientation_api.html	Wed May 30 14:40:41 2012 +0200
@@ -0,0 +1,167 @@
+<!DOCTYPE html>
+<!-- saved from url=(0050)http://dev.w3.org/geo/api/test-suite/Overview.html -->
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>DeviceOrientation Event Specification Testing</title>
+	<meta name=viewport content="width=device-height, maximum-scale=1.0, user-scalable=yes" />
+    <link type="text/css" href="http://www.w3.org/StyleSheets/base.css" />
+    <link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/base" />
+    <link href="style.css" rel="stylesheet" type="text/css"/>
+  </head>
+  <body>
+
+    <h1>DeviceOrientation Event Test Suite</h1>
+
+<!--
+<a href="http://dev.w3.org/geo/api/test-suite/test-suite.zip">A Zip archive of all the files</a> is also available.
+-->
+
+<h2>Introduction</h2>
+
+<p>This page links to a series of test cases for the <a href="http://dev.w3.org/geo/api/spec-source-orientation.html">W3C DeviceOrientation Event Specification</a>. It is organised by section, and (more or less) categorizes each test according to which statement in the specification it relates to.</p>
+
+<h2>Instructions</h2>
+
+<p>The tests are designed to be run manually.</p>
+
+<!-- ###################################################################### -->
+<hr>
+<h2>Tests</h2>
+
+<!-- ###################################################################### -->
+
+<h3><a href="http://dev.w3.org/geo/api/spec-source-orientation.html#description">4 Description</a></h3>
+
+<h4><a href="http://dev.w3.org/geo/api/spec-source-orientation.html#deviceorientation">4.1 deviceorientation Event</a></h4>
+<ul>
+
+<!--
+
+	<li>
+		<q></q>
+		<br><small><a href="../DeviceOrientation/t.html">Test </a>: </small>
+	</li>
+  
+-->
+
+  <li>
+    <q>User agents implementing this specification must provide a new DOM event, named deviceorientation.</q>
+    <br><small><a href="../DeviceOrientation/t001.html">Test 001</a>: checks the existence of a new DOM event named deviceorientation.</small>
+  </li>
+
+  <li>
+    <q>The corresponding event must be of type DeviceOrientationEvent and must fire on the window object.</q>
+    <br><small><a href="../DeviceOrientation/t002.html">Test 002</a>: checks if the event is of type DeviceOrientation and if the event is window fired the window object.</small>
+  </li>
+
+  <li>
+    <q>Registration for, and firing of the deviceorientation event must follow the usual behavior of DOM Level 2 Events, [DOMEVENTS].</q>
+    <br><small>No tests.</small>
+  </li>
+
+  <li>
+    <q>User agents must also provide an event handler IDL attribute [HTML5] named ondeviceorientation on the window object. The type of this event handler must be DeviceOrientationEvent.</q>
+    <br><small><a href="../DeviceOrientation/t003.html">Test 003</a>: checks if the event provides an event handler IDL attribute [HTML5] named ondeviceorientation and is of type 'DeviceOrientationEvent'.</small>
+  </li>
+
+  <li>
+    <q>Rotate the device frame around its z axis by alpha degrees, with alpha in [0, 360).</q>
+    <br><small><a href="../DeviceOrientation/t006.html">Test 006</a>: checks if alpha is between 0 and 360.</small>
+  </li>
+
+  <li>
+    <q>Rotate the device frame around its x axis by alpha degrees, with beta in [-180, 180).</q>
+    <br><small><a href="../DeviceOrientation/t009.html">Test 009</a>: checks if beta is between -180 and 180 and not defined at zero.</small>
+  </li>
+
+  <li>
+    <q>Rotate the device frame around its y axis by alpha degrees, with gamma in [-90, 90).</q>
+    <br><small><a href="../DeviceOrientation/t010.html">Test 010</a>: checks if gamma is between -90 and 90 and not defined at zero.</small>
+  </li>
+  
+	<li>
+		<q>Implementations that are unable to provide all three angles must set the values of the unknown angles to null. If any angles are provided, the absolute property must be set appropriately. If an implementation can never provide orientation information, the event should be fired with all properties set to null.</q>
+		<br><small><a href="../DeviceOrientation/t012.html">Test 012</a>: checks if angles set values are set to null (to be tested on devices where at least one date is missing).</small>
+	</li>
+</ul>
+
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+
+<h4><a href="http://dev.w3.org/geo/api/spec-source-orientation.html#compassneedscalibration">4.2 compassneedscalibration Event</a></h4>
+<ul>
+
+  <li>
+    <q>User agents implementing this specification must provide a new DOM event, named compassneedscalibration.</q>
+    <br><small>No tests.</small>
+  </li>
+  
+  <li>
+    <q>This event must fire on the window object.</q>
+    <br><small>No tests.</small>
+  </li>
+  
+  <li>
+    <q>User agents must also provide an event handler IDL attribute [HTML5] named oncompassneedscalibration on the window object. The type of this event handler must be Event.</q>
+    <br><small>No tests.</small>
+  </li>
+  
+  <li>
+    <q>The default action of this event should be for the user agent to present the user with details of how to calibrate the compass. The event must be cancelable, so that web sites can provide their own alternative calibration UI.</q>
+    <br><small>No tests.</small>
+  </li>
+
+</ul>
+
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+
+<h4><a href="http://dev.w3.org/geo/api/spec-source-orientation.html#devicemotion">4.3 devicemotion Event</a></h4>
+<ul>
+  <li>
+    <q>User agents implementing this specification must provide a new DOM event, named devicemotion.</q>
+    <br><small><a href="../DeviceMotion/t021.html">Test 021</a>: creates a new DOM event named devicemotion.</small>
+  </li>
+
+  <li>
+    <q>The corresponding event must be of type DeviceMotionEvent and must fire on the window object.</q>
+    <br><small><a href="../DeviceMotion/t022.html">Test 022</a>: checks if the event is of type devicemotion and if the event is the same that window.</small>
+  </li>
+
+  <li>
+    <q>Registration for, and firing of the devicemotion event must follow the usual behavior of DOM Level 2 Events, [DOMEVENTS].</q>
+    <br><small>No tests.</small>
+  </li>
+
+  <li>
+    <q>User agents must also provide an event handler IDL attribute [HTML5] named ondevicemotion on the window object. The type of this event handler must be DeviceMotionEvent.</q>
+    <br><small><a href="../DeviceMotion/t023.html">Test 023</a>: check if the event provide an event handler IDL attribute [HTML5] named ondevicemotion and is of type 'DeviceMotionEvent'.</small>
+  </li>
+  
+	<li>
+		<q>Implementations that are unable to provide acceleration data without the effect of gravity (due, for example, to the lack of a gyroscope) may instead supply the acceleration including the effect of gravity.</q>
+		<br><small><a href="../DeviceMotion/t025.html">Test 025</a>: checks if the event doesn't provide the acceleration property but provide the accelerationIncludingGravity property.</small>
+	</li>
+  
+	<li>
+		<q>The accelerationIncludingGravity property must provide the acceleration of the hosting device, plus an acceleration equal and opposite to the acceleration due to gravity.</q>
+		<br><small><a href="../DeviceMotion/t026.html">Test 026</a>: checks if the accelerationIncludingGravity property provide the acceleration plus the acceleration equal and opposite to the gravity.</small>
+	</li>
+  
+	<li>
+		<q>The rotationRate property must provide the rate of rotation of the hosting device in space. It must be expressed in deg/s.</q>
+		<br><small>No tests.</small>
+	</li>
+  
+	<li>
+		<q>The interval property must be expressed in milliseconds. It must be a constant, to simplify filtering of the data by the Web application.</q>
+		<br><small><a href="../DeviceMotion/t028.html">Tests 028</a>: check if the interval property is a constant.</small>
+	</li>
+  
+	<li>
+		<q>Implementations that are unable to provide all properties must set the values of the unknown properties to null. If an implementation can never provide motion information, the event should be fired with all properties set to null.</q>
+		<br><small><a href="../DeviceMotion/t030.html">Test 030</a>: The acceleration property must be set to null</small>
+		<br><small><a href="../DeviceMotion/t031.html">Test 031</a>: The accelerationIncludingGravity property must be set to null</small>
+		<br><small><a href="../DeviceMotion/t032.html">Test 032</a>: The rotationRate property must be set to null</small>
+	</li>
+</ul>
+
+</body>
+</html>