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

Side by Side Diff: third_party/WebKit/PerformanceTests/resources/runner.js

Issue 2323313002: Load the test page before measurement in PerfTestRunner.measurePageLoadTime() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // There are tests for computeStatistics() located in LayoutTests/fast/harness/p erftests 1 // There are tests for computeStatistics() located in LayoutTests/fast/harness/p erftests
2 2
3 if (window.testRunner) { 3 if (window.testRunner) {
4 testRunner.waitUntilDone(); 4 testRunner.waitUntilDone();
5 testRunner.dumpAsText(); 5 testRunner.dumpAsText();
6 } 6 }
7 7
8 (function () { 8 (function () {
9 var logLines = null; 9 var logLines = null;
10 var completedIterations = -1; 10 var completedIterations = -1;
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 286
287 function callRunAndMeasureTime(callsPerIteration) { 287 function callRunAndMeasureTime(callsPerIteration) {
288 var startTime = PerfTestRunner.now(); 288 var startTime = PerfTestRunner.now();
289 for (var i = 0; i < callsPerIteration; i++) 289 for (var i = 0; i < callsPerIteration; i++)
290 currentTest.run(); 290 currentTest.run();
291 return PerfTestRunner.now() - startTime; 291 return PerfTestRunner.now() - startTime;
292 } 292 }
293 293
294 294
295 PerfTestRunner.measurePageLoadTime = function(test) { 295 PerfTestRunner.measurePageLoadTime = function(test) {
296 var file = PerfTestRunner.loadFile(test.path);
296 test.run = function() { 297 test.run = function() {
297 var file = PerfTestRunner.loadFile(test.path);
298 if (!test.chunkSize) 298 if (!test.chunkSize)
299 this.chunkSize = 50000; 299 this.chunkSize = 50000;
300 300
301 var chunks = []; 301 var chunks = [];
302 // The smaller the chunks the more style resolves we do. 302 // The smaller the chunks the more style resolves we do.
303 // Smaller chunk sizes will show more samples in style resolution. 303 // Smaller chunk sizes will show more samples in style resolution.
304 // Larger chunk sizes will show more samples in line layout. 304 // Larger chunk sizes will show more samples in line layout.
305 // Smaller chunk sizes run slower overall, as the per-chunk overhead is high. 305 // Smaller chunk sizes run slower overall, as the per-chunk overhead is high.
306 var chunkCount = Math.ceil(file.length / this.chunkSize); 306 var chunkCount = Math.ceil(file.length / this.chunkSize);
307 for (var chunkIndex = 0; chunkIndex < chunkCount; chunkIndex++) { 307 for (var chunkIndex = 0; chunkIndex < chunkCount; chunkIndex++) {
(...skipping 18 matching lines...) Expand all
326 326
327 iframe.contentDocument.close(); 327 iframe.contentDocument.close();
328 document.body.removeChild(iframe); 328 document.body.removeChild(iframe);
329 }; 329 };
330 330
331 PerfTestRunner.measureTime(test); 331 PerfTestRunner.measureTime(test);
332 } 332 }
333 333
334 window.PerfTestRunner = PerfTestRunner; 334 window.PerfTestRunner = PerfTestRunner;
335 })(); 335 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698