[refactor] More post-NSS WebCrypto cleanups (utility functions).
[chromium-blink-merge.git] / content / test / data / device_sensors / device_motion_null_test.html
blob8bf75e6148f28fba1ebf02791fce415f3b8bff14
1 <html>
2 <head>
3 <title>DeviceMotion all-null event test</title>
4 </head>
5 <body>
6 <div id="status">FAIL</div>
7 </body>
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();
26 function pass() {
27 document.getElementById('status').innerHTML = 'PASS';
28 document.location = '#pass';
31 function fail() {
32 document.location = '#fail';
35 window.addEventListener('devicemotion', onMotion);
36 </script>
37 </html>