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/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 160 |
161 // Allow subclasses the opportunity to make changes to the default user data | 161 // Allow subclasses the opportunity to make changes to the default user data |
162 // dir before running any tests. | 162 // dir before running any tests. |
163 ASSERT_TRUE(SetUpUserDataDirectory()) | 163 ASSERT_TRUE(SetUpUserDataDirectory()) |
164 << "Could not set up user data directory."; | 164 << "Could not set up user data directory."; |
165 | 165 |
166 // Single-process mode is not set in BrowserMain, so process it explicitly, | 166 // Single-process mode is not set in BrowserMain, so process it explicitly, |
167 // and set up renderer. | 167 // and set up renderer. |
168 if (command_line->HasSwitch(switches::kSingleProcess)) { | 168 if (command_line->HasSwitch(switches::kSingleProcess)) { |
169 content::SetRendererClientForTesting( | 169 content::SetRendererClientForTesting( |
170 &g_chrome_content_renderer_client.Get()); | 170 g_chrome_content_renderer_client.Pointer()); |
171 } | 171 } |
172 | 172 |
173 #if defined(OS_CHROMEOS) | 173 #if defined(OS_CHROMEOS) |
174 // Make sure that the log directory exists. | 174 // Make sure that the log directory exists. |
175 base::FilePath log_dir = logging::GetSessionLogFile(*command_line).DirName(); | 175 base::FilePath log_dir = logging::GetSessionLogFile(*command_line).DirName(); |
176 base::CreateDirectory(log_dir); | 176 base::CreateDirectory(log_dir); |
177 #endif // defined(OS_CHROMEOS) | 177 #endif // defined(OS_CHROMEOS) |
178 | 178 |
179 #if defined(OS_MACOSX) | 179 #if defined(OS_MACOSX) |
180 // On Mac, without the following autorelease pool, code which is directly | 180 // On Mac, without the following autorelease pool, code which is directly |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 // On the Mac, this eventually reaches | 463 // On the Mac, this eventually reaches |
464 // -[BrowserWindowController windowWillClose:], which will post a deferred | 464 // -[BrowserWindowController windowWillClose:], which will post a deferred |
465 // -autorelease on itself to ultimately destroy the Browser object. The line | 465 // -autorelease on itself to ultimately destroy the Browser object. The line |
466 // below is necessary to pump these pending messages to ensure all Browsers | 466 // below is necessary to pump these pending messages to ensure all Browsers |
467 // get deleted. | 467 // get deleted. |
468 content::RunAllPendingInMessageLoop(); | 468 content::RunAllPendingInMessageLoop(); |
469 delete autorelease_pool_; | 469 delete autorelease_pool_; |
470 autorelease_pool_ = NULL; | 470 autorelease_pool_ = NULL; |
471 #endif | 471 #endif |
472 } | 472 } |
OLD | NEW |