Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / test / data / device_orientation / device_orientation_null_test_with_alert.html
1 <html>
2   <head>
3     <title>DeviceOrientation all-null event test with alert</title>
4     <script type="text/javascript">
5       function checkOrientationEvent(event) {
6         return event.alpha == null &&
7                event.beta == null &&
8                event.gamma == null;
9       }
10
11       function onOrientation(event) {
12         window.removeEventListener('deviceorientation', onOrientation);
13         checkOrientationEvent(event) ? pass() : fail();
14       }
15
16       function pass() {
17         document.getElementById('status').innerHTML = 'PASS';
18         document.location = '#pass';
19       }
20
21       function fail() {
22         document.location = '#fail';
23       }
24
25       window.addEventListener('deviceorientation', onOrientation);
26       alert("suspend active DOM objects");
27     </script>
28   </head>
29   <body>
30     <div id="status">FAIL</div>
31   </body>
32 </html>