Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Side by Side Diff: content/test/data/device_sensors/device_motion_null_test.html

Issue 870103004: Deflake Device Orientation/Motion browsertests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix formatting Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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;
19 }
20
21 function onMotion(event) {
22 window.removeEventListener('devicemotion', onMotion);
23 checkMotionEvent(event) ? pass() : fail();
24 }
25
26 function pass() {
27 document.getElementById('status').innerHTML = 'PASS';
28 document.location = '#pass';
29 }
30
31 function fail() {
32 document.location = '#fail';
33 }
34
35 window.addEventListener('devicemotion', onMotion);
36 </script>
37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698