| Index: tools/perf/page_sets/tough_animation_cases/resources/web_animations_api_check.js
|
| diff --git a/tools/perf/page_sets/tough_animation_cases/resources/web_animations_api_check.js b/tools/perf/page_sets/tough_animation_cases/resources/web_animations_api_check.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..95fa271aefd747644deca5797b47ae2ca241a6ed
|
| --- /dev/null
|
| +++ b/tools/perf/page_sets/tough_animation_cases/resources/web_animations_api_check.js
|
| @@ -0,0 +1,21 @@
|
| +// Copyright 2014 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.
|
| +if (!Element.prototype.animate) {
|
| + Element.prototype.animate = function() {
|
| + return {
|
| + pause: function() {},
|
| + };
|
| + };
|
| + // Generate a dummy animation when Web Animations is not present.
|
| + // This is to ensure frames are generated so telemetry does not see this as a
|
| + // test failure and turn the perf tree red.
|
| + requestAnimationFrame(function() {
|
| + document.body.style.visibility = 'hidden';
|
| + document.documentElement.style.transition = '1s';
|
| + requestAnimationFrame(function() {
|
| + document.documentElement.style.background = 'red';
|
| + });
|
| + });
|
| + window.measurementReady = true;
|
| +}
|
|
|