summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/canvas/drawImage-with-bad-canvas.html
blob: 9b3042944fd0183795fd41919cff393a6c606822 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test.js"></script>
</head>
<script>
    description("This test checks behavior of drawImage on a canvas that failed to allocate its backing store. This test passes by not crashing.");
    var canvas1 = document.createElement("canvas");
    var ctx1 = canvas1.getContext('2d');
    var canvas2 = document.createElement("canvas");
    // Terapixel canvas should fail to allocate
    canvas2.width = 1000000;
    canvas2.height = 1000000;
    var ctx2 = canvas2.getContext('2d');
    ctx2.drawImage(canvas1, 0, 0);
</script>
</body>
</html>