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

Side by Side Diff: shell/url_resolver_unittest.cc

Issue 868283006: Rename MojoURLResolver to URLResolver (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Garbage char 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 unified diff | Download patch
« shell/url_resolver.h ('K') | « shell/url_resolver.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "shell/mojo_url_resolver.h" 5 #include "shell/url_resolver.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace mojo { 10 namespace mojo {
11 namespace shell { 11 namespace shell {
12 namespace test { 12 namespace test {
13 namespace { 13 namespace {
14 14
15 typedef testing::Test MojoURLResolverTest; 15 typedef testing::Test URLResolverTest;
16 16
17 TEST_F(MojoURLResolverTest, MojoURLsFallThrough) { 17 TEST_F(URLResolverTest, MojoURLsFallThrough) {
18 MojoURLResolver resolver; 18 URLResolver resolver;
19 resolver.AddCustomMapping(GURL("mojo:test"), GURL("mojo:foo")); 19 resolver.AddURLMapping(GURL("mojo:test"), GURL("mojo:foo"));
20 const GURL base_url("file:/base"); 20 const GURL base_url("file:/base");
21 resolver.SetBaseURL(base_url); 21 resolver.SetMojoBaseURL(base_url);
22 std::string resolved(resolver.Resolve(GURL("mojo:test")).spec()); 22 std::string resolved(resolver.ResolveMojoURL(GURL("mojo:test")).spec());
23 // Resolved must start with |base_url|. 23 // Resolved must start with |base_url|.
24 EXPECT_EQ(base_url.spec(), resolved.substr(0, base_url.spec().size())); 24 EXPECT_EQ(base_url.spec(), resolved.substr(0, base_url.spec().size()));
25 // And must contain foo. 25 // And must contain foo.
26 EXPECT_NE(std::string::npos, resolved.find("foo")); 26 EXPECT_NE(std::string::npos, resolved.find("foo"));
27 } 27 }
28 28
29 } // namespace 29 } // namespace
30 } // namespace test 30 } // namespace test
31 } // namespace shell 31 } // namespace shell
32 } // namespace mojo 32 } // namespace mojo
OLDNEW
« shell/url_resolver.h ('K') | « shell/url_resolver.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698