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

Side by Side Diff: shell/mojo_url_resolver_unittest.cc

Issue 868283006: Rename MojoURLResolver to URLResolver (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix test 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
« no previous file with comments | « shell/mojo_url_resolver.cc ('k') | shell/shell_test_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "shell/mojo_url_resolver.h"
6
7 #include "base/logging.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace mojo {
11 namespace shell {
12 namespace test {
13 namespace {
14
15 typedef testing::Test MojoURLResolverTest;
16
17 TEST_F(MojoURLResolverTest, MojoURLsFallThrough) {
18 MojoURLResolver resolver;
19 resolver.AddCustomMapping(GURL("mojo:test"), GURL("mojo:foo"));
20 const GURL base_url("file:/base");
21 resolver.SetBaseURL(base_url);
22 std::string resolved(resolver.Resolve(GURL("mojo:test")).spec());
23 // Resolved must start with |base_url|.
24 EXPECT_EQ(base_url.spec(), resolved.substr(0, base_url.spec().size()));
25 // And must contain foo.
26 EXPECT_NE(std::string::npos, resolved.find("foo"));
27 }
28
29 } // namespace
30 } // namespace test
31 } // namespace shell
32 } // namespace mojo
OLDNEW
« no previous file with comments | « shell/mojo_url_resolver.cc ('k') | shell/shell_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698