OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/public/test/browser_test_base.h" | 5 #include "content/public/test/browser_test_base.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/stack_trace.h" | 9 #include "base/debug/stack_trace.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
209 net::ScopedDefaultHostResolverProc scoped_local_host_resolver_proc( | 209 net::ScopedDefaultHostResolverProc scoped_local_host_resolver_proc( |
210 rule_based_resolver_.get()); | 210 rule_based_resolver_.get()); |
211 | 211 |
212 SetUpInProcessBrowserTestFixture(); | 212 SetUpInProcessBrowserTestFixture(); |
213 | 213 |
214 MainFunctionParams params(*command_line); | 214 MainFunctionParams params(*command_line); |
215 params.ui_task = | 215 params.ui_task = |
216 new base::Closure( | 216 new base::Closure( |
217 base::Bind(&BrowserTestBase::ProxyRunTestOnMainThreadLoop, this)); | 217 base::Bind(&BrowserTestBase::ProxyRunTestOnMainThreadLoop, this)); |
218 | 218 |
219 #if defined(OS_ANDROID) | |
220 BrowserMainRunner::Create()->Initialize(params); | |
221 // We are done running the test by now. During teardown we | |
Yaron
2013/10/18 23:03:16
It looks like this was added in https://chromiumco
| |
222 // need to be able to perform IO. | |
223 base::ThreadRestrictions::SetIOAllowed(true); | |
224 BrowserThread::PostTask( | |
225 BrowserThread::IO, FROM_HERE, | |
226 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), | |
227 true)); | |
228 #else | |
229 BrowserMain(params); | 219 BrowserMain(params); |
230 #endif | |
231 TearDownInProcessBrowserTestFixture(); | 220 TearDownInProcessBrowserTestFixture(); |
232 } | 221 } |
233 | 222 |
234 void BrowserTestBase::TearDown() { | 223 void BrowserTestBase::TearDown() { |
235 } | 224 } |
236 | 225 |
237 void BrowserTestBase::ProxyRunTestOnMainThreadLoop() { | 226 void BrowserTestBase::ProxyRunTestOnMainThreadLoop() { |
238 #if defined(OS_POSIX) | 227 #if defined(OS_POSIX) |
239 if (handle_sigterm_) { | 228 if (handle_sigterm_) { |
240 g_browser_process_pid = base::GetCurrentProcId(); | 229 g_browser_process_pid = base::GetCurrentProcId(); |
(...skipping 21 matching lines...) Expand all Loading... | |
262 RenderProcessHostImpl::GetInProcessRendererThreadForTesting(); | 251 RenderProcessHostImpl::GetInProcessRendererThreadForTesting(); |
263 CHECK(renderer_loop); | 252 CHECK(renderer_loop); |
264 | 253 |
265 renderer_loop->PostTask( | 254 renderer_loop->PostTask( |
266 FROM_HERE, | 255 FROM_HERE, |
267 base::Bind(&RunTaskOnRendererThread, task, runner->QuitClosure())); | 256 base::Bind(&RunTaskOnRendererThread, task, runner->QuitClosure())); |
268 runner->Run(); | 257 runner->Run(); |
269 } | 258 } |
270 | 259 |
271 } // namespace content | 260 } // namespace content |
OLD | NEW |