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

Side by Side Diff: build/android/pylib/results/presentation/javascript/main_html.js

Issue 2875803004: Sort suites in suite table based on number of failed test cases. (Closed)
Patch Set: call sort by column in js instead Created 3 years, 7 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 | build/android/pylib/results/presentation/template/main.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 function getArguments() { 5 function getArguments() {
6 // Returns the URL arguments as a dictionary. 6 // Returns the URL arguments as a dictionary.
7 args = {} 7 args = {}
8 var s = location.search; 8 var s = location.search;
9 if (s) { 9 if (s) {
10 var vals = s.substring(1).split('&'); 10 var vals = s.substring(1).split('&');
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 82
83 function sortByColumn(head) { 83 function sortByColumn(head) {
84 var table = head.parentNode.parentNode.parentNode; 84 var table = head.parentNode.parentNode.parentNode;
85 var rowBlocks = Array.prototype.slice.call( 85 var rowBlocks = Array.prototype.slice.call(
86 table.getElementsByTagName('tbody')); 86 table.getElementsByTagName('tbody'));
87 87
88 // Determine whether to asc or desc and set arrows. 88 // Determine whether to asc or desc and set arrows.
89 var headers = head.parentNode.getElementsByTagName('th'); 89 var headers = head.parentNode.getElementsByTagName('th');
90 var headIndex = Array.prototype.slice.call(headers).indexOf(head); 90 var headIndex = Array.prototype.slice.call(headers).indexOf(head);
91 var asc = 1; 91 var asc = -1;
92 for (var i = 0; i < headers.length; i++) { 92 for (var i = 0; i < headers.length; i++) {
93 if (headers[i].dataset.ascSorted != 0) { 93 if (headers[i].dataset.ascSorted != 0) {
94 if (headers[i].dataset.ascSorted == 1) { 94 if (headers[i].dataset.ascSorted == 1) {
95 headers[i].getElementsByClassName('up')[0] 95 headers[i].getElementsByClassName('up')[0]
96 .style.display = 'none'; 96 .style.display = 'none';
97 } else { 97 } else {
98 headers[i].getElementsByClassName('down')[0] 98 headers[i].getElementsByClassName('down')[0]
99 .style.display = 'none'; 99 .style.display = 'none';
100 } 100 }
101 if (headers[i] == head) { 101 if (headers[i] == head) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 var bvalue = ((btotal_minus_skipped == 0) ? -1 : 180 var bvalue = ((btotal_minus_skipped == 0) ? -1 :
181 (b_rows.length - b_success_or_skipped) / btotal_minus_skipped); 181 (b_rows.length - b_success_or_skipped) / btotal_minus_skipped);
182 } 182 }
183 return asc * (avalue - bvalue); 183 return asc * (avalue - bvalue);
184 }); 184 });
185 185
186 for (var i = 0; i < rowBlocks.length; i++) { 186 for (var i = 0; i < rowBlocks.length; i++) {
187 table.appendChild(rowBlocks[i]); 187 table.appendChild(rowBlocks[i]);
188 } 188 }
189 } 189 }
190
191 function sortSuiteTableByFailedTestCases() {
192 sortByColumn(document.getElementById('number_fail_tests'));
the real yoland 2017/05/12 19:09:43 potential future improvements: there are a lot of
193 }
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/results/presentation/template/main.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698