Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html

Issue 290143007: canvas.getContext with alpha:undefined should behave like alpha:true (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: test expectations Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html
diff --git a/LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html b/LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html
index 1d97dfafffea6b47508cfeaad2040abd2bec4e4a..538f0defa531d4fff360cc197ca7b1e826d72b28 100644
--- a/LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html
+++ b/LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html
@@ -143,12 +143,13 @@ function testDefault()
function testAlpha(alpha)
{
debug("Testing alpha = " + alpha);
- if (alpha) {
- shouldBeNonNull("gl = getWebGL(1, 1, { alpha: true, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
- shouldBeTrue("gl.getParameter(gl.ALPHA_BITS) >= 8");
- } else {
+ if (alpha == false) {
shouldBeNonNull("gl = getWebGL(1, 1, { alpha: false, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
shouldBeTrue("gl.getParameter(gl.ALPHA_BITS) == 0");
+ } else {
+ window.alpha = alpha;
+ shouldBeNonNull("gl = getWebGL(1, 1, { alpha: alpha, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
+ shouldBeTrue("gl.getParameter(gl.ALPHA_BITS) >= 8");
}
shouldBeTrue("gl.getParameter(gl.RED_BITS) >= 8");
shouldBeTrue("gl.getParameter(gl.GREEN_BITS) >= 8");
@@ -157,7 +158,7 @@ function testAlpha(alpha)
shouldBeTrue("gl.getParameter(gl.STENCIL_BITS) == 0");
shouldBeNonNull("contextAttribs = gl.getContextAttributes()");
- shouldBeTrue("contextAttribs.alpha == " + alpha);
+ shouldBeTrue("contextAttribs.alpha == " + (alpha || alpha == undefined || alpha == null ? true : false));
var buf = new Uint8Array(1 * 1 * 4);
gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf);
@@ -338,6 +339,8 @@ function runTest()
testDefault();
testAlpha(true);
testAlpha(false);
+ testAlpha(undefined);
+ testAlpha(null);
testDepth(true);
testDepth(false);
testStencilAndDepth(true, false);

Powered by Google App Engine
This is Rietveld 408576698