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/feature_list.h" | 10 #include "base/feature_list.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 #include "content/public/common/content_switches.h" | 58 #include "content/public/common/content_switches.h" |
59 #include "content/public/test/browser_test_utils.h" | 59 #include "content/public/test/browser_test_utils.h" |
60 #include "content/public/test/test_launcher.h" | 60 #include "content/public/test/test_launcher.h" |
61 #include "content/public/test/test_navigation_observer.h" | 61 #include "content/public/test/test_navigation_observer.h" |
62 #include "net/test/embedded_test_server/embedded_test_server.h" | 62 #include "net/test/embedded_test_server/embedded_test_server.h" |
63 #include "ui/display/display_switches.h" | 63 #include "ui/display/display_switches.h" |
64 | 64 |
65 #if defined(OS_MACOSX) | 65 #if defined(OS_MACOSX) |
66 #include "base/mac/scoped_nsautorelease_pool.h" | 66 #include "base/mac/scoped_nsautorelease_pool.h" |
67 #include "chrome/test/base/scoped_bundle_swizzler_mac.h" | 67 #include "chrome/test/base/scoped_bundle_swizzler_mac.h" |
| 68 #include "ui/base/test/scoped_fake_full_keyboard_access.h" |
68 #endif | 69 #endif |
69 | 70 |
70 #if defined(OS_WIN) | 71 #if defined(OS_WIN) |
71 #include "base/win/scoped_com_initializer.h" | 72 #include "base/win/scoped_com_initializer.h" |
72 #include "base/win/windows_version.h" | 73 #include "base/win/windows_version.h" |
73 #include "ui/base/win/atl_module.h" | 74 #include "ui/base/win/atl_module.h" |
74 #endif | 75 #endif |
75 | 76 |
76 #if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION) | 77 #if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION) |
77 #include "chrome/browser/captive_portal/captive_portal_service.h" | 78 #include "chrome/browser/captive_portal/captive_portal_service.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // which is chromeos specific feature. | 257 // which is chromeos specific feature. |
257 options::BrowserOptionsHandler::DisablePolymerPreloadForTesting(); | 258 options::BrowserOptionsHandler::DisablePolymerPreloadForTesting(); |
258 #endif // defined(OS_CHROMEOS) | 259 #endif // defined(OS_CHROMEOS) |
259 | 260 |
260 // Use hardcoded quota settings to have a consistent testing environment. | 261 // Use hardcoded quota settings to have a consistent testing environment. |
261 const int kQuota = 5 * 1024 * 1024; | 262 const int kQuota = 5 * 1024 * 1024; |
262 quota_settings_ = storage::QuotaSettings(kQuota * 5, kQuota, 0, 0); | 263 quota_settings_ = storage::QuotaSettings(kQuota * 5, kQuota, 0, 0); |
263 ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 264 ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
264 "a_settings_); | 265 "a_settings_); |
265 | 266 |
| 267 #if defined(OS_MACOSX) |
| 268 faked_full_keyboard_access_.reset( |
| 269 new ui::test::ScopedFakeFullKeyboardAccess()); |
| 270 #endif // defined(OS_MACOSX) |
| 271 |
266 BrowserTestBase::SetUp(); | 272 BrowserTestBase::SetUp(); |
267 } | 273 } |
268 | 274 |
269 void InProcessBrowserTest::SetUpDefaultCommandLine( | 275 void InProcessBrowserTest::SetUpDefaultCommandLine( |
270 base::CommandLine* command_line) { | 276 base::CommandLine* command_line) { |
271 // Propagate commandline settings from test_launcher_utils. | 277 // Propagate commandline settings from test_launcher_utils. |
272 test_launcher_utils::PrepareBrowserCommandLineForTests(command_line); | 278 test_launcher_utils::PrepareBrowserCommandLineForTests(command_line); |
273 | 279 |
274 // This is a Browser test. | 280 // This is a Browser test. |
275 command_line->AppendSwitchASCII(switches::kTestType, kBrowserTestType); | 281 command_line->AppendSwitchASCII(switches::kTestType, kBrowserTestType); |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 // On the Mac, this eventually reaches | 628 // On the Mac, this eventually reaches |
623 // -[BrowserWindowController windowWillClose:], which will post a deferred | 629 // -[BrowserWindowController windowWillClose:], which will post a deferred |
624 // -autorelease on itself to ultimately destroy the Browser object. The line | 630 // -autorelease on itself to ultimately destroy the Browser object. The line |
625 // below is necessary to pump these pending messages to ensure all Browsers | 631 // below is necessary to pump these pending messages to ensure all Browsers |
626 // get deleted. | 632 // get deleted. |
627 content::RunAllPendingInMessageLoop(); | 633 content::RunAllPendingInMessageLoop(); |
628 delete autorelease_pool_; | 634 delete autorelease_pool_; |
629 autorelease_pool_ = NULL; | 635 autorelease_pool_ = NULL; |
630 #endif | 636 #endif |
631 } | 637 } |
OLD | NEW |