Index: build/android/pylib/results/presentation/javascript/main_html.js |
diff --git a/build/android/pylib/results/presentation/javascript/main_html.js b/build/android/pylib/results/presentation/javascript/main_html.js |
index 6c254d5a6885ffdae66f9422161f0a9ebc031954..8e47fbc32e2c824da20702d8a5f5a4f68a993406 100644 |
--- a/build/android/pylib/results/presentation/javascript/main_html.js |
+++ b/build/android/pylib/results/presentation/javascript/main_html.js |
@@ -46,12 +46,38 @@ function showTestsOfOneSuiteOnly(suite_name) { |
}); |
showTestTable(true); |
showSuiteTable(false); |
+ window.scrollTo(0, 0); |
+} |
+ |
+function testTablePage(suite_name, push_state) { |
jbudorick
2017/04/11 18:43:02
My motivation w/ this suggestion was to eliminate
|
+ showTestsOfOneSuiteOnly(suite_name); |
+ if (push_state) { |
+ history.pushState({suite: suite_name}, suite_name, ''); |
+ } |
} |
function showSuiteTableOnly() { |
setTitle('Suites Summary') |
showTestTable(false); |
showSuiteTable(true); |
+ window.scrollTo(0, 0); |
+} |
+ |
+function suiteTablePage(replace_state) { |
+ showSuiteTableOnly(); |
+ if (replace_state) { |
+ history.replaceState({}, 'suite_table', ''); |
+ } |
+} |
+ |
+function setBrowserBackButtonLogic() { |
+ window.onpopstate = function(event) { |
+ if (!event.state || !event.state.suite) { |
+ suiteTablePage(false); |
+ } else { |
+ testTablePage(event.state.suite, false); |
+ } |
+ }; |
} |
function setTitle(title) { |
@@ -166,17 +192,6 @@ function sortByColumn(head) { |
} |
} |
-function loadPage() { |
- var args = getArguments(); |
- if ('suite' in args) { |
- // The user wants to visit detailed 'subpage' of that suite. |
- showTestsOfOneSuiteOnly(args['suite']); |
- } else { |
- // The user wants to visit the summary of all suites. |
- showSuiteTableOnly(); |
- } |
-} |
- |
function reportIssues() { |
var url = 'https://bugs.chromium.org/p/chromium/issues/entry?' + |
'labels=Pri-2,Type-Bug,Restrict-View-Google&' + |