OLD | NEW |
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 logLines.push(text); | 130 logLines.push(text); |
131 else | 131 else |
132 logInDocument(text); | 132 logInDocument(text); |
133 } | 133 } |
134 | 134 |
135 PerfTestRunner.logFatalError = function (text) { | 135 PerfTestRunner.logFatalError = function (text) { |
136 PerfTestRunner.log(text); | 136 PerfTestRunner.log(text); |
137 finish(); | 137 finish(); |
138 } | 138 } |
139 | 139 |
140 // Force a layout (including style recalc) if window.fullFrameMeasurement is
false, | 140 PerfTestRunner.forceLayout = function(doc) { |
141 // or a full frame update (including style recalc, layout, compositing updat
e and paint invalidation, | |
142 // not including painting). | |
143 PerfTestRunner.forceLayoutOrFullFrame = function(doc) { | |
144 doc = doc || document; | 141 doc = doc || document; |
145 // Forcing full frame is only feasible when window.internals is availabl
e. | |
146 if (window.fullFrameMeasurement) { | |
147 if (window.internals) | |
148 internals.forceCompositingUpdate(doc); | |
149 else | |
150 PerfTestRunner.logFatalError('window.internals API is required f
or full frame measurement.'); | |
151 return; | |
152 } | |
153 | |
154 // Otherwise just force style recalc and layout without compositing upda
te and paint invalidation. | |
155 if (doc.body) | 142 if (doc.body) |
156 doc.body.offsetHeight; | 143 doc.body.offsetHeight; |
157 else if (doc.documentElement) | 144 else if (doc.documentElement) |
158 doc.documentElement.offsetHeight; | 145 doc.documentElement.offsetHeight; |
159 }; | 146 }; |
160 | 147 |
161 function start(test, runner) { | 148 function start(test, runner) { |
162 if (!test) { | 149 if (!test) { |
163 PerfTestRunner.logFatalError("Got a bad test object."); | 150 PerfTestRunner.logFatalError("Got a bad test object."); |
164 return; | 151 return; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 var iframe = document.createElement("iframe"); | 314 var iframe = document.createElement("iframe"); |
328 document.body.appendChild(iframe); | 315 document.body.appendChild(iframe); |
329 | 316 |
330 iframe.sandbox = ''; // Prevent external loads which could cause wr
ite() to return before completing the parse. | 317 iframe.sandbox = ''; // Prevent external loads which could cause wr
ite() to return before completing the parse. |
331 iframe.style.width = "600px"; // Have a reasonable size so we're not
line-breaking on every character. | 318 iframe.style.width = "600px"; // Have a reasonable size so we're not
line-breaking on every character. |
332 iframe.style.height = "800px"; | 319 iframe.style.height = "800px"; |
333 iframe.contentDocument.open(); | 320 iframe.contentDocument.open(); |
334 | 321 |
335 for (var chunkIndex = 0; chunkIndex < chunks.length; chunkIndex++) { | 322 for (var chunkIndex = 0; chunkIndex < chunks.length; chunkIndex++) { |
336 iframe.contentDocument.write(chunks[chunkIndex]); | 323 iframe.contentDocument.write(chunks[chunkIndex]); |
337 PerfTestRunner.forceLayoutOrFullFrame(iframe.contentDocument); | 324 PerfTestRunner.forceLayout(iframe.contentDocument); |
338 } | 325 } |
339 | 326 |
340 iframe.contentDocument.close(); | 327 iframe.contentDocument.close(); |
341 document.body.removeChild(iframe); | 328 document.body.removeChild(iframe); |
342 }; | 329 }; |
343 | 330 |
344 PerfTestRunner.measureTime(test); | 331 PerfTestRunner.measureTime(test); |
345 } | 332 } |
346 | 333 |
347 window.PerfTestRunner = PerfTestRunner; | 334 window.PerfTestRunner = PerfTestRunner; |
348 })(); | 335 })(); |
OLD | NEW |