Commit 685a1df9 authored by Miguel Casas-Sanchez's avatar Miguel Casas-Sanchez Committed by Commit Bot

Extend canvas getContextAttributes WPTest

This CL extend the WPTest for Canvas getContextAttributes to include
the |desynchronized|.

This CL covers the flag WPT test extension mentioned in
https://github.com/whatwg/html/pull/4360 (which addressed
https://github.com/whatwg/html/issues/4087).

Bug: 944199, 945835
Change-Id: Ibb339c66014d7579023f75c7f2cef99e3f03d351
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538491Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644332}
parent e269b627
...@@ -19,7 +19,7 @@ CanvasContextCreationAttributesCore ToCanvasContextCreationAttributes( ...@@ -19,7 +19,7 @@ CanvasContextCreationAttributesCore ToCanvasContextCreationAttributes(
result.fail_if_major_performance_caveat = result.fail_if_major_performance_caveat =
attrs->failIfMajorPerformanceCaveat(); attrs->failIfMajorPerformanceCaveat();
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// TODO(crbug.com/922218): enable desynchronized on Mac. // TODO(crbug.com/945835): enable desynchronized on Mac.
result.desynchronized = false; result.desynchronized = false;
#else #else
result.desynchronized = attrs->desynchronized(); result.desynchronized = attrs->desynchronized();
......
...@@ -6,13 +6,16 @@ ...@@ -6,13 +6,16 @@
var testScenarios = [ var testScenarios = [
{testDescription: "Test default context creation attributes", {testDescription: "Test default context creation attributes",
canvasContextAttributes: {}, canvasContextAttributes: {},
expectedContextAttributes: {alpha : true}}, expectedContextAttributes: {alpha : true, desynchronized: false}},
{testDescription: "Test context creation attributes alpha: true", {testDescription: "Test context creation attributes alpha: true",
canvasContextAttributes: {alpha: true}, canvasContextAttributes: {alpha: true},
expectedContextAttributes: {alpha : true}}, expectedContextAttributes: {alpha : true}},
{testDescription: "Test context creation attributes alpha: false", {testDescription: "Test context creation attributes alpha: false",
canvasContextAttributes: {alpha: false}, canvasContextAttributes: {alpha: false},
expectedContextAttributes: {alpha : false}}, expectedContextAttributes: {alpha : false}},
{testDescription: "Test context creation attributes desynchronized: false",
canvasContextAttributes: {desynchronized: false},
expectedContextAttributes: {desynchronized : false}},
]; ];
function runTestScenario(testScenario) { function runTestScenario(testScenario) {
...@@ -20,8 +23,14 @@ function runTestScenario(testScenario) { ...@@ -20,8 +23,14 @@ function runTestScenario(testScenario) {
var canvas = document. createElement('canvas'); var canvas = document. createElement('canvas');
var ctx = canvas.getContext('2d', testScenario.canvasContextAttributes); var ctx = canvas.getContext('2d', testScenario.canvasContextAttributes);
var contextAttributes = ctx.getContextAttributes(); var contextAttributes = ctx.getContextAttributes();
assert_equals(contextAttributes.alpha, if (testScenario.expectedContextAttributes.alpha !== undefined) {
testScenario.expectedContextAttributes.alpha); assert_equals(contextAttributes.alpha,
testScenario.expectedContextAttributes.alpha);
}
if (testScenario.expectedContextAttributes.desynchronized !== undefined) {
assert_equals(contextAttributes.desynchronized,
testScenario.expectedContextAttributes.desynchronized);
}
}, testScenario.testDescription); }, testScenario.testDescription);
} }
......
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