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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 captive_portal::CaptivePortalService::set_state_for_testing( | 195 captive_portal::CaptivePortalService::set_state_for_testing( |
196 captive_portal::CaptivePortalService::DISABLED_FOR_TESTING); | 196 captive_portal::CaptivePortalService::DISABLED_FOR_TESTING); |
197 #endif | 197 #endif |
198 | 198 |
199 chrome_browser_net::NetErrorTabHelper::set_state_for_testing( | 199 chrome_browser_net::NetErrorTabHelper::set_state_for_testing( |
200 chrome_browser_net::NetErrorTabHelper::TESTING_FORCE_DISABLED); | 200 chrome_browser_net::NetErrorTabHelper::TESTING_FORCE_DISABLED); |
201 | 201 |
202 google_util::SetMockLinkDoctorBaseURLForTesting(); | 202 google_util::SetMockLinkDoctorBaseURLForTesting(); |
203 | 203 |
204 #if defined(OS_WIN) | 204 #if defined(OS_WIN) |
205 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && | 205 base::win::Version version = base::win::GetVersion(); |
| 206 if (version >= base::win::VERSION_WIN7 && |
206 CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) { | 207 CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) { |
207 com_initializer_.reset(new base::win::ScopedCOMInitializer()); | 208 com_initializer_.reset(new base::win::ScopedCOMInitializer()); |
208 ui::win::CreateATLModuleIfNeeded(); | 209 ui::win::CreateATLModuleIfNeeded(); |
209 ASSERT_TRUE(win8::MakeTestDefaultBrowserSynchronously()); | 210 if (version >= base::win::VERSION_WIN8) |
| 211 ASSERT_TRUE(win8::MakeTestDefaultBrowserSynchronously()); |
210 } | 212 } |
211 #endif | 213 #endif |
212 | 214 |
213 BrowserTestBase::SetUp(); | 215 BrowserTestBase::SetUp(); |
214 } | 216 } |
215 | 217 |
216 void InProcessBrowserTest::PrepareTestCommandLine(CommandLine* command_line) { | 218 void InProcessBrowserTest::PrepareTestCommandLine(CommandLine* command_line) { |
217 // Propagate commandline settings from test_launcher_utils. | 219 // Propagate commandline settings from test_launcher_utils. |
218 test_launcher_utils::PrepareBrowserCommandLineForTests(command_line); | 220 test_launcher_utils::PrepareBrowserCommandLineForTests(command_line); |
219 | 221 |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 // On the Mac, this eventually reaches | 469 // On the Mac, this eventually reaches |
468 // -[BrowserWindowController windowWillClose:], which will post a deferred | 470 // -[BrowserWindowController windowWillClose:], which will post a deferred |
469 // -autorelease on itself to ultimately destroy the Browser object. The line | 471 // -autorelease on itself to ultimately destroy the Browser object. The line |
470 // below is necessary to pump these pending messages to ensure all Browsers | 472 // below is necessary to pump these pending messages to ensure all Browsers |
471 // get deleted. | 473 // get deleted. |
472 content::RunAllPendingInMessageLoop(); | 474 content::RunAllPendingInMessageLoop(); |
473 delete autorelease_pool_; | 475 delete autorelease_pool_; |
474 autorelease_pool_ = NULL; | 476 autorelease_pool_ = NULL; |
475 #endif | 477 #endif |
476 } | 478 } |
OLD | NEW |