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/process_util.h" | 10 #include "base/process_util.h" |
11 #include "content/public/common/content_switches.h" | 11 #include "content/public/common/content_switches.h" |
12 #include "content/public/common/main_function_params.h" | 12 #include "content/public/common/main_function_params.h" |
| 13 #include "content/public/test/test_launcher_utils.h" |
13 | 14 |
14 #if defined(OS_MACOSX) | 15 #if defined(OS_MACOSX) |
15 #include "base/mac/mac_util.h" | 16 #include "base/mac/mac_util.h" |
16 #include "base/system_monitor/system_monitor.h" | 17 #include "base/system_monitor/system_monitor.h" |
17 #endif | 18 #endif |
18 | 19 |
19 extern int BrowserMain(const content::MainFunctionParams&); | 20 extern int BrowserMain(const content::MainFunctionParams&); |
20 | 21 |
21 namespace { | 22 namespace { |
22 | 23 |
(...skipping 26 matching lines...) Expand all Loading... |
49 handle_sigterm_ = true; | 50 handle_sigterm_ = true; |
50 #endif | 51 #endif |
51 } | 52 } |
52 | 53 |
53 BrowserTestBase::~BrowserTestBase() { | 54 BrowserTestBase::~BrowserTestBase() { |
54 } | 55 } |
55 | 56 |
56 void BrowserTestBase::SetUp() { | 57 void BrowserTestBase::SetUp() { |
57 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 58 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
58 | 59 |
| 60 // common command line preparation for tests |
| 61 PrepareBrowserCommandLineForTests(command_line); |
| 62 |
59 // The tests assume that file:// URIs can freely access other file:// URIs. | 63 // The tests assume that file:// URIs can freely access other file:// URIs. |
60 command_line->AppendSwitch(switches::kAllowFileAccessFromFiles); | 64 command_line->AppendSwitch(switches::kAllowFileAccessFromFiles); |
61 | 65 |
62 command_line->AppendSwitch(switches::kDomAutomationController); | 66 command_line->AppendSwitch(switches::kDomAutomationController); |
63 | 67 |
64 MainFunctionParams params(*command_line); | 68 MainFunctionParams params(*command_line); |
65 params.ui_task = | 69 params.ui_task = |
66 new base::Closure( | 70 new base::Closure( |
67 base::Bind(&BrowserTestBase::ProxyRunTestOnMainThreadLoop, this)); | 71 base::Bind(&BrowserTestBase::ProxyRunTestOnMainThreadLoop, this)); |
68 | 72 |
(...skipping 17 matching lines...) Expand all Loading... |
86 | 90 |
87 void BrowserTestBase::CreateTestServer(const char* test_server_base) { | 91 void BrowserTestBase::CreateTestServer(const char* test_server_base) { |
88 CHECK(!test_server_.get()); | 92 CHECK(!test_server_.get()); |
89 test_server_.reset(new net::TestServer( | 93 test_server_.reset(new net::TestServer( |
90 net::TestServer::TYPE_HTTP, | 94 net::TestServer::TYPE_HTTP, |
91 net::TestServer::kLocalhost, | 95 net::TestServer::kLocalhost, |
92 FilePath().AppendASCII(test_server_base))); | 96 FilePath().AppendASCII(test_server_base))); |
93 } | 97 } |
94 | 98 |
95 } // namespace content | 99 } // namespace content |
OLD | NEW |