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

Unified Diff: mojo/runner/shell_test_base.cc

Issue 1342503003: Move fetching logic out of ApplicationManager, eliminate url mappings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: mojo/runner/shell_test_base.cc
diff --git a/mojo/runner/shell_test_base.cc b/mojo/runner/shell_test_base.cc
index 820e664da0d3bdeb34a60efa645ba3c334723104..a14f27253bbf90c1573ee2bf15c424f129b4b36f 100644
--- a/mojo/runner/shell_test_base.cc
+++ b/mojo/runner/shell_test_base.cc
@@ -31,18 +31,20 @@ void QuitIfRunning() {
} // namespace
ShellTestBase::ShellTestBase() {
+ base::FilePath shell_dir;
+ PathService::Get(base::DIR_MODULE, &shell_dir);
+ shell_context_.reset(new Context(shell_dir));
}
ShellTestBase::~ShellTestBase() {
}
void ShellTestBase::SetUp() {
- CHECK(shell_context_.Init());
- SetUpTestApplications();
+ CHECK(shell_context_->Init());
}
void ShellTestBase::TearDown() {
- shell_context_.Shutdown();
+ shell_context_->Shutdown();
}
ScopedMessagePipeHandle ShellTestBase::ConnectToService(
@@ -51,7 +53,7 @@ ScopedMessagePipeHandle ShellTestBase::ConnectToService(
ServiceProviderPtr services;
mojo::URLRequestPtr request(mojo::URLRequest::New());
request->url = mojo::String::From(application_url.spec());
- shell_context_.application_manager()->ConnectToApplication(
+ shell_context_->application_manager()->ConnectToApplication(
nullptr, request.Pass(), std::string(), GetProxy(&services), nullptr,
shell::GetPermissiveCapabilityFilter(), base::Bind(&QuitIfRunning),
shell::EmptyConnectCallback());
@@ -60,19 +62,6 @@ ScopedMessagePipeHandle ShellTestBase::ConnectToService(
return pipe.handle0.Pass();
}
-#if !defined(OS_ANDROID)
-void ShellTestBase::SetUpTestApplications() {
- // Set the URLResolver origin to be the same as the base file path for
- // local files. This is primarily for test convenience, so that references
- // to unknown mojo: URLs that do not have specific local file or custom
- // mappings registered on the URL resolver are treated as shared libraries.
- base::FilePath service_dir;
- CHECK(PathService::Get(base::DIR_MODULE, &service_dir));
- shell_context_.url_resolver()->SetMojoBaseURL(
- util::FilePathToFileURL(service_dir));
-}
-#endif
-
} // namespace test
} // namespace runner
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698