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

Side by Side Diff: third_party/WebKit/PerformanceTests/DOM/select-single-remove.html

Issue 2079233002: Fix a wrong test landed in r400392. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <body> 2 <body>
3 <script src="../resources/runner.js"></script> 3 <script src="../resources/runner.js"></script>
4 <select id="container"></select> 4 <select id="container"></select>
5 <script> 5 <script>
6 var container = document.getElementById('container'); 6 var container = document.getElementById('container');
7 var nodes = []; 7 var nodes = [];
8 var childCount = 1000; 8 var childCount = 1000;
9 for (var i = 0; i < childCount; ++i) { 9 for (var i = 0; i < childCount; ++i) {
10 var option = document.createElement('option'); 10 var option = document.createElement('option');
11 option.textContent = i; 11 option.textContent = i;
12 nodes.push(option); 12 nodes.push(option);
13 } 13 }
14 14
15 PerfTestRunner.measureRunsPerSecond({ 15 PerfTestRunner.measureRunsPerSecond({
16 description: 'Measures performance of removing option elements from a single -selection select element.', 16 description: 'Measures performance of removing option elements from a single -selection select element.',
17 17
18 run: () => { 18 run: () => {
19 for (var i = 0; i < childCount; ++i) 19 for (var i = 0; i < childCount; ++i) {
20 nodes[i].selected = false;
20 container.appendChild(nodes[i]); 21 container.appendChild(nodes[i]);
22 }
21 container.offsetLeft; 23 container.offsetLeft;
22 for (var i = 0; i < childCount; ++i) 24 for (var i = 0; i < childCount; ++i)
23 container.removeChild(nodes[i]); 25 container.removeChild(nodes[i]);
24 } 26 }
25 }); 27 });
26 </script> 28 </script>
27 </body> 29 </body>
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