summaryrefslogtreecommitdiffstats
path: root/content/test/browser_test_base.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/test/browser_test_base.cc')
-rw-r--r--content/test/browser_test_base.cc47
1 files changed, 47 insertions, 0 deletions
diff --git a/content/test/browser_test_base.cc b/content/test/browser_test_base.cc
new file mode 100644
index 0000000..9a63db0
--- /dev/null
+++ b/content/test/browser_test_base.cc
@@ -0,0 +1,47 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/test/browser_test_base.h"
+
+#include "base/command_line.h"
+#include "base/task.h"
+#include "content/common/main_function_params.h"
+#include "sandbox/src/dep.h"
+
+#if defined(OS_MACOSX)
+#include "base/mac/mac_util.h"
+#include "base/system_monitor/system_monitor.h"
+#endif
+
+extern int BrowserMain(const MainFunctionParams&);
+
+BrowserTestBase::BrowserTestBase() {
+#if defined(OS_MACOSX)
+ base::mac::SetOverrideAmIBundled(true);
+ base::SystemMonitor::AllocateSystemIOPorts();
+#endif
+}
+
+BrowserTestBase::~BrowserTestBase() {
+}
+
+void BrowserTestBase::SetUp() {
+ SandboxInitWrapper sandbox_wrapper;
+ MainFunctionParams params(*CommandLine::ForCurrentProcess(),
+ sandbox_wrapper,
+ NULL);
+ params.ui_task =
+ NewRunnableMethod(this, &BrowserTestBase::ProxyRunTestOnMainThreadLoop);
+
+ SetUpInProcessBrowserTestFixture();
+ BrowserMain(params);
+ TearDownInProcessBrowserTestFixture();
+}
+
+void BrowserTestBase::TearDown() {
+}
+
+void BrowserTestBase::ProxyRunTestOnMainThreadLoop() {
+ RunTestOnMainThreadLoop();
+} \ No newline at end of file