<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<script>
description('Tests using DeviceProximity from multiple frames.');

var DeviceProximityEvent;
function checkProximity(event) {
    DeviceProximityEvent = event;
    shouldBe('DeviceProximityEvent.value', 'firedEvent.value');
    shouldBe('DeviceProximityEvent.min', 'firedEvent.min');
    shouldBe('DeviceProximityEvent.max', 'firedEvent.max');
}

var hasMainFrameEventFired = false;
function mainFrameListener(event) {
    checkProximity(event);
    hasMainFrameEventFired = true;
    maybeFinishTest();
}

var hasChildFrameEventFired = false;
function childFrameListener(event) {
    checkProximity(event);
    hasChildFrameEventFired = true;
    maybeFinishTest();
}

function maybeFinishTest() {
    if (hasMainFrameEventFired && hasChildFrameEventFired)
        finishJSTest();
}

var childFrame = document.createElement('iframe');
document.body.appendChild(childFrame);
childFrame.contentWindow.addEventListener('webkitdeviceproximity', childFrameListener);

window.addEventListener('webkitdeviceproximity', mainFrameListener);
var firedEvent = {value: 2.2, min: 1.1, max: 3.3};
internals.setDeviceProximity('webkitdeviceproximity', firedEvent.value, firedEvent.min, firedEvent.max);

window.jsTestIsAsync = true;
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>
