| OLD | NEW |
| 1 if (window.testRunner) | 1 if (window.testRunner) |
| 2 testRunner.dumpAsText(); | 2 testRunner.dumpAsText(); |
| 3 | 3 |
| 4 (function() { | 4 (function() { |
| 5 var portrait = { width: window.innerWidth, height: window.innerHeight }; | 5 var portrait = { width: window.innerWidth, height: window.innerHeight }; |
| 6 var landscape = { width: window.innerHeight, height: window.innerWidth }; | 6 var landscape = { width: window.innerHeight, height: window.innerWidth }; |
| 7 | 7 |
| 8 var run = function() { | 8 var run = function() { |
| 9 window.resizeTo(portrait.width, portrait.height); | 9 window.resizeTo(portrait.width, portrait.height); |
| 10 document.body.offsetTop; | 10 PerfTestRunner.forceLayoutOrFullFrame(); |
| 11 window.resizeTo(landscape.width, landscape.height); | 11 window.resizeTo(landscape.width, landscape.height); |
| 12 document.body.offsetTop; | 12 PerfTestRunner.forceLayoutOrFullFrame(); |
| 13 }; | 13 }; |
| 14 | 14 |
| 15 function onTestDone() { | 15 function onTestDone() { |
| 16 var logNode = document.getElementById("log"); | 16 var logNode = document.getElementById("log"); |
| 17 logNode.parentNode.removeChild(logNode); | 17 logNode.parentNode.removeChild(logNode); |
| 18 document.body.innerHTML = ""; | 18 document.body.innerHTML = ""; |
| 19 document.body.appendChild(logNode); | 19 document.body.appendChild(logNode); |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 function startTest() { | 22 function startTest() { |
| 23 PerfTestRunner.measureRunsPerSecond({ | 23 PerfTestRunner.measureRunsPerSecond({ |
| 24 description: "Exercising window resize and following relayout", | 24 description: "Exercising window resize and following relayout", |
| 25 run: run, | 25 run: run, |
| 26 done: onTestDone | 26 done: onTestDone |
| 27 }); | 27 }); |
| 28 } | 28 } |
| 29 | 29 |
| 30 document.addEventListener("DOMContentLoaded", startTest); | 30 document.addEventListener("DOMContentLoaded", startTest); |
| 31 })(); | 31 })(); |
| OLD | NEW |