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/i18n/icu_util.h" | 10 #include "base/i18n/icu_util.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 SetUpInProcessBrowserTestFixture(); | 232 SetUpInProcessBrowserTestFixture(); |
233 | 233 |
234 base::Closure* ui_task = | 234 base::Closure* ui_task = |
235 new base::Closure( | 235 new base::Closure( |
236 base::Bind(&BrowserTestBase::ProxyRunTestOnMainThreadLoop, this)); | 236 base::Bind(&BrowserTestBase::ProxyRunTestOnMainThreadLoop, this)); |
237 | 237 |
238 #if defined(OS_ANDROID) | 238 #if defined(OS_ANDROID) |
239 MainFunctionParams params(*command_line); | 239 MainFunctionParams params(*command_line); |
240 params.ui_task = ui_task; | 240 params.ui_task = ui_task; |
241 // TODO(phajdan.jr): Check return code, http://crbug.com/374738 . | 241 // TODO(phajdan.jr): Check return code, http://crbug.com/374738 . |
242 BrowserMainRunner::Create()->Initialize(params); | 242 BrowserMain(params); |
243 // We are done running the test by now. During teardown we | |
244 // need to be able to perform IO. | |
245 base::ThreadRestrictions::SetIOAllowed(true); | |
246 BrowserThread::PostTask( | |
247 BrowserThread::IO, FROM_HERE, | |
248 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), | |
249 true)); | |
250 #else | 243 #else |
251 GetContentMainParams()->ui_task = ui_task; | 244 GetContentMainParams()->ui_task = ui_task; |
252 EXPECT_EQ(expected_exit_code_, ContentMain(*GetContentMainParams())); | 245 EXPECT_EQ(expected_exit_code_, ContentMain(*GetContentMainParams())); |
253 #endif | 246 #endif |
254 TearDownInProcessBrowserTestFixture(); | 247 TearDownInProcessBrowserTestFixture(); |
255 } | 248 } |
256 | 249 |
257 void BrowserTestBase::TearDown() { | 250 void BrowserTestBase::TearDown() { |
258 } | 251 } |
259 | 252 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 use_software_compositing_ = true; | 294 use_software_compositing_ = true; |
302 } | 295 } |
303 | 296 |
304 bool BrowserTestBase::UsingOSMesa() const { | 297 bool BrowserTestBase::UsingOSMesa() const { |
305 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 298 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
306 return cmd->GetSwitchValueASCII(switches::kUseGL) == | 299 return cmd->GetSwitchValueASCII(switches::kUseGL) == |
307 gfx::kGLImplementationOSMesaName; | 300 gfx::kGLImplementationOSMesaName; |
308 } | 301 } |
309 | 302 |
310 } // namespace content | 303 } // namespace content |
OLD | NEW |