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

Unified Diff: shell/url_resolver_unittest.cc

Issue 972473003: Strip query string before applying url mapping. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 5 years, 10 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 | « shell/url_resolver.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/url_resolver_unittest.cc
diff --git a/shell/url_resolver_unittest.cc b/shell/url_resolver_unittest.cc
index 6ba868d728daff2f262c4f22715da7b723965cf3..689c3edc1a4e849f03b71395efc0c519f3b87261 100644
--- a/shell/url_resolver_unittest.cc
+++ b/shell/url_resolver_unittest.cc
@@ -121,6 +121,24 @@ TEST_F(URLResolverTest, GetOriginMappings) {
EXPECT_EQ("https://c.org/b", mappings[1].base_url);
}
+TEST_F(URLResolverTest, TestQueryForURLMapping) {
+ URLResolver resolver;
+ resolver.SetMojoBaseURL(GURL("file:/base"));
+ resolver.AddURLMapping(GURL("https://a.org/foo"),
+ GURL("https://b.org/a/foo"));
+ resolver.AddURLMapping(GURL("https://b.org/a/foo"),
+ GURL("https://c.org/b/a/foo"));
+ GURL mapped_url = resolver.ApplyMappings(GURL("https://a.org/foo?a=b"));
+ EXPECT_EQ("https://c.org/b/a/foo?a=b", mapped_url.spec());
+}
+
+TEST_F(URLResolverTest, TestQueryForBaseURL) {
+ URLResolver resolver;
+ resolver.SetMojoBaseURL(GURL("file:///base"));
+ GURL mapped_url = resolver.ResolveMojoURL(GURL("mojo:foo?a=b"));
+ EXPECT_EQ("file:///base/foo.mojo?a=b", mapped_url.spec());
+}
+
} // namespace
} // namespace test
} // namespace shell
« no previous file with comments | « shell/url_resolver.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698