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

Unified Diff: tools/perf/page_sets/tough_animation_cases/web_animations_staggered_infinite_iterations.html

Issue 664323002: Add Web Animations performance tests - trybot-android-nexus5 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/web_animations_staggered_infinite_iterations.html
diff --git a/tools/perf/page_sets/tough_animation_cases/css_transitions_simultaneous_by_updating_inline_style.html b/tools/perf/page_sets/tough_animation_cases/web_animations_staggered_infinite_iterations.html
similarity index 55%
copy from tools/perf/page_sets/tough_animation_cases/css_transitions_simultaneous_by_updating_inline_style.html
copy to tools/perf/page_sets/tough_animation_cases/web_animations_staggered_infinite_iterations.html
index 86c73b411f4e844930a115aad2fd1874a62aa1a4..147b53597e0f9f8af887105b569f142845f44b39 100644
--- a/tools/perf/page_sets/tough_animation_cases/css_transitions_simultaneous_by_updating_inline_style.html
+++ b/tools/perf/page_sets/tough_animation_cases/web_animations_staggered_infinite_iterations.html
@@ -1,33 +1,31 @@
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, user-scalable=no">
<link rel="stylesheet" type="text/css" href="resources/tablet.css">
-<link rel="stylesheet" type="text/css" href="resources/transition.css">
<script src="resources/perftesthelper.js"></script>
+<script src="resources/web_animations_api_check.js"></script>
<container id="container"></container>
<script>
var N = PerfTestHelper.getN(1000);
var duration = 1000;
-var targets = [];
-var keyframe = 1;
-var keyframeValues = [0, 1]
+
+function startAnimation(element, delay) {
+ target.animate([
+ {opacity: 0},
+ {opacity: 1},
+ ], {
+ duration: duration,
+ iterations: Infinity,
+ delay: delay,
+ });
+}
for (var i = 0; i < N; i++) {
var target = document.createElement('target');
container.appendChild(target);
- targets.push(target);
+ startAnimation(target, i * (duration / N) - duration);
}
-function startAllTransitions() {
- keyframe ^= 1;
- targets.forEach(function(target) {
- target.style.opacity = keyframeValues[keyframe];
- });
-}
-
-requestAnimationFrame(startAllTransitions);
-setInterval(startAllTransitions, duration);
-
PerfTestHelper.signalReady();
</script>

Powered by Google App Engine
This is Rietveld 408576698