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

Unified Diff: tools/perf/page_sets/perf_week/web-animations-many-keyframes.html

Issue 402433004: Test adding perf week tests as smoothness benchmark (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: g cl issue Created 6 years, 5 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/perf_week/web-animations-many-keyframes.html
diff --git a/tools/perf/page_sets/perf_week/web-animations-many-keyframes.html b/tools/perf/page_sets/perf_week/web-animations-many-keyframes.html
new file mode 100644
index 0000000000000000000000000000000000000000..396460d99460cad434cb2c6ca3d7c63f7c4c03f5
--- /dev/null
+++ b/tools/perf/page_sets/perf_week/web-animations-many-keyframes.html
@@ -0,0 +1,51 @@
+<!doctype html>
+<meta name="viewport" content="width=device-width, user-scalable=no">
+<container id="container"></container>
+<script>
+var N = 400;
+var numKeyframes = 500;
+var duration = 4000;
+
+function makeKeyframes(numKeyframes, width, height) {
+ var keyframes = [];
+ for (var i = 0; i < numKeyframes + 1; i++) {
+ var fraction = i / numKeyframes;
+ var t = fraction * 2 * Math.PI;
+ var x = Math.cos(t) - Math.pow(Math.cos(4*t), 3);
+ x = ((x/4 + 1/2) * width).toFixed(5);
+ var y = Math.pow(Math.sin(4*t), 3) - Math.sin(2*t);
+ y = ((y/4 + 1/2) * height).toFixed(5);
+ keyframes.push({transform: 'translate(' + x + 'px, ' + y + 'px)'});
+ }
+ return keyframes;
+}
+
+var keyframes = makeKeyframes(numKeyframes, 550, 800);
+for (var i = 0; i < N; i++) {
+ var target = document.createElement('target');
+ container.appendChild(target);
+ target.animate(keyframes, {duration: duration, iterations: Infinity, delay: -duration/10 * i/N});
+}
+
+requestAnimationFrame(function() {
+ measurementReady = true;
+});
+</script>
+
+<style>
+body {
+ margin: 0;
+ overflow: hidden;
+}
+target {
+ position: absolute;
+ border: 5px solid green;
+ border-radius: 100%;
+}
+container {
+ position: absolute;
+ width: 550px;
+ height: 800px;
+ background-color: lightgrey;
+}
+</style>

Powered by Google App Engine
This is Rietveld 408576698