Bug 1539650 [wpt PR 16084] - Extend canvas getContextAttributes WPTest, a=testonly
authorMiguel Casas-Sanchez <mcasas@chromium.org>
Thu, 18 Apr 2019 11:58:01 +0000
changeset 529960 1c1904072b0147267351bba8d5eafee1ffad8d56
parent 529959 b31d9e60ef5ec0a11416268edd6ce93f595713cb
child 529961 10dec3e7410ab21868d7accf4a62152e65462e62
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1539650, 16084, 944199, 945835, 1538491, 644332
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1539650 [wpt PR 16084] - Extend canvas getContextAttributes WPTest, 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 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/+/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
testing/web-platform/tests/2dcontext/context-attributes/getContextAttributes.html
--- a/testing/web-platform/tests/2dcontext/context-attributes/getContextAttributes.html
+++ b/testing/web-platform/tests/2dcontext/context-attributes/getContextAttributes.html
@@ -1,32 +1,41 @@
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 
 <script>
 
 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);
 }
 
 function runAllTests() {
     for (var i = 0; i < testScenarios.length; i++)
         runTestScenario(testScenarios[i]);
 }