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/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 } | 125 } |
126 | 126 |
127 virtual void ScheduleWork() OVERRIDE { | 127 virtual void ScheduleWork() OVERRIDE { |
128 Waitable::GetInstance()->Signal(); | 128 Waitable::GetInstance()->Signal(); |
129 } | 129 } |
130 | 130 |
131 virtual void ScheduleDelayedWork( | 131 virtual void ScheduleDelayedWork( |
132 const base::TimeTicks& delayed_work_time) OVERRIDE { | 132 const base::TimeTicks& delayed_work_time) OVERRIDE { |
133 Waitable::GetInstance()->Signal(); | 133 Waitable::GetInstance()->Signal(); |
134 } | 134 } |
| 135 |
| 136 protected: |
| 137 virtual ~MessagePumpForUIStub() {} |
135 }; | 138 }; |
136 | 139 |
137 base::MessagePump* CreateMessagePumpForUIStub() { | 140 base::MessagePump* CreateMessagePumpForUIStub() { |
138 return new MessagePumpForUIStub(); | 141 return new MessagePumpForUIStub(); |
139 }; | 142 }; |
140 | 143 |
141 // Provides the test path for DIR_MODULE, DIR_CACHE and DIR_ANDROID_APP_DATA. | 144 // Provides the test path for DIR_MODULE, DIR_CACHE and DIR_ANDROID_APP_DATA. |
142 bool GetTestProviderPath(int key, FilePath* result) { | 145 bool GetTestProviderPath(int key, FilePath* result) { |
143 switch (key) { | 146 switch (key) { |
144 case base::DIR_MODULE: { | 147 case base::DIR_MODULE: { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 void InitAndroidTestMessageLoop() { | 190 void InitAndroidTestMessageLoop() { |
188 MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub); | 191 MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub); |
189 } | 192 } |
190 | 193 |
191 void InitAndroidTest() { | 194 void InitAndroidTest() { |
192 InitAndroidTestLogging(); | 195 InitAndroidTestLogging(); |
193 InitAndroidTestPaths(); | 196 InitAndroidTestPaths(); |
194 InitAndroidTestMessageLoop(); | 197 InitAndroidTestMessageLoop(); |
195 } | 198 } |
196 } // namespace base | 199 } // namespace base |
OLD | NEW |