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

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

Issue 2518763002: MD Settings: Allow trailing slashes in otherwise valid URLs. (Closed)
Patch Set: Nit per Tommy's comment. Created 4 years, 1 month 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/browser/resources/settings/route.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/route_tests.js
diff --git a/chrome/test/data/webui/settings/route_tests.js b/chrome/test/data/webui/settings/route_tests.js
index eb5b01d1e1c553c139232c4e9b0d43e5e15f2f06..32e13d1f571686e0326f338ab0ab516ca0c48a44 100644
--- a/chrome/test/data/webui/settings/route_tests.js
+++ b/chrome/test/data/webui/settings/route_tests.js
@@ -157,4 +157,31 @@ suite('route', function() {
assertFalse(settings.lastRouteChangeWasPopstate());
});
});
+
+ test('getRouteForPath trailing slashes', function() {
+ assertEquals(settings.Route.BASIC, settings.getRouteForPath('/'));
+ assertEquals(null, settings.getRouteForPath('//'));
+
+ // Simple path.
+ assertEquals(settings.Route.PEOPLE, settings.getRouteForPath('/people/'));
+ assertEquals(settings.Route.PEOPLE, settings.getRouteForPath('/people'));
+
+ // Path with a slash.
+ assertEquals(
+ settings.Route.SITE_SETTINGS_COOKIES,
+ settings.getRouteForPath('/content/cookies'));
+ assertEquals(
+ settings.Route.SITE_SETTINGS_COOKIES,
+ settings.getRouteForPath('/content/cookies/'));
+
+ if (cr.isChromeOS) {
+ // Path with a dash.
+ assertEquals(
+ settings.Route.KEYBOARD,
+ settings.getRouteForPath('/keyboard-overlay'));
+ assertEquals(
+ settings.Route.KEYBOARD,
+ settings.getRouteForPath('/keyboard-overlay/'));
+ }
+ });
});
« no previous file with comments | « chrome/browser/resources/settings/route.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698