| 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 23 matching lines...) Expand all Loading... |
| 34 #include "chrome/common/chrome_paths.h" | 34 #include "chrome/common/chrome_paths.h" |
| 35 #include "chrome/common/chrome_switches.h" | 35 #include "chrome/common/chrome_switches.h" |
| 36 #include "chrome/common/logging_chrome.h" | 36 #include "chrome/common/logging_chrome.h" |
| 37 #include "chrome/common/url_constants.h" | 37 #include "chrome/common/url_constants.h" |
| 38 #include "chrome/renderer/chrome_content_renderer_client.h" | 38 #include "chrome/renderer/chrome_content_renderer_client.h" |
| 39 #include "chrome/test/base/chrome_test_suite.h" | 39 #include "chrome/test/base/chrome_test_suite.h" |
| 40 #include "chrome/test/base/test_launcher_utils.h" | 40 #include "chrome/test/base/test_launcher_utils.h" |
| 41 #include "chrome/test/base/test_switches.h" | 41 #include "chrome/test/base/test_switches.h" |
| 42 #include "chrome/test/base/testing_browser_process.h" | 42 #include "chrome/test/base/testing_browser_process.h" |
| 43 #include "chrome/test/base/ui_test_utils.h" | 43 #include "chrome/test/base/ui_test_utils.h" |
| 44 #include "components/encryptor/encryptor.h" | 44 #include "components/encryptor/os_crypt.h" |
| 45 #include "content/public/browser/notification_service.h" | 45 #include "content/public/browser/notification_service.h" |
| 46 #include "content/public/browser/notification_types.h" | 46 #include "content/public/browser/notification_types.h" |
| 47 #include "content/public/test/browser_test_utils.h" | 47 #include "content/public/test/browser_test_utils.h" |
| 48 #include "content/public/test/test_launcher.h" | 48 #include "content/public/test/test_launcher.h" |
| 49 #include "content/public/test/test_navigation_observer.h" | 49 #include "content/public/test/test_navigation_observer.h" |
| 50 #include "net/test/embedded_test_server/embedded_test_server.h" | 50 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 51 #include "net/test/spawned_test_server/spawned_test_server.h" | 51 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 52 | 52 |
| 53 #if defined(OS_MACOSX) | 53 #if defined(OS_MACOSX) |
| 54 #include "base/mac/scoped_nsautorelease_pool.h" | 54 #include "base/mac/scoped_nsautorelease_pool.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // objects into a higher-level pool. This pool is not recycled in-sync with | 181 // objects into a higher-level pool. This pool is not recycled in-sync with |
| 182 // the message loops' pools and causes problems with code relying on | 182 // the message loops' pools and causes problems with code relying on |
| 183 // deallocation via an autorelease pool (such as browser window closure and | 183 // deallocation via an autorelease pool (such as browser window closure and |
| 184 // browser shutdown). To avoid this, the following pool is recycled after each | 184 // browser shutdown). To avoid this, the following pool is recycled after each |
| 185 // time code is directly executed. | 185 // time code is directly executed. |
| 186 autorelease_pool_ = new base::mac::ScopedNSAutoreleasePool; | 186 autorelease_pool_ = new base::mac::ScopedNSAutoreleasePool; |
| 187 | 187 |
| 188 // Always use the MockKeychain if OS encription is used (which is when | 188 // Always use the MockKeychain if OS encription is used (which is when |
| 189 // anything sensitive gets stored, including Cookies). Without this, | 189 // anything sensitive gets stored, including Cookies). Without this, |
| 190 // many tests will hang waiting for a user to approve KeyChain access. | 190 // many tests will hang waiting for a user to approve KeyChain access. |
| 191 Encryptor::UseMockKeychain(true); | 191 OSCrypt::UseMockKeychain(true); |
| 192 #endif | 192 #endif |
| 193 | 193 |
| 194 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 194 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
| 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 |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 // On the Mac, this eventually reaches | 467 // On the Mac, this eventually reaches |
| 468 // -[BrowserWindowController windowWillClose:], which will post a deferred | 468 // -[BrowserWindowController windowWillClose:], which will post a deferred |
| 469 // -autorelease on itself to ultimately destroy the Browser object. The line | 469 // -autorelease on itself to ultimately destroy the Browser object. The line |
| 470 // below is necessary to pump these pending messages to ensure all Browsers | 470 // below is necessary to pump these pending messages to ensure all Browsers |
| 471 // get deleted. | 471 // get deleted. |
| 472 content::RunAllPendingInMessageLoop(); | 472 content::RunAllPendingInMessageLoop(); |
| 473 delete autorelease_pool_; | 473 delete autorelease_pool_; |
| 474 autorelease_pool_ = NULL; | 474 autorelease_pool_ = NULL; |
| 475 #endif | 475 #endif |
| 476 } | 476 } |
| OLD | NEW |