| OLD | NEW |
| 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/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 { | |
| 11 namespace shell { | 10 namespace shell { |
| 12 namespace test { | 11 namespace test { |
| 13 namespace { | 12 namespace { |
| 14 | 13 |
| 15 typedef testing::Test URLResolverTest; | 14 typedef testing::Test URLResolverTest; |
| 16 | 15 |
| 17 TEST_F(URLResolverTest, MojoURLsFallThrough) { | 16 TEST_F(URLResolverTest, MojoURLsFallThrough) { |
| 18 URLResolver resolver; | 17 URLResolver resolver; |
| 19 resolver.AddURLMapping(GURL("mojo:test"), GURL("mojo:foo")); | 18 resolver.AddURLMapping(GURL("mojo:test"), GURL("mojo:foo")); |
| 20 const GURL base_url("file:/base"); | 19 const GURL base_url("file:/base"); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 TEST_F(URLResolverTest, TestQueryForBaseURL) { | 134 TEST_F(URLResolverTest, TestQueryForBaseURL) { |
| 136 URLResolver resolver; | 135 URLResolver resolver; |
| 137 resolver.SetMojoBaseURL(GURL("file:///base")); | 136 resolver.SetMojoBaseURL(GURL("file:///base")); |
| 138 GURL mapped_url = resolver.ResolveMojoURL(GURL("mojo:foo?a=b")); | 137 GURL mapped_url = resolver.ResolveMojoURL(GURL("mojo:foo?a=b")); |
| 139 EXPECT_EQ("file:///base/foo.mojo?a=b", mapped_url.spec()); | 138 EXPECT_EQ("file:///base/foo.mojo?a=b", mapped_url.spec()); |
| 140 } | 139 } |
| 141 | 140 |
| 142 } // namespace | 141 } // namespace |
| 143 } // namespace test | 142 } // namespace test |
| 144 } // namespace shell | 143 } // namespace shell |
| 145 } // namespace mojo | |
| OLD | NEW |