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

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

Issue 2948253002: Revert of Refactor DeviceMotionEventPump to use //device/generic_sensor instead of //device/sensors (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « content/test/DEPS ('k') | content/test/data/device_sensors/device_motion_test.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <title>DeviceMotion only some sensors are available test</title>
4 <script type="text/javascript">
5 let expectedInterval = Math.floor(1000 / 60);
6 function checkMotionEvent(event) {
7 return event.acceleration.x == 1 &&
8 event.acceleration.y == 2 &&
9 event.acceleration.z == 3 &&
10 event.accelerationIncludingGravity.x == null &&
11 event.accelerationIncludingGravity.y == null &&
12 event.accelerationIncludingGravity.z == null &&
13 event.rotationRate.alpha == 7 &&
14 event.rotationRate.beta == 8 &&
15 event.rotationRate.gamma == 9 &&
16 event.interval == expectedInterval;
17 }
18
19 function onMotion(event) {
20 if (checkMotionEvent(event)) {
21 window.removeEventListener('devicemotion', onMotion);
22 pass();
23 } else {
24 fail();
25 }
26 }
27
28 function pass() {
29 document.getElementById('status').innerHTML = 'PASS';
30 document.location = '#pass';
31 }
32
33 function fail() {
34 document.location = '#fail';
35 }
36 </script>
37 </head>
38 <body onLoad="window.addEventListener('devicemotion', onMotion)">
39 <div id="status">FAIL</div>
40 </body>
41 </html>
OLDNEW
« no previous file with comments | « content/test/DEPS ('k') | content/test/data/device_sensors/device_motion_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698