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

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

Issue 2744243006: Ensure complete end-to-end browsertest coverage for absolute device orientation. (Closed)
Patch Set: Michael's comment Created 3 years, 9 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/data/device_sensors/device_orientation_absolute_null_test.html ('k') | no next file » | 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>DeviceOrientationAbsolute test</title>
4 <script type="text/javascript">
5 function checkOrientationAbsoluteEvent(event) {
6 // Return true iff the orientation is close enough to (4, 5, 6).
7 return Math.abs(event.alpha - 4) < 0.01 &&
8 Math.abs(event.beta - 5) < 0.01 &&
9 Math.abs(event.gamma - 6) < 0.01 &&
10 event.absolute == true;
11 }
12
13 function onOrientationAbsolute(event) {
14 if (checkOrientationAbsoluteEvent(event)) {
15 window.removeEventListener('deviceorientationabsolute', onOrientationA bsolute);
16 pass();
17 } else {
18 fail();
19 }
20 }
21
22 function pass() {
23 document.getElementById('status').innerHTML = 'PASS';
24 document.location = '#pass';
25 }
26
27 function fail() {
28 document.location = '#fail';
29 }
30 </script>
31 </head>
32 <body onLoad="window.addEventListener('deviceorientationabsolute', onOrientati onAbsolute)">
33 <div id="status">FAIL</div>
34 </body>
35 </html>
OLDNEW
« no previous file with comments | « content/test/data/device_sensors/device_orientation_absolute_null_test.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698