summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js
blob: b27df61abab88bfcee1cc5323213ca7b3e7ec456 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
description("Tests the assertion that the GeolocationClient should not be updating<br>" +
            "when the GeolocationController is destroyed.<br>" +
            "See https://bugs.webkit.org/show_bug.cgi?id=52216");

var otherWindow;

if (window.layoutTestController) {
    layoutTestController.waitUntilDone();
    layoutTestController.setCanOpenWindows();
    layoutTestController.setCloseRemainingWindowsWhenComplete(true);
} else
    testFailed('This test can not be run without the LayoutTestController');

function gotPosition(p)
{
    testPassed("Received Geoposition.");
    otherWindow.close();
    window.setTimeout(waitForWindowToClose, 0);
}

function waitForWindowToClose()
{
    if (!otherWindow.closed) {
        window.setTimeout(waitForWindowToClose, 0);
        return;
    }
    testPassed("Success - no crash!");
    finishJSTest();
}

function failedToCreateWatch(e)
{
    testFailed("Failed to create watch: " + e);
    finishJSTest();
}

debug("Main page opening resources/window-close-popup.html");
otherWindow = window.open("resources/window-close-popup.html");

window.jsTestIsAsync = true;
window.successfullyParsed = true;