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

Unified Diff: chrome/test/data/webui/settings/settings_subpage_test.js

Issue 2249873003: Settings: Fix Site Details subpage routing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comment typo 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 | « chrome/test/data/webui/settings/route_tests.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/settings/settings_subpage_test.js
diff --git a/chrome/test/data/webui/settings/settings_subpage_test.js b/chrome/test/data/webui/settings/settings_subpage_test.js
index ceb88fd39ae613ad841ca9ad32f82466143c262b..bd72e78efe2613bddba8350c87e5276b7986842d 100644
--- a/chrome/test/data/webui/settings/settings_subpage_test.js
+++ b/chrome/test/data/webui/settings/settings_subpage_test.js
@@ -5,11 +5,13 @@
cr.define('settings_subpage', function() {
function registerTests() {
suite('SettingsSubpage', function() {
- test('can navigate to parent', function() {
+ test('navigates to parent when there is no history', function() {
PolymerTest.clearBody();
- // Choose CERTIFICATES since it is not a descendant of BASIC.
- settings.navigateTo(settings.Route.CERTIFICATES);
+ // Pretend that we initially started on the CERTIFICATES route.
+ window.history.replaceState(
+ undefined, '', settings.Route.CERTIFICATES.path);
+ settings.initializeRouteFromUrl();
assertEquals(settings.Route.CERTIFICATES, settings.getCurrentRoute());
var subpage = document.createElement('settings-subpage');
@@ -19,7 +21,7 @@ cr.define('settings_subpage', function() {
assertEquals(settings.Route.PRIVACY, settings.getCurrentRoute());
});
- test('can navigate to grandparent using window.back()', function(done) {
+ test('navigates to any route via window.back()', function(done) {
PolymerTest.clearBody();
settings.navigateTo(settings.Route.BASIC);
@@ -31,8 +33,6 @@ cr.define('settings_subpage', function() {
MockInteractions.tap(subpage.$$('paper-icon-button'));
- // Since the previous history entry is an ancestor, we expect
- // window.history.back() to be called and a popstate event to be fired.
window.addEventListener('popstate', function(event) {
assertEquals(settings.Route.BASIC, settings.getCurrentRoute());
done();
« no previous file with comments | « chrome/test/data/webui/settings/route_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698