зеркало из https://github.com/mozilla/gecko-dev.git
38 строки
1.2 KiB
HTML
38 строки
1.2 KiB
HTML
<!DOCTYPE HTML>
|
|
<title>Canvas test: 2d.imageData.create.negative - bug 433004</title>
|
|
<!-- Testing: createImageData() takes the absolute magnitude of the size arguments -->
|
|
<script src="/MochiKit/MochiKit.js"></script>
|
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
|
<body>
|
|
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
|
<script>
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
MochiKit.DOM.addLoadEvent(function () {
|
|
|
|
var canvas = document.getElementById('c');
|
|
var ctx = canvas.getContext('2d');
|
|
|
|
var _thrown_outer = false;
|
|
try {
|
|
|
|
var imgdata1 = ctx.createImageData(10, 20);
|
|
var imgdata2 = ctx.createImageData(-10, 20);
|
|
var imgdata3 = ctx.createImageData(10, -20);
|
|
var imgdata4 = ctx.createImageData(-10, -20);
|
|
ok(imgdata1.data.length == imgdata2.data.length, "imgdata1.data.length == imgdata2.data.length");
|
|
ok(imgdata2.data.length == imgdata3.data.length, "imgdata2.data.length == imgdata3.data.length");
|
|
ok(imgdata3.data.length == imgdata4.data.length, "imgdata3.data.length == imgdata4.data.length");
|
|
|
|
} catch (e) {
|
|
_thrown_outer = true;
|
|
}
|
|
todo(!_thrown_outer, 'should not throw exception');
|
|
|
|
SimpleTest.finish();
|
|
|
|
});
|
|
</script>
|
|
|