Chromium Code Reviews| Index: scripts/slave/recipe_modules/chromium_android/resources/template/main.html |
| diff --git a/scripts/slave/recipe_modules/chromium_android/resources/template/main.html b/scripts/slave/recipe_modules/chromium_android/resources/template/main.html |
| index 327706f5d109941e86b88ac9141e71c1f5a99b84..51a8d8e25f35b5cd5354ceee7cbe922cab692792 100644 |
| --- a/scripts/slave/recipe_modules/chromium_android/resources/template/main.html |
| +++ b/scripts/slave/recipe_modules/chromium_android/resources/template/main.html |
| @@ -35,6 +35,30 @@ |
| } |
| </style> |
| <script type="text/javascript"> |
| + function showTestsOfOneSuiteOnly(suite_name) { |
| + var testTableRows = document.getElementsByClassName( |
| + 'test-table-body-row'); |
| + Array.prototype.slice.call(testTableRows) |
| + .forEach(function(row) { |
| + var testCasePath = row.getElementsByClassName( |
| + 'test-table-body-column-0')[0].innerText.trim(); |
| + if (testCasePath.startsWith(suite_name)) { |
| + row.style.display = 'table-row'; |
| + } else { |
| + row.style.display = 'none'; |
| + } |
| + }) |
|
the real yoland
2016/08/23 19:56:04
nit:
}
);
BigBossZhiling
2016/08/23 22:20:24
Done.
|
| + } |
| + |
| + function showAllTests() { |
| + var testTableRows = document.getElementsByClassName( |
| + 'test-table-body-row'); |
| + Array.prototype.slice.call(testTableRows) |
| + .forEach(function(row) { |
| + row.style.display = 'table-row'; |
| + }) |
|
the real yoland
2016/08/23 19:56:04
nit:
}
);
BigBossZhiling
2016/08/23 22:20:24
Done.
|
| + } |
| + |
| function sortByColumn(head) { |
| var tbody = head.parentNode.parentNode.nextElementSibling; |
| var rows = tbody.rows; |
| @@ -74,8 +98,8 @@ |
| // Sort the array by the specified column number (col) and order (asc). |
| arr.sort(function (a, b) { |
| - var aInnerHTML = a.getElementsByClassName(headIndex)[0].innerHTML; |
| - var bInnerHTML = b.getElementsByClassName(headIndex)[0].innerHTML; |
| + var aInnerHTML = a.children[headIndex].innerHTML; |
| + var bInnerHTML = b.children[headIndex].innerHTML; |
| if (head.className == "number") { |
| var avalue = Number(aInnerHTML); |
| var bvalue = Number(bInnerHTML); |
| @@ -106,7 +130,7 @@ |
| </body> |
| <script> |
| Array.prototype.slice.call(document.getElementsByTagName('th')) |
| - .forEach(function(head, _) { |
| + .forEach(function(head) { |
| head.addEventListener( |
| "click", |
| function() { sortByColumn(head); }, |
| @@ -114,5 +138,25 @@ |
| ); |
| } |
| ); |
| + Array.prototype.slice.call( |
| + document.getElementsByClassName('suite-table-summary-column-0')) |
| + .forEach(function(summary_total) { |
|
the real yoland
2016/08/23 19:56:05
nit: summaryTotal
BigBossZhiling
2016/08/23 22:20:24
Done.
|
| + summary_total.addEventListener( |
| + "click", |
| + function() { showAllTests(); }, |
| + false |
| + ); |
| + } |
| + ); |
| + Array.prototype.slice.call( |
| + document.getElementsByClassName('suite-table-body-column-0')) |
| + .forEach(function(suite_name) { |
|
the real yoland
2016/08/23 19:56:05
nit: suiteName
BigBossZhiling
2016/08/23 22:20:24
Done.
|
| + suite_name.addEventListener( |
| + "click", |
| + function() { showTestsOfOneSuiteOnly(suite_name.innerText); }, |
| + false |
| + ); |
| + } |
| + ); |
| </script> |
| </html> |