Update web-platform-tests to revision 3bfdeb8976fc51748935c8d1f1014dfba8e08dfb

This commit is contained in:
WPT Sync Bot 2019-03-28 22:09:18 -04:00
parent fcd6beb608
commit cb63cfd5c7
185 changed files with 3083 additions and 1074 deletions

View file

@ -6,13 +6,16 @@
var testScenarios = [
{testDescription: "Test default context creation attributes",
canvasContextAttributes: {},
expectedContextAttributes: {alpha : true}},
expectedContextAttributes: {alpha : true, desynchronized: false}},
{testDescription: "Test context creation attributes alpha: true",
canvasContextAttributes: {alpha: true},
expectedContextAttributes: {alpha : true}},
{testDescription: "Test context creation attributes alpha: false",
canvasContextAttributes: {alpha: false},
expectedContextAttributes: {alpha : false}},
{testDescription: "Test context creation attributes desynchronized: false",
canvasContextAttributes: {desynchronized: false},
expectedContextAttributes: {desynchronized : false}},
];
function runTestScenario(testScenario) {
@ -20,8 +23,14 @@ function runTestScenario(testScenario) {
var canvas = document. createElement('canvas');
var ctx = canvas.getContext('2d', testScenario.canvasContextAttributes);
var contextAttributes = ctx.getContextAttributes();
assert_equals(contextAttributes.alpha,
testScenario.expectedContextAttributes.alpha);
if (testScenario.expectedContextAttributes.alpha !== undefined) {
assert_equals(contextAttributes.alpha,
testScenario.expectedContextAttributes.alpha);
}
if (testScenario.expectedContextAttributes.desynchronized !== undefined) {
assert_equals(contextAttributes.desynchronized,
testScenario.expectedContextAttributes.desynchronized);
}
}, testScenario.testDescription);
}