OLD | NEW |
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 "shell/shell_test_base.h" | 5 #include "shell/shell_test_base.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 ScopedMessagePipeHandle ShellTestBase::ConnectToService( | 31 ScopedMessagePipeHandle ShellTestBase::ConnectToService( |
32 const GURL& application_url, | 32 const GURL& application_url, |
33 const std::string& service_name) { | 33 const std::string& service_name) { |
34 return shell_context_.ConnectToServiceByName(application_url, service_name) | 34 return shell_context_.ConnectToServiceByName(application_url, service_name) |
35 .Pass(); | 35 .Pass(); |
36 } | 36 } |
37 | 37 |
38 #if !defined(OS_ANDROID) | 38 #if !defined(OS_ANDROID) |
39 void ShellTestBase::SetUpTestApplications() { | 39 void ShellTestBase::SetUpTestApplications() { |
40 // Set the MojoURLResolver origin to be the same as the base file path for | 40 // Set the URLResolver origin to be the same as the base file path for |
41 // local files. This is primarily for test convenience, so that references | 41 // local files. This is primarily for test convenience, so that references |
42 // to unknown mojo: urls that do not have specific local file or custom | 42 // to unknown mojo: urls that do not have specific local file or custom |
43 // mappings registered on the URL resolver are treated as shared libraries. | 43 // mappings registered on the URL resolver are treated as shared libraries. |
44 base::FilePath service_dir; | 44 base::FilePath service_dir; |
45 CHECK(PathService::Get(base::DIR_MODULE, &service_dir)); | 45 CHECK(PathService::Get(base::DIR_MODULE, &service_dir)); |
46 shell_context_.mojo_url_resolver()->SetBaseURL( | 46 shell_context_.url_resolver()->SetMojoBaseURL(FilePathToFileURL(service_dir)); |
47 FilePathToFileURL(service_dir)); | |
48 } | 47 } |
49 #endif | 48 #endif |
50 | 49 |
51 } // namespace test | 50 } // namespace test |
52 } // namespace shell | 51 } // namespace shell |
53 } // namespace mojo | 52 } // namespace mojo |
OLD | NEW |