Skip to content

Commit

Permalink
Bug 1653724 [wpt PR 24652] - Run sRGB Blob tests with multiple image …
Browse files Browse the repository at this point in the history
…formats, a=testonly

Automatic update from web-platform-tests
Run sRGB Blob tests with multiple image formats

Run the sRGB Blob tests with multiple image file formats, not just PNG.

Change-Id: Ie404c85c2267e6f6bea888e205f180bc9c9a11d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2305216
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Cr-Commit-Position: refs/heads/master@{#790206}

--

wpt-commits: d62995e62ca8653b4cf565e61c309471b544fab8
wpt-pr: 24652
  • Loading branch information
wantehchang authored and moz-wptsync-bot committed Jul 24, 2020
1 parent b989625 commit ff42765
Showing 1 changed file with 27 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
GIF, ICO, JPG, PNG, WEBP) with resize.');

// HTMLImageElement - Transparent sRGB
// File formats: Bitmap, GIF, ICO, PNG, WEBP
// File formats: Bitmap, ICO, PNG, WEBP
promise_test(function() {
return Promise.all(['bmp', 'ico', 'png', 'webp'].map(
ext => new Promise((resolve,reject) => {
Expand Down Expand Up @@ -369,30 +369,36 @@
//////////////////////////////////////////////////////////////////////////////

// Blob from file - Opaque sRGB
// File formats: Bitmap, GIF, ICO, JPEG, PNG, WEBP
promise_test(function() {
return new Promise((resolve, reject) => {
var xhr = new XMLHttpRequest();
xhr.open("GET", 'resources/pattern-srgb.png');
xhr.responseType = 'blob';
xhr.send();
xhr.onload = function() {
resolve(xhr.response);
};
}).then(testImageBitmapOpaque);
}, 'createImageBitmap in e-sRGB from an opaque sRGB Blob with resize.');
return Promise.all(['bmp', 'gif', 'ico', 'jpg', 'png', 'webp'].map(
ext => new Promise((resolve, reject) => {
var xhr = new XMLHttpRequest();
xhr.open("GET", 'resources/pattern-srgb.' + ext);
xhr.responseType = 'blob';
xhr.send();
xhr.onload = function() {
resolve(xhr.response);
};
}).then(testImageBitmapOpaque)));
}, 'createImageBitmap in e-sRGB from an opaque sRGB Blob (BMP, GIF, ICO, JPG, \
PNG, WEBP) with resize.');

// Blob form file - Transparent sRGB
// File formats: Bitmap, ICO, PNG, WEBP
promise_test(function() {
return new Promise((resolve, reject) => {
var xhr = new XMLHttpRequest();
xhr.open("GET", 'resources/pattern-srgb-transparent.png');
xhr.responseType = 'blob';
xhr.send();
xhr.onload = function() {
resolve(xhr.response);
};
}).then(testImageBitmapFromTransparentImage);
}, 'createImageBitmap in e-sRGB from a transparent sRGB Blob with resize.');
return Promise.all(['bmp', 'ico', 'png', 'webp'].map(
ext => new Promise((resolve, reject) => {
var xhr = new XMLHttpRequest();
xhr.open("GET", 'resources/pattern-srgb-transparent.' + ext);
xhr.responseType = 'blob';
xhr.send();
xhr.onload = function() {
resolve(xhr.response);
};
}).then(testImageBitmapFromTransparentImage)));
}, 'createImageBitmap in e-sRGB from a transparent sRGB Blob (BMP, ICO, PNG, \
WEBP) with resize.');

// Color managed blob from canvas
function testCreateImageBitmapFromColorManagedBlob(pixelFormat, isTransparent) {
Expand Down

0 comments on commit ff42765

Please sign in to comment.