window-domurl-crash.html 1.24 KB
Newer Older
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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
<html>
<head>
<script>
var blob = (new BlobBuilder).getBlob();
var url = null;
var count = 0;

if (!window.gc)
{
    window.gc = function()
    {
        if (window.GCController)
            return GCController.collect();
        for (var i = 0; i < 10000; i++)
            var s = new String("abc");
    }
}

function load()
{
    if (window.layoutTestController)
    {
        layoutTestController.dumpAsText();
        layoutTestController.setCanOpenWindows();
        layoutTestController.setCloseRemainingWindowsWhenComplete(true);
        layoutTestController.waitUntilDone();
    }
    win = window.open();
    if (win.webkitURL)
    {
        url = win.webkitURL;
        win.location = "nothing";
        setTimeout(crash, 0);
        return;
    }
    document.body.innerHTML = "PASS";
    if (window.layoutTestController)
        layoutTestController.notifyDone();
}

function crash()
{
    gc();
    url.createObjectURL(blob);
    if (count++ < 5)
    {
        setTimeout(crash, 0);
        return;
    }
    document.body.innerHTML = "PASS";
    if (window.layoutTestController)
        layoutTestController.notifyDone();
}
</script>
</head>
<body onload="load()">
RUNNING...
</body>
</html>