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

Unified Diff: third_party/WebKit/PerformanceTests/Paint/large-table-background-change-with-invisible-collapsed-borders.html

Issue 2429623004: Add performance tests for full frame cycle (Closed)
Patch Set: No random Created 4 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: third_party/WebKit/PerformanceTests/Paint/large-table-background-change-with-invisible-collapsed-borders.html
diff --git a/third_party/WebKit/PerformanceTests/Paint/large-table-background-change-with-invisible-collapsed-borders.html b/third_party/WebKit/PerformanceTests/Paint/large-table-background-change-with-invisible-collapsed-borders.html
index 24de45e503b8ff2e8d070a655a4c36908bda5746..160a158926fb68db2414211fb1c448009c178aca 100644
--- a/third_party/WebKit/PerformanceTests/Paint/large-table-background-change-with-invisible-collapsed-borders.html
+++ b/third_party/WebKit/PerformanceTests/Paint/large-table-background-change-with-invisible-collapsed-borders.html
@@ -2,14 +2,6 @@
<script src="../resources/runner.js"></script>
<pre id="log"></pre>
<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
@@ -26,37 +18,18 @@ function createTable(rows, columns) {
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) });
+document.body.insertBefore(table, log);
+
+var ix = 30;
+var iy = 30;
+
+PerfTestRunner.measureFrameTime({
+ run: function() {
+ table.childNodes[iy].childNodes[ix].style.backgroundColor = 'teal';
+ ix++;
+ iy++;
+ },
+ warmUpCount: 5,
+});
</script>

Powered by Google App Engine
This is Rietveld 408576698