test_bug667919-1.html 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=615597
  5. -->
  6. <head>
  7. <title>Test for Bug 615597</title>
  8. <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  9. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  10. </head>
  11. <body>
  12. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=615597">Mozilla Bug 615597</a>
  13. <p id="display"></p>
  14. <div id="content" style="display: none">
  15. </div>
  16. <pre id="test">
  17. <script type="application/javascript">
  18. /** Test for Bug 615597 **/
  19. window.ondeviceorientation = function(event) {
  20. is(event.alpha, 1.5);
  21. is(event.beta, 2.25);
  22. is(event.gamma, 3.667);
  23. is(event.absolute, true);
  24. SimpleTest.finish();
  25. };
  26. var event = DeviceOrientationEvent;
  27. ok(!!event, "Should have seen DeviceOrientationEvent!");
  28. event = document.createEvent("DeviceOrientationEvent");
  29. event.initDeviceOrientationEvent('deviceorientation', true, true, 1.5, 2.25, 3.667, true);
  30. window.dispatchEvent(event);
  31. SimpleTest.waitForExplicitFinish();
  32. </script>
  33. </pre>
  34. </body>
  35. </html>