Index: PerformanceTests/Layout/grid-add-auto-positioned-items.html |
diff --git a/PerformanceTests/Layout/grid-add-auto-positioned-items.html b/PerformanceTests/Layout/grid-add-auto-positioned-items.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c4abb6186580673158785c7eda6bc0871288226a |
--- /dev/null |
+++ b/PerformanceTests/Layout/grid-add-auto-positioned-items.html |
@@ -0,0 +1,47 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<style> |
+ #log { |
+ position: fixed; |
+ } |
+</style> |
+<script src="../resources/runner.js"></script> |
+<body> |
+ <pre id="log"></pre> |
+ <script> |
+ function addGridItems(grid, tracksCount) { |
+ for (row = 1; row <= tracksCount; row++) { |
+ for (column = 1; column <= tracksCount; column++) { |
+ var item = document.createElement("div"); |
+ item.innerHTML = "auto"; |
+ grid.appendChild(item); |
+ } |
+ } |
+ } |
+ |
+ function createGridTest(tracksCount) { |
+ var grid = document.createElement("div"); |
+ grid.style.display = "grid"; |
+ grid.style.gridTemplateColumns = "repeat(" + tracksCount + ", 50px)"; |
+ grid.style.gridTemplateRows = "repeat(" + tracksCount + ", 50px)"; |
+ document.body.appendChild(grid); |
+ |
+ return { |
+ description: "Testing addition of auto-positioned items on a " + tracksCount + "x" + tracksCount + " grid.", |
+ run: function() { |
+ addGridItems(grid, tracksCount); |
+ }, |
+ setup: function() { |
+ grid.innerHTML = ""; |
+ }, |
+ done: function() { |
+ document.body.removeChild(grid); |
+ } |
+ }; |
+ } |
+ |
+ PerfTestRunner.measureTime(createGridTest(100)); |
Julien - ping for review
2015/01/05 13:11:34
It's better to measure runs/sec instead of time. T
|
+ </script> |
+</body> |
+</html> |