Skip to content

Commit

Permalink
WIP Canvas 2D/WebGL context: s/lowLatency/desynchronized/
Browse files Browse the repository at this point in the history
This CL renames s/lowLatency/desynchronized/ on web-exposed parts
(s/low_latency/desynchronized/ internally) following [1,2] PRs
(issue [3]), and extends wpt getContextAttributes.html.

[1] whatwg/html#4360
[2] KhronosGroup/WebGL#2753
[3] whatwg/html#4087

Bug: 944199
Change-Id: Ic9d7bd6165f9dc9536613dc63e77b86b8ec42f7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1532920
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#643323}
  • Loading branch information
yell0wd0g authored and chromium-wpt-export-bot committed Mar 22, 2019
1 parent 2309f22 commit 2f71600
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions 2dcontext/context-attributes/getContextAttributes.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,34 @@
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: true",
canvasContextAttributes: {desynchronized: true},
expectedContextAttributes: {desynchronized : true}},
{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 2f71600

Please sign in to comment.