Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Unified Diff: tools/perf/page_sets/tough_animation_cases/resources/web_animations_api_check.js

Issue 665893005: Add Web Animations performance tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@+bigAnimationPerfTests
Patch Set: Rebase onto master Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
+}

Powered by Google App Engine
This is Rietveld 408576698