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

Side by Side Diff: chrome/test/data/device_orientation/device_orientation_test.html

Issue 2858049: Chromium plumbing for Device Orientation. (Closed)
Patch Set: Fixes after try bot runs Created 10 years, 4 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 | « chrome/renderer/render_view.cc ('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>DeviceOrientation test</title>
4 <script type="text/javascript">
5 var eventCount = 0;
6
7 function checkOrientationEvent(event) {
8 // Return true iff the orientation is close enough to (1, 2, 3).
9 return Math.abs(event.alpha - 1) < 0.01 &&
10 Math.abs(event.beta - 2) < 0.01 &&
11 Math.abs(event.gamma - 3) < 0.01;
12 }
13
14 function onOrientation(event) {
15 if (checkOrientationEvent(event)) {
16 window.removeEventListener('deviceorientation', onOrientation);
17 pass();
18 } else {
19 fail();
20 }
21 }
22
23 function pass() {
24 document.getElementById('status').innerHTML = 'PASS';
25 document.location = '#pass';
26 }
27
28 function fail() {
29 document.location = '#fail';
30 }
31 </script>
32 </head>
33 <body onLoad="window.addEventListener('deviceorientation', onOrientation)">
34 <div id="status">FAIL</div>
35 </body>
36 </html>
OLDNEW
« no previous file with comments | « chrome/renderer/render_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698