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

Unified Diff: mojo/shell/mojo_url_resolver_unittest.cc

Issue 668483002: Change mojo URLs from mojo://mojo_foo to mojo://foo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 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
Index: mojo/shell/mojo_url_resolver_unittest.cc
diff --git a/mojo/shell/mojo_url_resolver_unittest.cc b/mojo/shell/mojo_url_resolver_unittest.cc
index e4deffa31eedcaf75a865178c2395cf0a08d4ed3..363071b19eea8e7d6b1edb56e1300bea4daa9f40 100644
--- a/mojo/shell/mojo_url_resolver_unittest.cc
+++ b/mojo/shell/mojo_url_resolver_unittest.cc
@@ -19,11 +19,16 @@ TEST_F(MojoURLResolverTest, MojoURLsFallThrough) {
resolver.AddCustomMapping(GURL("mojo:test"), GURL("mojo:foo"));
const GURL base_url("file:/base");
resolver.SetBaseURL(base_url);
- const std::string resolved(resolver.Resolve(GURL("mojo:test")).spec());
+ std::string resolved(resolver.Resolve(GURL("mojo:test")).spec());
// Resolved must start with |base_url|.
EXPECT_EQ(base_url.spec(), resolved.substr(0, base_url.spec().size()));
- // And must contain foo (which is what test mapped to.
- EXPECT_NE(std::string::npos, resolved.find("foo"));
+ // And must contain mojo_foo (we got mapped to foo, and all libraries are
+ // prefixed with mojo_).
+ EXPECT_NE(std::string::npos, resolved.find("mojo_foo"));
+
+ // Make sure we don't double-mojo.
+ resolved = resolver.Resolve(GURL("mojo:mojo_test")).spec();
+ EXPECT_EQ(std::string::npos, resolved.find("mojo:mojo_mojo_foo"));
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698