OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/test/browser_test_base.h" |
| 6 |
| 7 #include "base/command_line.h" |
| 8 #include "base/task.h" |
| 9 #include "content/common/main_function_params.h" |
| 10 #include "sandbox/src/dep.h" |
| 11 |
| 12 #if defined(OS_MACOSX) |
| 13 #include "base/mac/mac_util.h" |
| 14 #include "base/system_monitor/system_monitor.h" |
| 15 #endif |
| 16 |
| 17 extern int BrowserMain(const MainFunctionParams&); |
| 18 |
| 19 BrowserTestBase::BrowserTestBase() { |
| 20 #if defined(OS_MACOSX) |
| 21 base::mac::SetOverrideAmIBundled(true); |
| 22 base::SystemMonitor::AllocateSystemIOPorts(); |
| 23 #endif |
| 24 } |
| 25 |
| 26 BrowserTestBase::~BrowserTestBase() { |
| 27 } |
| 28 |
| 29 void BrowserTestBase::SetUp() { |
| 30 SandboxInitWrapper sandbox_wrapper; |
| 31 MainFunctionParams params(*CommandLine::ForCurrentProcess(), |
| 32 sandbox_wrapper, |
| 33 NULL); |
| 34 params.ui_task = |
| 35 NewRunnableMethod(this, &BrowserTestBase::ProxyRunTestOnMainThreadLoop); |
| 36 |
| 37 SetUpInProcessBrowserTestFixture(); |
| 38 BrowserMain(params); |
| 39 TearDownInProcessBrowserTestFixture(); |
| 40 } |
| 41 |
| 42 void BrowserTestBase::TearDown() { |
| 43 } |
| 44 |
| 45 void BrowserTestBase::ProxyRunTestOnMainThreadLoop() { |
| 46 RunTestOnMainThreadLoop(); |
| 47 } |
OLD | NEW |