mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-30 14:17:36 -10:00
28 lines
924 B
HTML
28 lines
924 B
HTML
<!DOCTYPE html>
|
|
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
|
<title>OffscreenCanvas test: 2d.imageData.get.tiny</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/common/canvas-tests.js"></script>
|
|
|
|
<h1>2d.imageData.get.tiny</h1>
|
|
<p class="desc">getImageData() works for sizes smaller than one pixel</p>
|
|
|
|
|
|
<script>
|
|
var t = async_test("getImageData() works for sizes smaller than one pixel");
|
|
t.step(function() {
|
|
|
|
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
|
var ctx = offscreenCanvas.getContext('2d');
|
|
|
|
var imgdata = ctx.getImageData(0, 0, 0.0001, 0.0001);
|
|
_assertSame(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4");
|
|
_assertSame(imgdata.width, 1, "imgdata.width", "1");
|
|
_assertSame(imgdata.height, 1, "imgdata.height", "1");
|
|
|
|
t.done();
|
|
|
|
});
|
|
</script>
|