summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/canvas/webgl/context-destroyed-crash.html
blob: 1ec8c42144af7b2a6bfbe9d271eaaebc1d1c3944 (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
42
43
44
<html>
<head>
<script src="resources/webgl-test.js"></script>
</head>
<body>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

function gc()
{
    if (window.GCController)
        return GCController.collect();

    for (var i = 0; i < 10000; ++i)
        var s = new String("AAAA");
}

window.onload = function()
{
    canvas = document.createElement("canvas");
    context = create3DContext(canvas);
    extension = context.getExtension("WEBGL_lose_context");
    
    canvas = null;
    context = null;
    gc();
    
    setTimeout(finishTest, 1);
}

function finishTest()
{
    extension.loseContext();
    
    document.body.innerHTML = "PASS";
    if (window.testRunner)
        testRunner.notifyDone();
}
</script>
</body>
</html>