Commit 0c4a354e authored by Reza.Zakerinasab's avatar Reza.Zakerinasab Committed by Commit Bot

Fix flaky ImageBitmap resize layout tests

ImageBitmap resize layout tests write an extensive amount of debug
information to the console, as requested by Skia team. Apparently
sometimes the test finishes before all the degug info are printed
to the console, causing the tests to be flaky on try bots. This
CL hides the debug info behind a test option, so they can be printed
only if necessary.

Bug: 829953
Change-Id: I32955d2b49074cdf68ab7e59766d91fc560286cf
Reviewed-on: https://chromium-review.googlesource.com/1026200Reviewed-by: default avatarJustin Novosad <junov@chromium.org>
Commit-Queue: Mohammad Reza Zakerinasab <zakerinasab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553631}
parent 37272e4c
...@@ -247,6 +247,7 @@ function DrawResultsOnCanvas(testOptions) { ...@@ -247,6 +247,7 @@ function DrawResultsOnCanvas(testOptions) {
var x = (tileCounter * testOptions.resizeWidth) % width; var x = (tileCounter * testOptions.resizeWidth) % width;
var y = Math.floor(tileCounter / numTiles) * var y = Math.floor(tileCounter / numTiles) *
testOptions.resizeHeight; testOptions.resizeHeight;
if (testOptions.printDebugInfoToConsole)
PrintTileInfoForDebug(x, y, pixelsBuffer[j].quality, PrintTileInfoForDebug(x, y, pixelsBuffer[j].quality,
pixelsBuffer[j].premultiply, pixelsBuffer[j].flip); pixelsBuffer[j].premultiply, pixelsBuffer[j].flip);
tileCounter++; tileCounter++;
......
...@@ -15,7 +15,8 @@ canvas.height = 400; ...@@ -15,7 +15,8 @@ canvas.height = 400;
document.body.appendChild(canvas); document.body.appendChild(canvas);
var testOptions = {sourceName: "Blob", sourceIsPremul: true, resizeWidth: 16, var testOptions = {sourceName: "Blob", sourceIsPremul: true, resizeWidth: 16,
resizeHeight: 16, resultsCanvas: canvas}; resizeHeight: 16, resultsCanvas: canvas,
printDebugInfoToConsole: false};
prepareWebGLContext(testOptions); prepareWebGLContext(testOptions);
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
......
...@@ -36,7 +36,7 @@ canvas.height = 400; ...@@ -36,7 +36,7 @@ canvas.height = 400;
document.body.appendChild(canvas); document.body.appendChild(canvas);
var testOptions = {sourceName: "HTMLCanvasElement", imageSource: testCanvas, var testOptions = {sourceName: "HTMLCanvasElement", imageSource: testCanvas,
sourceIsPremul: true, resizeWidth: 16, resizeHeight: 16, sourceIsPremul: true, resizeWidth: 16, resizeHeight: 16,
resultsCanvas: canvas}; resultsCanvas: canvas, printDebugInfoToConsole: false};
prepareWebGLContext(testOptions); prepareWebGLContext(testOptions);
prepareResizedImageBitmapsAndRuntTests(testOptions); prepareResizedImageBitmapsAndRuntTests(testOptions);
......
...@@ -17,7 +17,7 @@ document.body.appendChild(canvas); ...@@ -17,7 +17,7 @@ document.body.appendChild(canvas);
var testOptions = {sourceName: "HTMLImageElement", imageSource: image, var testOptions = {sourceName: "HTMLImageElement", imageSource: image,
sourceIsPremul: true, resizeWidth: 16, resizeHeight: 16, sourceIsPremul: true, resizeWidth: 16, resizeHeight: 16,
resultsCanvas: canvas}; resultsCanvas: canvas, printDebugInfoToConsole: false};
prepareWebGLContext(testOptions); prepareWebGLContext(testOptions);
image.onload = function() { image.onload = function() {
......
...@@ -24,7 +24,8 @@ var imageData = new ImageData(new Uint8ClampedArray( ...@@ -24,7 +24,8 @@ var imageData = new ImageData(new Uint8ClampedArray(
var testOptions = {sourceName: "ImageData", var testOptions = {sourceName: "ImageData",
imageSource: imageData, sourceIsPremul: false, imageSource: imageData, sourceIsPremul: false,
resizeWidth: 16, resizeHeight: 16, resizeWidth: 16, resizeHeight: 16,
resultsCanvas: canvas}; resultsCanvas: canvas,
printDebugInfoToConsole: false};
prepareWebGLContext(testOptions); prepareWebGLContext(testOptions);
prepareResizedImageBitmapsAndRuntTests(testOptions); prepareResizedImageBitmapsAndRuntTests(testOptions);
</script> </script>
\ No newline at end of file
...@@ -37,7 +37,7 @@ canvas.height = 400; ...@@ -37,7 +37,7 @@ canvas.height = 400;
document.body.appendChild(canvas); document.body.appendChild(canvas);
var testOptions = {sourceName: "OffscreenCanvas", imageSource: offscreen, var testOptions = {sourceName: "OffscreenCanvas", imageSource: offscreen,
sourceIsPremul: true, resizeWidth: 16, resizeHeight: 16, sourceIsPremul: true, resizeWidth: 16, resizeHeight: 16,
resultsCanvas: canvas}; resultsCanvas: canvas, printDebugInfoToConsole: false};
prepareWebGLContext(testOptions); prepareWebGLContext(testOptions);
prepareResizedImageBitmapsAndRuntTests(testOptions); prepareResizedImageBitmapsAndRuntTests(testOptions);
......
...@@ -17,7 +17,7 @@ document.body.appendChild(canvas); ...@@ -17,7 +17,7 @@ document.body.appendChild(canvas);
var testOptions = {sourceName: "HTMLVideoElement", imageSource: video, var testOptions = {sourceName: "HTMLVideoElement", imageSource: video,
sourceIsPremul: true, resizeWidth: 16, resizeHeight: 16, sourceIsPremul: true, resizeWidth: 16, resizeHeight: 16,
resultsCanvas: canvas}; resultsCanvas: canvas, printDebugInfoToConsole: false};
prepareWebGLContext(testOptions); prepareWebGLContext(testOptions);
video.oncanplaythrough = function() { video.oncanplaythrough = function() {
......
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