| 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 } | |
| 146 case base::DIR_ANDROID_APP_DATA: { | 143 case base::DIR_ANDROID_APP_DATA: { |
| 147 // For tests, app data is put in external storage. | 144 // For tests, app data is put in external storage. |
| 148 return base::android::GetExternalStorageDirectory(result); | 145 return base::android::GetExternalStorageDirectory(result); |
| 149 } | 146 } |
| 150 default: | 147 default: |
| 151 return false; | 148 return false; |
| 152 } | 149 } |
| 153 } | 150 } |
| 154 | 151 |
| 155 void InitPathProvider(int key) { | 152 void InitPathProvider(int key) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 183 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub)) | 180 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub)) |
| 184 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; | 181 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; |
| 185 } | 182 } |
| 186 | 183 |
| 187 void InitAndroidTest() { | 184 void InitAndroidTest() { |
| 188 InitAndroidTestLogging(); | 185 InitAndroidTestLogging(); |
| 189 InitAndroidTestPaths(); | 186 InitAndroidTestPaths(); |
| 190 InitAndroidTestMessageLoop(); | 187 InitAndroidTestMessageLoop(); |
| 191 } | 188 } |
| 192 } // namespace base | 189 } // namespace base |
| OLD | NEW |