Skip to content

Commit

Permalink
Bug 1539650 [wpt PR 16084] - Extend canvas getContextAttributes WPTes…
Browse files Browse the repository at this point in the history
…t, a=testonly

Automatic update from web-platform-tests
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
whatwg/html#4360 (which addressed
whatwg/html#4087).

Bug: 944199, 945835
Change-Id: Ibb339c66014d7579023f75c7f2cef99e3f03d351
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538491
Reviewed-by: Fernando Serboncini <fserb@chromium.org>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644332}

--

wpt-commits: c3f8e5c0bb15e7d7f57dbe60f6869caa0c4ad2e7
wpt-pr: 16084
  • Loading branch information
yell0wd0g authored and jgraham committed Apr 24, 2019
1 parent 6fbb1a5 commit 3d63bb6
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,31 @@
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) {
var t = test(function() {
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);
}

Expand Down

0 comments on commit 3d63bb6

Please sign in to comment.