summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/canvas/canvas-skia-excessive-size.html
blob: 38c3b442c2bd0ef88e4c39249b9f75eeb91c74da (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
<head>
<script>
function print(message)
{
    var paragraph = document.createElement("li");
    paragraph.appendChild(document.createTextNode(message));
    document.getElementById("console").appendChild(paragraph);
}
function test()
{
    if (window.testRunner)
        testRunner.dumpAsText();

    var canvas = document.getElementById("bigCanvas");
    var width = canvas.width;
    // We need to perform a context fetch to force allocation of
    // canvas resources.
    if (canvas.getContext)
    {
      var ctx = canvas.getContext("2d");
      if (ctx == null)
      {
        print("Canvas 2d context = null!");
      }
    }

    print("Survived canvas creation attempt. Width = " + width);
}
</script>
</head>
<body onload="test();">
<canvas id="bigCanvas" width="134217728" height="1"></canvas>
<p>This test checks to see if the browser survives the attempted creation
of an excessively large canvas.</p>
<hr>
<p><ol id=console></ol></p>
</body>