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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..85bbd6f328a9319c2adbc1ed2c1f9b8ce1534db4 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,32 @@
}
</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';
+ }
+ }
+ );
+ }
+
+ function showAllTests() {
+ var testTableRows = document.getElementsByClassName(
+ 'test-table-body-row');
+ Array.prototype.slice.call(testTableRows)
+ .forEach(function(row) {
+ row.style.display = 'table-row';
+ }
+ );
+ }
+
function sortByColumn(head) {
var tbody = head.parentNode.parentNode.nextElementSibling;
var rows = tbody.rows;
@@ -74,8 +100,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 +132,7 @@
</body>
<script>
Array.prototype.slice.call(document.getElementsByTagName('th'))
- .forEach(function(head, _) {
+ .forEach(function(head) {
head.addEventListener(
"click",
function() { sortByColumn(head); },
@@ -114,5 +140,25 @@
);
}
);
+ Array.prototype.slice.call(
+ document.getElementsByClassName('suite-table-summary-column-0'))
+ .forEach(function(summaryTotal) {
+ summaryTotal.addEventListener(
+ "click",
+ function() { showAllTests(); },
+ false
+ );
+ }
+ );
+ Array.prototype.slice.call(
+ document.getElementsByClassName('suite-table-body-column-0'))
+ .forEach(function(suiteName) {
+ suiteName.addEventListener(
+ "click",
+ function() { showTestsOfOneSuiteOnly(suiteName.innerText); },
+ false
+ );
+ }
+ );
</script>
</html>
« 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