mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02:00
Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.imageData.get.order.cols</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
<link rel="stylesheet" href="/common/canvas-tests.css">
|
||||
<body class="show_output">
|
||||
|
||||
<h1>2d.imageData.get.order.cols</h1>
|
||||
<p class="desc">getImageData() returns leftmost columns first</p>
|
||||
|
||||
|
||||
<p class="output">Actual output:</p>
|
||||
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
|
||||
<ul id="d"></ul>
|
||||
<script>
|
||||
var t = async_test("getImageData() returns leftmost columns first");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#fff';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#000';
|
||||
ctx.fillRect(0, 0, 2, 50);
|
||||
var imgdata = ctx.getImageData(0, 0, 10, 10);
|
||||
_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0");
|
||||
_assertSame(imgdata.data[Math.round(imgdata.width/2*4)], 255, "imgdata.data[Math.round(imgdata.width/2*4)]", "255");
|
||||
_assertSame(imgdata.data[Math.round((imgdata.height/2)*imgdata.width*4)], 0, "imgdata.data[Math.round((imgdata.height/2)*imgdata.width*4)]", "0");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user