Chromium Code Reviews| 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..7a6158ac6b7176a0dec42ceb3761bf07f500c654 100644 |
| --- a/build/android/pylib/results/presentation/javascript/main_html.js |
| +++ b/build/android/pylib/results/presentation/javascript/main_html.js |
| @@ -26,7 +26,7 @@ function showTestTable(show_the_table) { |
| show_the_table ? 'table' : 'none'); |
| } |
| -function showTestsOfOneSuiteOnly(suite_name) { |
| +function showTestsOfOneSuiteOnly(suite_name, push_state) { |
| setTitle('Test Results of Suite: ' + suite_name) |
| show_all = (suite_name == 'TOTAL') |
| var testTableBlocks = document.getElementById('test-table') |
| @@ -46,12 +46,30 @@ function showTestsOfOneSuiteOnly(suite_name) { |
| }); |
| showTestTable(true); |
| showSuiteTable(false); |
| + window.scrollTo(0, 0); |
|
jbudorick
2017/04/11 17:52:47
Why are we now scrolling to the top?
BigBossZhiling
2017/04/11 18:37:51
Acknowledged.
|
| + if (push_state) { |
|
jbudorick
2017/04/11 17:52:47
Should this & replace_state be in these two functi
BigBossZhiling
2017/04/11 18:37:51
Done.
|
| + history.pushState({suite: suite_name}, suite_name, ''); |
| + } |
| } |
| -function showSuiteTableOnly() { |
| +function showSuiteTableOnly(replace_state) { |
| setTitle('Suites Summary') |
| showTestTable(false); |
| showSuiteTable(true); |
| + window.scrollTo(0, 0); |
| + if (replace_state) { |
| + history.replaceState({}, 'suite_table', ''); |
| + } |
| +} |
| + |
| +function setBrowserBackButtonLogic() { |
| + window.onpopstate = function(event) { |
| + if (!event.state || !event.state.suite) { |
| + showSuiteTableOnly(false); |
| + } else { |
| + showTestsOfOneSuiteOnly(event.state.suite, false); |
| + } |
| + }; |
| } |
| function setTitle(title) { |
| @@ -166,17 +184,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&' + |