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

Side by Side Diff: PerformanceTests/DOM/div-editable.html

Issue 1200183002: Add a performance test div-editable.html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/runner.js"></script>
3 <div id="container" style="background-color:lime;" contenteditable></div>
4 <script>
5 var div = document.querySelector('div');
6 div.focus();
7
8 PerfTestRunner.measureRunsPerSecond({
9 description: "Measures performance of adding new lines to an editable div us ing document.execCommand, then clearing it.",
10 run: function() {
11 for (var i = 0; i < 500; ++i)
12 document.execCommand('InsertLineBreak');
13 for (var i = 0; i < 500; ++i)
14 document.execCommand('Delete');
15
16 for (var i = 0; i < 500; ++i)
17 document.execCommand('InsertLineBreak');
18 // Move cursor to the beginning of div.
19 var range = document.createRange();
20 range.selectNodeContents(div);
21 range.collapse(true);
22 getSelection().removeAllRanges();
23 getSelection().addRange(range);
24 for (var i = 0; i < 500; ++i)
25 document.execCommand('ForwardDelete');
26 }
27 });
28 </script>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698