create-event-deviceproximity.html 763 Bytes
Newer Older
1 2
<html>
<head>
3
<script src="../resources/js-test-pre.js"></script>
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
</head>
<body>
<p id="description"></p>
<div id="result"></div>
<div id="console"></div>
<script>
description('Tests that document.createEvent() works with deviceproximity');

function handleDeviceProximity()
{
    testPassed("deviceproximity event is called properly.");
}

window.addEventListener('webkitdeviceproximity', handleDeviceProximity, false);

try {
    var event = document.createEvent("DeviceProximityEvent");
    event.initEvent("webkitdeviceproximity", false, false);
    window.dispatchEvent(event);
} catch(e) {
    testFailed("deviceproximity event doesn't appear to be enabled or implemented.");
}
</script>
27
<script src="../resources/js-test-post.js"></script>
28 29
</body>
</html>