summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/PerformanceTests
diff options
context:
space:
mode:
authorXianzhu Wang <wangxianzhu@chromium.org>2015-12-22 22:16:04 -0800
committerXianzhu Wang <wangxianzhu@chromium.org>2015-12-23 06:17:44 +0000
commit5e82369982062eb995fda3ee241a529c0fc50dd0 (patch)
treef87b4dea59c15fa482b4687bb30ed8a0aaf9a117 /third_party/WebKit/PerformanceTests
parentae45ca0c2373fe7dc503c8b42bd6abb50e0ff33f (diff)
downloadchromium_src-5e82369982062eb995fda3ee241a529c0fc50dd0.zip
chromium_src-5e82369982062eb995fda3ee241a529c0fc50dd0.tar.gz
chromium_src-5e82369982062eb995fda3ee241a529c0fc50dd0.tar.bz2
Add PerformanceTests/large-table-background-change-with-visible-collapsed-borders.html
And renamed large-table-background-change-with-collapsed-borders.html to large-table-background-change-with-invisible-collapsed-borders.html This is to test performance of small invalidation in a large table with visible or invisible collapsed borders. Tbr to create baseline performance before the holidays. BUG=34736 TBR=jchaffraix@chromium.org Review URL: https://codereview.chromium.org/1541273003 . Cr-Commit-Position: refs/heads/master@{#366711}
Diffstat (limited to 'third_party/WebKit/PerformanceTests')
-rw-r--r--third_party/WebKit/PerformanceTests/Layout/large-table-background-change-with-invisible-collapsed-borders.html (renamed from third_party/WebKit/PerformanceTests/Layout/large-table-background-change-with-collapsed-borders.html)0
-rw-r--r--third_party/WebKit/PerformanceTests/Layout/large-table-background-change-with-visible-collapsed-borders.html63
2 files changed, 63 insertions, 0 deletions
diff --git a/third_party/WebKit/PerformanceTests/Layout/large-table-background-change-with-collapsed-borders.html b/third_party/WebKit/PerformanceTests/Layout/large-table-background-change-with-invisible-collapsed-borders.html
index 24de45e..24de45e 100644
--- a/third_party/WebKit/PerformanceTests/Layout/large-table-background-change-with-collapsed-borders.html
+++ b/third_party/WebKit/PerformanceTests/Layout/large-table-background-change-with-invisible-collapsed-borders.html
diff --git a/third_party/WebKit/PerformanceTests/Layout/large-table-background-change-with-visible-collapsed-borders.html b/third_party/WebKit/PerformanceTests/Layout/large-table-background-change-with-visible-collapsed-borders.html
new file mode 100644
index 0000000..c3f47f7
--- /dev/null
+++ b/third_party/WebKit/PerformanceTests/Layout/large-table-background-change-with-visible-collapsed-borders.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<script src="../resources/runner.js"></script>
+<pre id="log"></pre>
+<style>td { border: 1px solid blue }</style>
+<script>
+// We discard the first iteration to avoid a cold outlier.
+var iterations = 11;
+var results = [];
+var previousFrameTime = -1;
+var now = function(){
+ return window.performance ? performance.now() : Date.now();
+};
+
+function createTable(rows, columns) {
+ var table = document.createElement("TABLE");
+ // Collapsing border is not necessary to see the slowness
+ // but it makes the painting phase ~2x slower.
+ table.style.borderCollapse = "collapse";
+ for (var i = 0; i < rows; ++i) {
+ var tr = document.createElement("TR");
+ for (var j = 0; j < columns; ++j) {
+ var td = document.createElement("TD");
+ tr.appendChild(td);
+ }
+ table.appendChild(tr);
+ }
+ return table;
+}
+
+
+var table = createTable(300, 320);
+document.body.appendChild(table);
+
+ix=30;
+iy=30;
+
+function toggleBackgroundColor()
+{
+ var thisFrameTime = now();
+ if (previousFrameTime != -1)
+ results.push(thisFrameTime - previousFrameTime);
+ previousFrameTime = thisFrameTime;
+
+ if (iterations == 0) {
+ PerfTestRunner.logStatistics(results, 'ms', "Time:");
+ if (window.testRunner)
+ testRunner.notifyDone();
+ } else {
+ iterations--;
+ window.requestAnimationFrame(toggleBackgroundColor);
+ }
+
+ table.childNodes[iy].childNodes[ix].style.backgroundColor = 'teal';
+ ix++;
+ iy++;
+}
+
+if (window.testRunner)
+ testRunner.waitUntilDone();
+
+// Start the test after two frame to ensure we have set-up, laid out and painted the table.
+window.requestAnimationFrame(function() { window.requestAnimationFrame(toggleBackgroundColor) });
+</script>