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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PerformanceTests/DOM/div-editable.html
diff --git a/PerformanceTests/DOM/div-editable.html b/PerformanceTests/DOM/div-editable.html
new file mode 100644
index 0000000000000000000000000000000000000000..26ced3285a4433575a0c859a52751e56254b3310
--- /dev/null
+++ b/PerformanceTests/DOM/div-editable.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<script src="../resources/runner.js"></script>
+<div id="container" style="background-color:lime;" contenteditable></div>
+<script>
+var div = document.querySelector('div');
+div.focus();
+
+PerfTestRunner.measureRunsPerSecond({
+ description: "Measures performance of adding new lines to an editable div using document.execCommand, then clearing it.",
+ run: function() {
+ for (var i = 0; i < 500; ++i)
+ document.execCommand('InsertLineBreak');
+ for (var i = 0; i < 500; ++i)
+ document.execCommand('Delete');
+
+ for (var i = 0; i < 500; ++i)
+ document.execCommand('InsertLineBreak');
+ // Move cursor to the beginning of div.
+ var range = document.createRange();
+ range.selectNodeContents(div);
+ range.collapse(true);
+ getSelection().removeAllRanges();
+ getSelection().addRange(range);
+ for (var i = 0; i < 500; ++i)
+ document.execCommand('ForwardDelete');
+ }
+});
+</script>
« 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