| Index: content/test/data/gpu/pixel_webgl2_util.js
|
| diff --git a/content/test/data/gpu/pixel_webgl2_util.js b/content/test/data/gpu/pixel_webgl2_util.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..82f38033f8cfa92c3e0e0a924531a105a4f9fae9
|
| --- /dev/null
|
| +++ b/content/test/data/gpu/pixel_webgl2_util.js
|
| @@ -0,0 +1,34 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +//
|
| +// READ BEFORE UPDATING:
|
| +// If this file is updated, make sure to increment the "revision" value of any
|
| +// tests that use this file in content/test/gpu/page_sets/pixel_tests.py. This
|
| +// will ensure that the baseline images are regenerated on the next run.
|
| +
|
| +var g_swapsBeforeAckUtil = 15;
|
| +
|
| +// TODO(kbr): We should test premultiplyAlpha as well.
|
| +function initGL(canvas, antialias, alpha)
|
| +{
|
| + var gl = null;
|
| + try {
|
| + gl = canvas.getContext("webgl2",
|
| + {"alpha": alpha, "antialias":antialias});
|
| + } catch (e) {}
|
| + return gl;
|
| +}
|
| +
|
| +function waitAndSignalHarness()
|
| +{
|
| + if (g_swapsBeforeAckUtil == 0) {
|
| + if (window.domAutomationController) {
|
| + domAutomationController.setAutomationId(1);
|
| + domAutomationController.send("SUCCESS");
|
| + }
|
| + } else {
|
| + g_swapsBeforeAckUtil--;
|
| + requestAnimationFrame(waitAndSignalHarness);
|
| + }
|
| +}
|
|
|