OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stdarg.h> | 5 #include <stdarg.h> |
6 #include <string.h> | 6 #include <string.h> |
7 | 7 |
8 #include "base/android/path_utils.h" | 8 #include "base/android/path_utils.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } | 133 } |
134 }; | 134 }; |
135 | 135 |
136 scoped_ptr<base::MessagePump> CreateMessagePumpForUIStub() { | 136 scoped_ptr<base::MessagePump> CreateMessagePumpForUIStub() { |
137 return scoped_ptr<base::MessagePump>(new MessagePumpForUIStub()); | 137 return scoped_ptr<base::MessagePump>(new MessagePumpForUIStub()); |
138 }; | 138 }; |
139 | 139 |
140 // Provides the test path for DIR_MODULE and DIR_ANDROID_APP_DATA. | 140 // Provides the test path for DIR_MODULE and DIR_ANDROID_APP_DATA. |
141 bool GetTestProviderPath(int key, base::FilePath* result) { | 141 bool GetTestProviderPath(int key, base::FilePath* result) { |
142 switch (key) { | 142 switch (key) { |
| 143 case base::DIR_MODULE: { |
| 144 return base::android::GetExternalStorageDirectory(result); |
| 145 } |
143 case base::DIR_ANDROID_APP_DATA: { | 146 case base::DIR_ANDROID_APP_DATA: { |
144 // For tests, app data is put in external storage. | 147 // For tests, app data is put in external storage. |
145 return base::android::GetExternalStorageDirectory(result); | 148 return base::android::GetExternalStorageDirectory(result); |
146 } | 149 } |
147 default: | 150 default: |
148 return false; | 151 return false; |
149 } | 152 } |
150 } | 153 } |
151 | 154 |
152 void InitPathProvider(int key) { | 155 void InitPathProvider(int key) { |
(...skipping 27 matching lines...) Expand all Loading... |
180 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub)) | 183 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub)) |
181 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; | 184 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; |
182 } | 185 } |
183 | 186 |
184 void InitAndroidTest() { | 187 void InitAndroidTest() { |
185 InitAndroidTestLogging(); | 188 InitAndroidTestLogging(); |
186 InitAndroidTestPaths(); | 189 InitAndroidTestPaths(); |
187 InitAndroidTestMessageLoop(); | 190 InitAndroidTestMessageLoop(); |
188 } | 191 } |
189 } // namespace base | 192 } // namespace base |
OLD | NEW |