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

Unified Diff: mojo/runner/shell_test_base.cc

Issue 1343823002: Revert of 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
« no previous file with comments | « mojo/runner/shell_test_base.h ('k') | mojo/runner/shell_test_base_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/runner/shell_test_base.cc
diff --git a/mojo/runner/shell_test_base.cc b/mojo/runner/shell_test_base.cc
index 397e2b912632c197670491661ac734c071997b56..820e664da0d3bdeb34a60efa645ba3c334723104 100644
--- a/mojo/runner/shell_test_base.cc
+++ b/mojo/runner/shell_test_base.cc
@@ -30,7 +30,7 @@
} // namespace
-ShellTestBase::ShellTestBase() : shell_context_(GetTestAppFilePath()) {
+ShellTestBase::ShellTestBase() {
}
ShellTestBase::~ShellTestBase() {
@@ -38,6 +38,7 @@
void ShellTestBase::SetUp() {
CHECK(shell_context_.Init());
+ SetUpTestApplications();
}
void ShellTestBase::TearDown() {
@@ -60,10 +61,15 @@
}
#if !defined(OS_ANDROID)
-base::FilePath ShellTestBase::GetTestAppFilePath() const {
- base::FilePath shell_dir;
- PathService::Get(base::DIR_MODULE, &shell_dir);
- return shell_dir;
+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
« no previous file with comments | « mojo/runner/shell_test_base.h ('k') | mojo/runner/shell_test_base_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698