<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
</head>
<body>
<script>
description("Tests that when a request is made on a Geolocation object after its frame has been disconnected, no callbacks are made and no crash occurs.");

if (window.testRunner) {
    testRunner.setGeolocationPermission(true);
    testRunner.setMockGeolocationPosition(51.478, -0.166, 100);
}

function onFirstIframeLoaded() {
    iframeGeolocation = iframe.contentWindow.navigator.geolocation;
    iframe.src = 'resources/disconnected-frame-already-inner2.html';
}

window.successCallbackInvoked = false;
function onSecondIframeLoaded() {
    iframeGeolocation.getCurrentPosition(function () {
        window.successCallbackInvoked = true;
    }, function(e) {
        window.positionError = e;
    });
    setTimeout(finishTest, 1000);
}

function finishTest() {
    debug('Method called on Geolocation object with disconnected Frame.');
    shouldBe("successCallbackInvoked", "false");
    shouldBe("positionError.code", "GeolocationPositionError.POSITION_UNAVAILABLE");
    shouldBe("positionError.message", "'Document is not fully active'");
    finishJSTest();
}

var iframe = document.createElement('iframe');
iframe.src = 'resources/disconnected-frame-already-inner1.html';
document.body.appendChild(iframe);

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