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

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

Issue 214763002: Add end-to-end browser tests for Device Motion/Orientation null-events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@March-24-null-firing-testing
Patch Set: Created 6 years, 8 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 <script type="text/javascript">
5 function checkMotionEvent(event) {
6 return event.acceleration.x == null &&
7 event.acceleration.y == null &&
8 event.acceleration.z == null &&
9 event.accelerationIncludingGravity.x == null &&
10 event.accelerationIncludingGravity.y == null &&
11 event.accelerationIncludingGravity.z == null &&
12 event.rotationRate.alpha == null &&
13 event.rotationRate.beta == null &&
14 event.rotationRate.gamma == null;
15 }
16
17 function onMotion(event) {
18 if (checkMotionEvent(event)) {
19 window.removeEventListener('devicemotion', onMotion);
mlamouri (slow - plz ping) 2014/04/04 13:47:07 That sounds odd. Shouldn't you always remove the e
timvolodine 2014/04/04 18:03:18 Hmm, yes that sounds better indeed, I've updated t
20 pass();
21 } else {
22 fail();
23 }
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 alert("suspend active DOM objects");
37 </script>
38 </head>
39 <body>
40 <div id="status">FAIL</div>
41 </body>
42 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698