Skip to content

Commit

Permalink
Clean up ImageBitmapRenderingContext tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xidachen committed Nov 14, 2016
1 parent f562f36 commit 47e0eb9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

createImageBitmap(myCanvas).then(t.step_func_done(function(imageBitmap) {
// Per spec, when transferFromImageBitmap happens, the transferred
// ImageBitmap (|image| here) should be the intrinsic size of
// ImageBitmap (|image| here) must determine the intrinsic size of
// myCanvas, and hence myCanvas.width/height is ignored. Therefore,
// this created |imageBitmap| should have the same size as the |image|.
// |imageBitmap| should have the same size as the |image|.
assert_equals(imageBitmap.width, width);
assert_equals(imageBitmap.height, height);

Expand Down
6 changes: 3 additions & 3 deletions imagebitmap-renderingcontext/context-creation-with-alpha.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
var ctx = srcCanvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, width, height);
createImageBitmap(srcCanvas).then(function(image) {
return createImageBitmap(srcCanvas).then(function(image) {
consumeImageBitmap(image, 'false', 0, 127, 0, 255);
});
}, "Test that an ImageBitmapRenderingContext with alpha disabled makes the canvas opaque");
Expand All @@ -55,7 +55,7 @@
var ctx = srcCanvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, width, height);
createImageBitmap(srcCanvas).then(function(image) {
return createImageBitmap(srcCanvas).then(function(image) {
consumeImageBitmap(image, 'true', 0, 255, 0, 127);
});
}, "Test that an ImageBitmapRenderingContext with alpha enabled preserves the alpha");
Expand All @@ -67,7 +67,7 @@
var ctx = srcCanvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, width, height);
createImageBitmap(srcCanvas).then(function(image) {
return createImageBitmap(srcCanvas).then(function(image) {
consumeImageBitmap(image, '', 0, 255, 0, 127);
});
}, "Test that the 'alpha' context creation attribute is true by default");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
var ctx = srcCanvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, width, height);
createImageBitmap(srcCanvas).then(testException);
return createImageBitmap(srcCanvas).then(testException);
}, "Test transferFromImageBitmap(image) with a detached image should throw InvalidStateError");

</script>

0 comments on commit 47e0eb9

Please sign in to comment.