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

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

Issue 1057603003: Simplify mojo_shell since it's now only used for Mandoline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update scripts Created 5 years, 8 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/switches.cc ('k') | mojo/tools/android_mojo_shell.py » ('j') | 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 "mojo/shell/url_resolver.h" 5 #include "mojo/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 {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 mappings = URLResolver::GetOriginMappings(args); 108 mappings = URLResolver::GetOriginMappings(args);
109 EXPECT_EQ(0U, mappings.size()); 109 EXPECT_EQ(0U, mappings.size());
110 110
111 args.clear(); 111 args.clear();
112 args.push_back(ARG_LITERAL("--map-origin=")); 112 args.push_back(ARG_LITERAL("--map-origin="));
113 mappings = URLResolver::GetOriginMappings(args); 113 mappings = URLResolver::GetOriginMappings(args);
114 EXPECT_EQ(0U, mappings.size()); 114 EXPECT_EQ(0U, mappings.size());
115 115
116 args.clear(); 116 args.clear();
117 args.push_back(ARG_LITERAL("mojo_shell")); 117 args.push_back(ARG_LITERAL("mojo_shell"));
118 args.push_back(ARG_LITERAL("--args-for=https://a.org/foo --test"));
119 args.push_back(ARG_LITERAL("--map-origin=https://a.org=https://b.org/a")); 118 args.push_back(ARG_LITERAL("--map-origin=https://a.org=https://b.org/a"));
120 args.push_back(ARG_LITERAL("--map-origin=https://b.org=https://c.org/b")); 119 args.push_back(ARG_LITERAL("--map-origin=https://b.org=https://c.org/b"));
121 args.push_back(ARG_LITERAL("https://a.org/foo")); 120 args.push_back(ARG_LITERAL("https://a.org/foo"));
122 mappings = URLResolver::GetOriginMappings(args); 121 mappings = URLResolver::GetOriginMappings(args);
123 ASSERT_EQ(2U, mappings.size()); 122 ASSERT_EQ(2U, mappings.size());
124 EXPECT_EQ("https://a.org", mappings[0].origin); 123 EXPECT_EQ("https://a.org", mappings[0].origin);
125 EXPECT_EQ("https://b.org/a", mappings[0].base_url); 124 EXPECT_EQ("https://b.org/a", mappings[0].base_url);
126 EXPECT_EQ("https://b.org", mappings[1].origin); 125 EXPECT_EQ("https://b.org", mappings[1].origin);
127 EXPECT_EQ("https://c.org/b", mappings[1].base_url); 126 EXPECT_EQ("https://c.org/b", mappings[1].base_url);
128 } 127 }
(...skipping 13 matching lines...) Expand all
142 URLResolver resolver; 141 URLResolver resolver;
143 resolver.SetMojoBaseURL(GURL("file:///base")); 142 resolver.SetMojoBaseURL(GURL("file:///base"));
144 GURL mapped_url = resolver.ResolveMojoURL(GURL("mojo:foo?a=b")); 143 GURL mapped_url = resolver.ResolveMojoURL(GURL("mojo:foo?a=b"));
145 EXPECT_EQ("file:///base/foo.mojo?a=b", mapped_url.spec()); 144 EXPECT_EQ("file:///base/foo.mojo?a=b", mapped_url.spec());
146 } 145 }
147 146
148 } // namespace 147 } // namespace
149 } // namespace test 148 } // namespace test
150 } // namespace shell 149 } // namespace shell
151 } // namespace mojo 150 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/switches.cc ('k') | mojo/tools/android_mojo_shell.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698