Regression(r236613): Parser/html-parser.html performance test is failing
[WebKit-https.git] / PerformanceTests / Interactive / SelectAll.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../resources/runner.js"></script>
5 <script>
6
7 PerfTestRunner.prepareToMeasureValuesAsync({
8     unit: 'ms',
9     done: function () {
10         var iframe = document.querySelector('iframe');
11         iframe.parentNode.removeChild(iframe);
12     }
13 });
14
15 function runTest() {
16     var iframe = document.querySelector('iframe');
17     iframe.contentWindow.getSelection().removeAllRanges();
18     iframe.contentDocument.body.offsetTop;
19
20     setTimeout(function () {
21         var startTime = PerfTestRunner.now();
22         iframe.contentDocument.execCommand('SelectAll');
23         iframe.contentDocument.body.offsetTop;
24         setTimeout(function () {
25             if (!PerfTestRunner.measureValueAsync(PerfTestRunner.now() - startTime))
26                 return;
27             PerfTestRunner.gc();
28             setTimeout(runTest, 0);
29         }, 0);
30     }, 0);
31 }
32
33 </script>
34 <iframe src="../Parser/resources/html5.html" onload="runTest()" width="800" height="600">
35 </body>
36 </html>