OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/test/base/in_process_browser_test.h" | 5 #include "chrome/test/base/in_process_browser_test.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 subprocess_path = | 174 subprocess_path = |
175 subprocess_path.Append(chrome::kHelperProcessExecutablePath); | 175 subprocess_path.Append(chrome::kHelperProcessExecutablePath); |
176 command_line->AppendSwitchPath(switches::kBrowserSubprocessPath, | 176 command_line->AppendSwitchPath(switches::kBrowserSubprocessPath, |
177 subprocess_path); | 177 subprocess_path); |
178 #endif | 178 #endif |
179 | 179 |
180 // TODO(pkotwicz): Investigate if we can remove this switch. | 180 // TODO(pkotwicz): Investigate if we can remove this switch. |
181 command_line->AppendSwitch(switches::kDisableZeroBrowsersOpenForTests); | 181 command_line->AppendSwitch(switches::kDisableZeroBrowsersOpenForTests); |
182 | 182 |
183 if (!command_line->HasSwitch(switches::kHomePage)) { | 183 if (!command_line->HasSwitch(switches::kHomePage)) { |
184 command_line->AppendSwitchASCII( | 184 command_line->AppendSwitchASCII( |
185 switches::kHomePage, chrome::kAboutBlankURL); | 185 switches::kHomePage, chrome::kAboutBlankURL); |
186 } | 186 } |
187 if (command_line->GetArgs().empty()) | 187 if (command_line->GetArgs().empty()) |
188 command_line->AppendArg(chrome::kAboutBlankURL); | 188 command_line->AppendArg(chrome::kAboutBlankURL); |
189 } | 189 } |
190 | 190 |
191 bool InProcessBrowserTest::CreateUserDataDirectory() { | 191 bool InProcessBrowserTest::CreateUserDataDirectory() { |
192 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 192 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
193 FilePath user_data_dir = | 193 FilePath user_data_dir = |
194 command_line->GetSwitchValuePath(switches::kUserDataDir); | 194 command_line->GetSwitchValuePath(switches::kUserDataDir); |
195 if (user_data_dir.empty()) { | 195 if (user_data_dir.empty()) { |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 // On the Mac, this eventually reaches | 395 // On the Mac, this eventually reaches |
396 // -[BrowserWindowController windowWillClose:], which will post a deferred | 396 // -[BrowserWindowController windowWillClose:], which will post a deferred |
397 // -autorelease on itself to ultimately destroy the Browser object. The line | 397 // -autorelease on itself to ultimately destroy the Browser object. The line |
398 // below is necessary to pump these pending messages to ensure all Browsers | 398 // below is necessary to pump these pending messages to ensure all Browsers |
399 // get deleted. | 399 // get deleted. |
400 ui_test_utils::RunAllPendingInMessageLoop(); | 400 ui_test_utils::RunAllPendingInMessageLoop(); |
401 delete autorelease_pool_; | 401 delete autorelease_pool_; |
402 autorelease_pool_ = NULL; | 402 autorelease_pool_ = NULL; |
403 #endif | 403 #endif |
404 } | 404 } |
OLD | NEW |