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

Side by Side Diff: scripts/slave/recipe_modules/chromium_android/resources/template/main.html

Issue 2252603002: Created a line of summary and enabled suite name onclick function. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: fixes Created 4 years, 4 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 | scripts/slave/recipe_modules/chromium_android/resources/template/table.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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <link rel="stylesheet" href="/i/{{master_name}}/default.css" type="text/css" > 5 <link rel="stylesheet" href="/i/{{master_name}}/default.css" type="text/css" >
6 <style> 6 <style>
7 table, th, td { 7 table, th, td {
8 border: 1px solid black; 8 border: 1px solid black;
9 border-collapse: collapse; 9 border-collapse: collapse;
10 } 10 }
(...skipping 17 matching lines...) Expand all
28 } 28 }
29 td a:hover { 29 td a:hover {
30 text-decoration: underline; 30 text-decoration: underline;
31 cursor: pointer; 31 cursor: pointer;
32 } 32 }
33 tr:hover { 33 tr:hover {
34 background-color: #F6F6F6; 34 background-color: #F6F6F6;
35 } 35 }
36 </style> 36 </style>
37 <script type="text/javascript"> 37 <script type="text/javascript">
38 function showTestsOfOneSuiteOnly(suite_name) {
39 var testTableRows = document.getElementsByClassName(
40 'test-table-body-row');
41 Array.prototype.slice.call(testTableRows)
42 .forEach(function(row) {
43 var testCasePath = row.getElementsByClassName(
44 'test-table-body-column-0')[0].innerText.trim();
45 if (testCasePath.startsWith(suite_name)) {
46 row.style.display = 'table-row';
47 } else {
48 row.style.display = 'none';
49 }
50 })
the real yoland 2016/08/23 19:56:04 nit: } );
BigBossZhiling 2016/08/23 22:20:24 Done.
51 }
52
53 function showAllTests() {
54 var testTableRows = document.getElementsByClassName(
55 'test-table-body-row');
56 Array.prototype.slice.call(testTableRows)
57 .forEach(function(row) {
58 row.style.display = 'table-row';
59 })
the real yoland 2016/08/23 19:56:04 nit: } );
BigBossZhiling 2016/08/23 22:20:24 Done.
60 }
61
38 function sortByColumn(head) { 62 function sortByColumn(head) {
39 var tbody = head.parentNode.parentNode.nextElementSibling; 63 var tbody = head.parentNode.parentNode.nextElementSibling;
40 var rows = tbody.rows; 64 var rows = tbody.rows;
41 65
42 // Put 'tr' in rows to an array. 66 // Put 'tr' in rows to an array.
43 var arr = Array.prototype.slice.call(rows); 67 var arr = Array.prototype.slice.call(rows);
44 68
45 // Determine whether to asc or desc and set arrows. 69 // Determine whether to asc or desc and set arrows.
46 var headers = head.parentNode.getElementsByTagName('th'); 70 var headers = head.parentNode.getElementsByTagName('th');
47 var headIndex = Array.prototype.slice.call(headers).indexOf(head); 71 var headIndex = Array.prototype.slice.call(headers).indexOf(head);
(...skipping 19 matching lines...) Expand all
67 if (asc == 1) { 91 if (asc == 1) {
68 headers[headIndex].getElementsByClassName('up')[0] 92 headers[headIndex].getElementsByClassName('up')[0]
69 .style.display = 'inline'; 93 .style.display = 'inline';
70 } else { 94 } else {
71 headers[headIndex].getElementsByClassName('down')[0] 95 headers[headIndex].getElementsByClassName('down')[0]
72 .style.display = 'inline'; 96 .style.display = 'inline';
73 } 97 }
74 98
75 // Sort the array by the specified column number (col) and order (asc). 99 // Sort the array by the specified column number (col) and order (asc).
76 arr.sort(function (a, b) { 100 arr.sort(function (a, b) {
77 var aInnerHTML = a.getElementsByClassName(headIndex)[0].innerHTML; 101 var aInnerHTML = a.children[headIndex].innerHTML;
78 var bInnerHTML = b.getElementsByClassName(headIndex)[0].innerHTML; 102 var bInnerHTML = b.children[headIndex].innerHTML;
79 if (head.className == "number") { 103 if (head.className == "number") {
80 var avalue = Number(aInnerHTML); 104 var avalue = Number(aInnerHTML);
81 var bvalue = Number(bInnerHTML); 105 var bvalue = Number(bInnerHTML);
82 } else if (head.className == "text") { 106 } else if (head.className == "text") {
83 var avalue = aInnerHTML; 107 var avalue = aInnerHTML;
84 var bvalue = bInnerHTML; 108 var bvalue = bInnerHTML;
85 } 109 }
86 return (avalue == bvalue) ? 0 : ((avalue > bvalue) ? asc : -1 * asc); 110 return (avalue == bvalue) ? 0 : ((avalue > bvalue) ? asc : -1 * asc);
87 }); 111 });
88 112
(...skipping 10 matching lines...) Expand all
99 {% for tb_value in tb_values %} 123 {% for tb_value in tb_values %}
100 {% include 'template/table.html' %} 124 {% include 'template/table.html' %}
101 <br> 125 <br>
102 <br> 126 <br>
103 <br> 127 <br>
104 {% endfor %} 128 {% endfor %}
105 </div> 129 </div>
106 </body> 130 </body>
107 <script> 131 <script>
108 Array.prototype.slice.call(document.getElementsByTagName('th')) 132 Array.prototype.slice.call(document.getElementsByTagName('th'))
109 .forEach(function(head, _) { 133 .forEach(function(head) {
110 head.addEventListener( 134 head.addEventListener(
111 "click", 135 "click",
112 function() { sortByColumn(head); }, 136 function() { sortByColumn(head); },
113 false 137 false
114 ); 138 );
115 } 139 }
116 ); 140 );
141 Array.prototype.slice.call(
142 document.getElementsByClassName('suite-table-summary-column-0'))
143 .forEach(function(summary_total) {
the real yoland 2016/08/23 19:56:05 nit: summaryTotal
BigBossZhiling 2016/08/23 22:20:24 Done.
144 summary_total.addEventListener(
145 "click",
146 function() { showAllTests(); },
147 false
148 );
149 }
150 );
151 Array.prototype.slice.call(
152 document.getElementsByClassName('suite-table-body-column-0'))
153 .forEach(function(suite_name) {
the real yoland 2016/08/23 19:56:05 nit: suiteName
BigBossZhiling 2016/08/23 22:20:24 Done.
154 suite_name.addEventListener(
155 "click",
156 function() { showTestsOfOneSuiteOnly(suite_name.innerText); },
157 false
158 );
159 }
160 );
117 </script> 161 </script>
118 </html> 162 </html>
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/chromium_android/resources/template/table.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698