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

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

Issue 666723003: Add CSS 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/css_animations_staggered_chaining_by_inserting_new_element.html
diff --git a/tools/perf/page_sets/tough_animation_cases/css_animations_staggered_chaining_by_inserting_new_element.html b/tools/perf/page_sets/tough_animation_cases/css_animations_staggered_chaining_by_inserting_new_element.html
new file mode 100644
index 0000000000000000000000000000000000000000..fe4f1428bf3b370785c0f1d66f445714eeca285a
--- /dev/null
+++ b/tools/perf/page_sets/tough_animation_cases/css_animations_staggered_chaining_by_inserting_new_element.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<meta name="viewport" content="width=device-width, user-scalable=no">
+<link rel="stylesheet" type="text/css" href="resources/animation.css">
+<link rel="stylesheet" type="text/css" href="resources/tablet.css">
+<script src="resources/perftesthelper.js"></script>
+
+<container id="container"></container>
+
+<script>
+var N = PerfTestHelper.getN(1000);
+var duration = 1000;
+
+function startAnimation() {
+ var target = document.createElement('target');
+ target.i = 1;
+ container.appendChild(target);
+ target.addEventListener('webkitAnimationEnd', function(e) {
+ e.target.remove();
+ startAnimation();
+ });
+}
+
+requestAnimationFrame(function(t) {
+ var base = t;
+ var i = 0;
+
+ function staggeredStart(t) {
+ elapsed = t - base;
+ for (; i < N * elapsed / duration; i++) {
+ startAnimation();
+ }
+ if (i < N) {
+ requestAnimationFrame(staggeredStart);
+ } else {
+ PerfTestHelper.signalReady();
+ }
+ }
+ requestAnimationFrame(staggeredStart);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698