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

Unified Diff: third_party/WebKit/PerformanceTests/Editing/move-up-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-14T13:13:29 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/PerformanceTests/Editing/move-down-with-hidden-elements.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/PerformanceTests/Editing/move-up-with-hidden-elements.html
diff --git a/third_party/WebKit/PerformanceTests/Editing/move-up-with-hidden-elements.html b/third_party/WebKit/PerformanceTests/Editing/move-up-with-hidden-elements.html
new file mode 100644
index 0000000000000000000000000000000000000000..b2def76ff0fbff50d0a158ee1ab0cc036ab9f729
--- /dev/null
+++ b/third_party/WebKit/PerformanceTests/Editing/move-up-with-hidden-elements.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<script src="../resources/runner.js"></script>
+<div id="sample"></div>
+<script>
+const kCount = 10;
+const kElements = 10000;
+
+const metaElements = (() => {
+ const result = [];
+ for (let count = 0; count < kElements; ++count)
+ result.push('<meta>', '</meta>');
+ return result;
+})();
+const sample = document.getElementById('sample');
+sample.innerHTML = [
+ '<div hiddent>', ...metaElements, '</div>',
+ '<h1 id="target">first line of renderered text</h1>',
+ '<div hiddent>', ...metaElements, '</div>',
+].join('');
+
+const selection = window.getSelection();
+const target = document.getElementById('target');
+
+PerfTestRunner.measureRunsPerSecond({
+ description: 'Measures performance of move-up through non-renderered elements',
+ run: () => {
+ selection.collapse(target, 0);
+ selection.extend(target, target.childNodes.length);
+ for (let counter = 0; counter < kCount; ++counter)
+ selection.modify('move', 'backward', 'line');
+ },
+});
+</script>
« no previous file with comments | « third_party/WebKit/PerformanceTests/Editing/move-down-with-hidden-elements.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698