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

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

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
« no previous file with comments | « tools/perf/page_sets/tough_animation_cases/web_animations_staggered_infinite_iterations.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/tough_animation_cases/web_animations_staggered_triggering.html
diff --git a/tools/perf/page_sets/tough_animation_cases/web_animations_staggered_triggering.html b/tools/perf/page_sets/tough_animation_cases/web_animations_staggered_triggering.html
new file mode 100644
index 0000000000000000000000000000000000000000..52946627386247c53cd86dea0d3dc7535bbe3fa8
--- /dev/null
+++ b/tools/perf/page_sets/tough_animation_cases/web_animations_staggered_triggering.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<meta name="viewport" content="width=device-width, user-scalable=no">
+<link rel="stylesheet" type="text/css" href="resources/tablet.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 = [];
+function startAnimation(i) {
+ if (!targets[i]) {
+ targets[i] = document.createElement('target');
+ container.appendChild(targets[i]);
+ }
+ targets[i].animate([
+ {opacity: 0},
+ {opacity: 1},
+ ], duration);
+}
+
+requestAnimationFrame(function(t) {
+ var base = t;
+ var i = 0;
+
+ requestAnimationFrame(function staggeredStart(t) {
+ var elapsed = t - base;
+ for (; i < N && i < N * elapsed / duration; i++) {
+ startAnimation(i);
+ }
+ if (elapsed > duration) {
+ PerfTestHelper.signalReady();
+ i = 0;
+ base = t - (elapsed % duration);
+ elapsed = 0;
+ }
+ requestAnimationFrame(staggeredStart);
+ });
+});
+</script>
« no previous file with comments | « tools/perf/page_sets/tough_animation_cases/web_animations_staggered_infinite_iterations.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698