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/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 << "Could not create user data directory."; | 111 << "Could not create user data directory."; |
112 | 112 |
113 // Allow subclasses the opportunity to make changes to the default user data | 113 // Allow subclasses the opportunity to make changes to the default user data |
114 // dir before running any tests. | 114 // dir before running any tests. |
115 ASSERT_TRUE(SetUpUserDataDirectory()) | 115 ASSERT_TRUE(SetUpUserDataDirectory()) |
116 << "Could not set up user data directory."; | 116 << "Could not set up user data directory."; |
117 | 117 |
118 // Single-process mode is not set in BrowserMain, so process it explicitly, | 118 // Single-process mode is not set in BrowserMain, so process it explicitly, |
119 // and set up renderer. | 119 // and set up renderer. |
120 if (command_line->HasSwitch(switches::kSingleProcess)) { | 120 if (command_line->HasSwitch(switches::kSingleProcess)) { |
121 content::GetContentClient()->set_renderer_for_testing( | 121 content::SetRendererClientForTesting( |
122 &g_chrome_content_renderer_client.Get()); | 122 &g_chrome_content_renderer_client.Get()); |
123 } | 123 } |
124 | 124 |
125 #if defined(OS_CHROMEOS) | 125 #if defined(OS_CHROMEOS) |
126 // Make sure that the log directory exists. | 126 // Make sure that the log directory exists. |
127 base::FilePath log_dir = logging::GetSessionLogFile(*command_line).DirName(); | 127 base::FilePath log_dir = logging::GetSessionLogFile(*command_line).DirName(); |
128 file_util::CreateDirectory(log_dir); | 128 file_util::CreateDirectory(log_dir); |
129 #endif // defined(OS_CHROMEOS) | 129 #endif // defined(OS_CHROMEOS) |
130 | 130 |
131 host_resolver_ = new net::RuleBasedHostResolverProc(NULL); | 131 host_resolver_ = new net::RuleBasedHostResolverProc(NULL); |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 // On the Mac, this eventually reaches | 393 // On the Mac, this eventually reaches |
394 // -[BrowserWindowController windowWillClose:], which will post a deferred | 394 // -[BrowserWindowController windowWillClose:], which will post a deferred |
395 // -autorelease on itself to ultimately destroy the Browser object. The line | 395 // -autorelease on itself to ultimately destroy the Browser object. The line |
396 // below is necessary to pump these pending messages to ensure all Browsers | 396 // below is necessary to pump these pending messages to ensure all Browsers |
397 // get deleted. | 397 // get deleted. |
398 content::RunAllPendingInMessageLoop(); | 398 content::RunAllPendingInMessageLoop(); |
399 delete autorelease_pool_; | 399 delete autorelease_pool_; |
400 autorelease_pool_ = NULL; | 400 autorelease_pool_ = NULL; |
401 #endif | 401 #endif |
402 } | 402 } |
OLD | NEW |