Commit 407ec471 authored by Wan-Teh Chang's avatar Wan-Teh Chang Committed by Commit Bot

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/+/2305216Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Cr-Commit-Position: refs/heads/master@{#790206}
parent 9b369b62
...@@ -298,7 +298,7 @@ promise_test(function() { ...@@ -298,7 +298,7 @@ promise_test(function() {
GIF, ICO, JPG, PNG, WEBP) with resize.'); GIF, ICO, JPG, PNG, WEBP) with resize.');
// HTMLImageElement - Transparent sRGB // HTMLImageElement - Transparent sRGB
// File formats: Bitmap, GIF, ICO, PNG, WEBP // File formats: Bitmap, ICO, PNG, WEBP
promise_test(function() { promise_test(function() {
return Promise.all(['bmp', 'ico', 'png', 'webp'].map( return Promise.all(['bmp', 'ico', 'png', 'webp'].map(
ext => new Promise((resolve,reject) => { ext => new Promise((resolve,reject) => {
...@@ -369,30 +369,36 @@ promise_test(function() { ...@@ -369,30 +369,36 @@ promise_test(function() {
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// Blob from file - Opaque sRGB // Blob from file - Opaque sRGB
// File formats: Bitmap, GIF, ICO, JPEG, PNG, WEBP
promise_test(function() { promise_test(function() {
return new Promise((resolve, reject) => { return Promise.all(['bmp', 'gif', 'ico', 'jpg', 'png', 'webp'].map(
var xhr = new XMLHttpRequest(); ext => new Promise((resolve, reject) => {
xhr.open("GET", 'resources/pattern-srgb.png'); var xhr = new XMLHttpRequest();
xhr.responseType = 'blob'; xhr.open("GET", 'resources/pattern-srgb.' + ext);
xhr.send(); xhr.responseType = 'blob';
xhr.onload = function() { xhr.send();
resolve(xhr.response); xhr.onload = function() {
}; resolve(xhr.response);
}).then(testImageBitmapOpaque); };
}, 'createImageBitmap in e-sRGB from an opaque sRGB Blob with resize.'); }).then(testImageBitmapOpaque)));
}, 'createImageBitmap in e-sRGB from an opaque sRGB Blob (BMP, GIF, ICO, JPG, \
PNG, WEBP) with resize.');
// Blob form file - Transparent sRGB // Blob form file - Transparent sRGB
// File formats: Bitmap, ICO, PNG, WEBP
promise_test(function() { promise_test(function() {
return new Promise((resolve, reject) => { return Promise.all(['bmp', 'ico', 'png', 'webp'].map(
var xhr = new XMLHttpRequest(); ext => new Promise((resolve, reject) => {
xhr.open("GET", 'resources/pattern-srgb-transparent.png'); var xhr = new XMLHttpRequest();
xhr.responseType = 'blob'; xhr.open("GET", 'resources/pattern-srgb-transparent.' + ext);
xhr.send(); xhr.responseType = 'blob';
xhr.onload = function() { xhr.send();
resolve(xhr.response); xhr.onload = function() {
}; resolve(xhr.response);
}).then(testImageBitmapFromTransparentImage); };
}, 'createImageBitmap in e-sRGB from a transparent sRGB Blob with resize.'); }).then(testImageBitmapFromTransparentImage)));
}, 'createImageBitmap in e-sRGB from a transparent sRGB Blob (BMP, ICO, PNG, \
WEBP) with resize.');
// Color managed blob from canvas // Color managed blob from canvas
function testCreateImageBitmapFromColorManagedBlob(pixelFormat, isTransparent) { function testCreateImageBitmapFromColorManagedBlob(pixelFormat, isTransparent) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment