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

Side by Side Diff: mojo/shell/fetcher/url_resolver_unittest.cc

Issue 1701933004: Remove the old package manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@am2
Patch Set: . Created 4 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 | « mojo/shell/fetcher/url_resolver.cc ('k') | mojo/shell/identity.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 "mojo/shell/fetcher/url_resolver.h"
6
7 #include "base/files/file_util.h"
8 #include "base/files/scoped_temp_dir.h"
9 #include "base/logging.h"
10 #include "mojo/util/filename_util.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12
13 namespace mojo {
14 namespace shell {
15 namespace test {
16 namespace {
17
18 typedef testing::Test URLResolverTest;
19
20 TEST_F(URLResolverTest, TestQueryForBaseFileURL) {
21 URLResolver resolver(GURL("file:///base"));
22 GURL mapped_url = resolver.ResolveMojoURL(GURL("mojo:foo?a=b"));
23 EXPECT_EQ("file:///base/foo/foo.mojo?a=b", mapped_url.spec());
24 }
25
26 TEST_F(URLResolverTest, TestQueryForBaseHttpURL) {
27 URLResolver resolver(GURL("http://127.0.0.1:1234"));
28 GURL mapped_url = resolver.ResolveMojoURL(GURL("mojo:foo?a=b"));
29 EXPECT_EQ("http://127.0.0.1:1234/foo/foo.mojo?a=b", mapped_url.spec());
30 }
31
32 TEST_F(URLResolverTest, TestManifest) {
33 URLResolver resolver(GURL("file:///base"));
34 {
35 GURL mapped_url = resolver.ResolveMojoManifest(GURL("mojo:foo"));
36 EXPECT_EQ("file:///base/foo/manifest.json", mapped_url.spec());
37 }
38 {
39 GURL mapped_url = resolver.ResolveMojoManifest(GURL("exe:foo"));
40 EXPECT_EQ("file:///base/foo_manifest.json", mapped_url.spec());
41 }
42 {
43 GURL mapped_url = resolver.ResolveMojoManifest(GURL("http://localhost/"));
44 EXPECT_TRUE(mapped_url.is_empty());
45 }
46 }
47
48 } // namespace
49 } // namespace test
50 } // namespace shell
51 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/fetcher/url_resolver.cc ('k') | mojo/shell/identity.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698