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

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

Issue 2799153008: Add back buttons and load new 'pages' by calling javascript. (Closed)
Patch Set: make bucket argument mandatory Created 3 years, 8 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 | build/android/pylib/results/presentation/template/main.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ea75a8479e90804c44f05605ee4a4bf04033860d 100644
--- a/build/android/pylib/results/presentation/javascript/main_html.js
+++ b/build/android/pylib/results/presentation/javascript/main_html.js
@@ -46,12 +46,34 @@ function showTestsOfOneSuiteOnly(suite_name) {
});
showTestTable(true);
showSuiteTable(false);
+ window.scrollTo(0, 0);
+}
+
+function showTestsOfOneSuiteOnlyWithNewState(suite_name) {
+ showTestsOfOneSuiteOnly(suite_name);
+ history.pushState({suite: suite_name}, suite_name, '');
}
function showSuiteTableOnly() {
setTitle('Suites Summary')
showTestTable(false);
showSuiteTable(true);
+ window.scrollTo(0, 0);
+}
+
+function showSuiteTableOnlyWithReplaceState() {
+ showSuiteTableOnly();
+ history.replaceState({}, 'suite_table', '');
+}
+
+function setBrowserBackButtonLogic() {
+ window.onpopstate = function(event) {
+ if (!event.state || !event.state.suite) {
+ showSuiteTableOnly();
+ } else {
+ showTestsOfOneSuiteOnly(event.state.suite);
+ }
+ };
}
function setTitle(title) {
@@ -166,17 +188,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&' +
« 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