| 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 scoped_ptr<BrowserMainRunner> runner(BrowserMainRunner::Create()); |
| 243 // We are done running the test by now. During teardown we | 243 runner->Initialize(params); |
| 244 // need to be able to perform IO. | 244 runner->Run(); |
| 245 base::ThreadRestrictions::SetIOAllowed(true); | 245 runner->Shutdown(); |
| 246 BrowserThread::PostTask( | |
| 247 BrowserThread::IO, FROM_HERE, | |
| 248 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), | |
| 249 true)); | |
| 250 #else | 246 #else |
| 251 GetContentMainParams()->ui_task = ui_task; | 247 GetContentMainParams()->ui_task = ui_task; |
| 252 EXPECT_EQ(expected_exit_code_, ContentMain(*GetContentMainParams())); | 248 EXPECT_EQ(expected_exit_code_, ContentMain(*GetContentMainParams())); |
| 253 #endif | 249 #endif |
| 254 TearDownInProcessBrowserTestFixture(); | 250 TearDownInProcessBrowserTestFixture(); |
| 255 } | 251 } |
| 256 | 252 |
| 257 void BrowserTestBase::TearDown() { | 253 void BrowserTestBase::TearDown() { |
| 258 } | 254 } |
| 259 | 255 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 use_software_compositing_ = true; | 297 use_software_compositing_ = true; |
| 302 } | 298 } |
| 303 | 299 |
| 304 bool BrowserTestBase::UsingOSMesa() const { | 300 bool BrowserTestBase::UsingOSMesa() const { |
| 305 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 301 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
| 306 return cmd->GetSwitchValueASCII(switches::kUseGL) == | 302 return cmd->GetSwitchValueASCII(switches::kUseGL) == |
| 307 gfx::kGLImplementationOSMesaName; | 303 gfx::kGLImplementationOSMesaName; |
| 308 } | 304 } |
| 309 | 305 |
| 310 } // namespace content | 306 } // namespace content |
| OLD | NEW |