gecko/content/events/test/test_bug615597.html
Doug Turner 104a8914c7 Bug 615597 - Implement devicemotion and fix up deviceorientation events. r=smaug/azakai
--HG--
rename : content/events/src/nsDOMOrientationEvent.cpp => content/events/src/nsDOMDeviceOrientationEvent.cpp
rename : content/events/src/nsDOMOrientationEvent.h => content/events/src/nsDOMDeviceOrientationEvent.h
rename : dom/system/android/nsAccelerometerSystem.cpp => dom/system/android/nsDeviceMotionSystem.cpp
rename : dom/system/android/nsAccelerometerSystem.h => dom/system/android/nsDeviceMotionSystem.h
rename : dom/system/cocoa/nsAccelerometerSystem.h => dom/system/cocoa/nsDeviceMotionSystem.h
rename : dom/system/cocoa/nsAccelerometerSystem.mm => dom/system/cocoa/nsDeviceMotionSystem.mm
rename : dom/system/nsAccelerometer.cpp => dom/system/nsDeviceMotion.cpp
rename : dom/system/nsAccelerometer.h => dom/system/nsDeviceMotion.h
rename : dom/system/unix/nsAccelerometerSystem.cpp => dom/system/unix/nsDeviceMotionSystem.cpp
rename : dom/system/unix/nsAccelerometerSystem.h => dom/system/unix/nsDeviceMotionSystem.h
rename : dom/system/windows/nsAccelerometerSystem.cpp => dom/system/windows/nsDeviceMotionSystem.cpp
rename : dom/system/windows/nsAccelerometerSystem.h => dom/system/windows/nsDeviceMotionSystem.h
rename : xpcom/system/nsIAccelerometer.idl => xpcom/system/nsIDeviceMotion.idl
2011-06-19 22:36:17 -07:00

43 lines
1.2 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=615597
-->
<head>
<title>Test for Bug 615597</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=615597">Mozilla Bug 615597</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 615597 **/
window.addEventListener("deviceorientation", function(event) {
is(event.alpha, 1.5);
is(event.beta, 2.25);
is(event.gamma, 3.667);
is(event.absolute, true);
SimpleTest.finish();
}, true);
var event = DeviceOrientationEvent;
ok(!!event, "Should have seen DeviceOrientationEvent!");
event = document.createEvent("DeviceOrientationEvent");
event.initDeviceOrientationEvent('deviceorientation', true, true, 1.5, 2.25, 3.667, true);
window.dispatchEvent(event);
SimpleTest.waitForExplicitFinish();
</script>
</pre>
</body>
</html>