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

Side by Side Diff: third_party/WebKit/PerformanceTests/Editing/move-down-with-hidden-elements.html

Issue 2689183003: Convert layout test move-up-down-should-skip-hidden-elements.html to performance test (Closed)
Patch Set: 2017-02-14T11:22:37 Created 3 years, 10 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
OLDNEW
(Empty)
1 <!doctype html>
2 <script src="../resources/runner.js"></script>
3 <div id="sample"></div>
4 <script>
5 const kCount = 10;
6
7 const metaElements = (() => {
8 const result = [];
9 for (let count = 0; count < 100; ++count)
yoichio 2017/02/14 04:00:20 Amount of 100 <meta>s is O.K. to get better metric
10 result.push('<meta>', '</meta>');
11 return result;
12 })();
13 const sample = document.getElementById('sample');
14 sample.innerHTML = [
15 '<div hiddent>', ...metaElements, '</div>',
16 '<h1 id="target">first line of renderered text</h1>',
17 '<div hiddent>', ...metaElements, '</div>',
18 ].join('');
19
20 const selection = window.getSelection();
21 const target = document.getElementById('target');
22
23 PerfTestRunner.measureRunsPerSecond({
24 description: 'Measures performance of move-down through non-renderered element s',
25 run: () => {
26 selection.collapse(target, 0);
27 selection.extend(target, target.childNodes.length);
28 for (let counter = 0; counter < kCount; ++counter)
29 selection.modify('move', 'forward', 'line');
30 },
31 });
32 </script>
33 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698