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 |