Add performance tests for <textarea>
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 May 2012 00:53:41 +0000 (00:53 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 May 2012 00:53:41 +0000 (00:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=86994

Reviewed by Ryosuke Niwa.

* DOM/textarea-dom.html: Added.
* DOM/textarea-edit.html: Added.
* Parser/textarea-parsing.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@117862 268f45cc-cd09-0410-ab3c-d52691b4dbfc

PerformanceTests/ChangeLog
PerformanceTests/DOM/textarea-dom.html [new file with mode: 0644]
PerformanceTests/DOM/textarea-edit.html [new file with mode: 0644]
PerformanceTests/Parser/textarea-parsing.html [new file with mode: 0644]

index 34f0919..5d95148 100644 (file)
@@ -1,3 +1,14 @@
+2012-05-21  Kent Tamura  <tkent@chromium.org>
+
+        Add performance tests for <textarea>
+        https://bugs.webkit.org/show_bug.cgi?id=86994
+
+        Reviewed by Ryosuke Niwa.
+
+        * DOM/textarea-dom.html: Added.
+        * DOM/textarea-edit.html: Added.
+        * Parser/textarea-parsing.html: Added.
+
 2012-05-18  Ilya Tikhonovsky  <loislo@chromium.org>
 
         Web Inspector: upstream build dominators tree procedure from v8.
diff --git a/PerformanceTests/DOM/textarea-dom.html b/PerformanceTests/DOM/textarea-dom.html
new file mode 100644 (file)
index 0000000..f027564
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<body>
+<style>
+textarea:valid {
+    background-color: lime;
+}
+textarea:invalid {
+    background-color: red;
+}
+</style>
+<script src="../resources/runner.js"></script>
+<textarea maxlength=2147483647 id="container"></textarea>
+<script>
+var container = document.getElementById('container');
+var nodes = [];
+var childCount = 1000;
+for (var i = 0; i < childCount; ++i)
+    nodes.push(document.createTextNode('A quick brown fox jumps over the lazy dog.\n'));
+PerfTestRunner.runPerSecond({run: function() {
+    for (var i = 0; i < childCount; ++i)
+        container.appendChild(nodes[i]);
+    container.innerHTML = '';
+}});
+</script>
+</body>
diff --git a/PerformanceTests/DOM/textarea-edit.html b/PerformanceTests/DOM/textarea-edit.html
new file mode 100644 (file)
index 0000000..7c80e14
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<body>
+<style>
+textarea:valid {
+    background-color: lime;
+}
+textarea:invalid {
+    background-color: red;
+}
+</style>
+<script src="../resources/runner.js"></script>
+<textarea maxlength=2147483647 id="container"></textarea>
+<script>
+var container = document.getElementById('container');
+container.focus();
+PerfTestRunner.runPerSecond({run: function() {
+    for (var i = 0; i < 500; ++i)
+        document.execCommand('insertText', false, 'A quick brown fox jumps over the lazy dog.\n');
+    container.value = '';
+}});
+</script>
+</body>
diff --git a/PerformanceTests/Parser/textarea-parsing.html b/PerformanceTests/Parser/textarea-parsing.html
new file mode 100644 (file)
index 0000000..e76b5f5
--- /dev/null
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<body>
+<style>
+textarea:valid {
+    background-color: lime;
+}
+textarea:invalid {
+    background-color: red;
+}
+</style>
+<script src="../resources/runner.js"></script>
+<div id="container"></div>
+<script>
+var htmlText = "<textarea maxlength=2147483647>";
+for (var i = 0; i < 1000; ++i) {
+    htmlText += "A quick brown fox jumps over the lazy dog.\n" +
+        "A quick brown fox jumps over the lazy dog.\n" +
+        "<!-- comment -->\n";
+}
+htmlText += "</textarea>"
+
+var container = document.getElementById('container');
+PerfTestRunner.runPerSecond({run: function() {
+    container.innerHTML = htmlText;
+}});
+</script>
+</body>