OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <script src="../resources/runner.js"></script> | 2 <script src="../resources/runner.js"></script> |
3 <textarea id="text" style="width:300px; height:300px" spellcheck="false"></texta
rea> | 3 <textarea id="text" style="width:300px; height:300px" spellcheck="false"></texta
rea> |
4 <script> | 4 <script> |
5 const kCount = 10; | 5 const kCount = 10; |
6 const kLines = 20000 | 6 const kLines = 20000 |
7 | 7 |
8 text.textContent = (() => { | 8 text.textContent = (() => { |
9 const result = []; | 9 const result = []; |
10 for (let count = 0; count < kLines; ++count) | 10 for (let count = 0; count < kLines; ++count) |
11 result.push(`${('00000' + count).slice(-5)} of brown foxes\n`); | 11 result.push(`${('00000' + count).slice(-5)} of brown foxes\n`); |
12 return result.join(''); | 12 return result.join(''); |
13 })(); | 13 })(); |
14 text.focus(); | 14 text.focus(); |
15 | 15 |
16 PerfTestRunner.measureRunsPerSecond({ | 16 PerfTestRunner.measureRunsPerSecond({ |
17 description: 'Measures performance of move-page-up on many lines', | 17 description: 'Measures performance of move-page-up on many lines', |
18 run: () => { | 18 run: () => { |
19 const cursorIndex = text.value.length - 1; | 19 const cursorIndex = text.value.length - 1; |
20 text.setSelectionRange(cursorIndex, cursorIndex); | 20 text.setSelectionRange(cursorIndex, cursorIndex); |
21 for (let counter = 0; counter < kCount; ++counter) | 21 for (let counter = 0; counter < kCount; ++counter) |
22 testRunner.execCommand("MovePageUp"); | 22 testRunner.execCommand("MovePageUp"); |
23 }, | 23 }, |
24 }); | 24 }); |
25 </script> | 25 </script> |
OLD | NEW |