3 <title>DeviceMotion all-null event test
</title>
6 <div id=
"status">FAIL
</div>
8 <script type=
"text/javascript">
9 function checkMotionEvent(event
) {
10 return event
.acceleration
.x
== null &&
11 event
.acceleration
.y
== null &&
12 event
.acceleration
.z
== null &&
13 event
.accelerationIncludingGravity
.x
== null &&
14 event
.accelerationIncludingGravity
.y
== null &&
15 event
.accelerationIncludingGravity
.z
== null &&
16 event
.rotationRate
.alpha
== null &&
17 event
.rotationRate
.beta
== null &&
18 event
.rotationRate
.gamma
== null;
21 function onMotion(event
) {
22 window
.removeEventListener('devicemotion', onMotion
);
23 checkMotionEvent(event
) ? pass() : fail();
27 document
.getElementById('status').innerHTML
= 'PASS';
28 document
.location
= '#pass';
32 document
.location
= '#fail';
35 window
.addEventListener('devicemotion', onMotion
);