basic-operation.html 766 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
</head>
<body>
<script>
description('Tests the basic operation of DeviceProximity using the proximity.');

var firedEvent = {value: 2.2, min: 1.1, max: 3.3};

var deviceProximityEvent;
window.addEventListener('webkitdeviceproximity', function(e) {
    deviceProximityEvent = e;
    shouldBe('deviceProximityEvent.value', 'firedEvent.value');
15 16
    shouldBe('deviceProximityEvent.min', 'firedEvent.min');
    shouldBe('deviceProximityEvent.max', 'firedEvent.max');
17 18 19
    finishJSTest();
});

20
internals.setDeviceProximity('webkitdeviceproximity', firedEvent.value, firedEvent.min, firedEvent.max);
21 22
window.jsTestIsAsync = true;
</script>
23
<script src="../resources/js-test-post.js"></script>
24 25
</body>
</html>