| 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 "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "components/google/core/browser/google_util.h" | 52 #include "components/google/core/browser/google_util.h" |
| 53 #include "components/os_crypt/os_crypt.h" | 53 #include "components/os_crypt/os_crypt.h" |
| 54 #include "content/public/browser/devtools_agent_host.h" | 54 #include "content/public/browser/devtools_agent_host.h" |
| 55 #include "content/public/browser/notification_service.h" | 55 #include "content/public/browser/notification_service.h" |
| 56 #include "content/public/browser/notification_types.h" | 56 #include "content/public/browser/notification_types.h" |
| 57 #include "content/public/common/content_switches.h" | 57 #include "content/public/common/content_switches.h" |
| 58 #include "content/public/test/browser_test_utils.h" | 58 #include "content/public/test/browser_test_utils.h" |
| 59 #include "content/public/test/test_launcher.h" | 59 #include "content/public/test/test_launcher.h" |
| 60 #include "content/public/test/test_navigation_observer.h" | 60 #include "content/public/test/test_navigation_observer.h" |
| 61 #include "net/test/embedded_test_server/embedded_test_server.h" | 61 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 62 #include "net/test/spawned_test_server/spawned_test_server.h" | |
| 63 | 62 |
| 64 #if defined(OS_MACOSX) | 63 #if defined(OS_MACOSX) |
| 65 #include "base/mac/scoped_nsautorelease_pool.h" | 64 #include "base/mac/scoped_nsautorelease_pool.h" |
| 66 #include "chrome/test/base/scoped_bundle_swizzler_mac.h" | 65 #include "chrome/test/base/scoped_bundle_swizzler_mac.h" |
| 67 #endif | 66 #endif |
| 68 | 67 |
| 69 #if defined(OS_WIN) | 68 #if defined(OS_WIN) |
| 70 #include "base/win/scoped_com_initializer.h" | 69 #include "base/win/scoped_com_initializer.h" |
| 71 #include "base/win/windows_version.h" | 70 #include "base/win/windows_version.h" |
| 72 #include "ui/base/win/atl_module.h" | 71 #include "ui/base/win/atl_module.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 #endif // defined(OS_MACOSX) | 184 #endif // defined(OS_MACOSX) |
| 186 | 185 |
| 187 CreateTestServer(base::FilePath(FILE_PATH_LITERAL("chrome/test/data"))); | 186 CreateTestServer(base::FilePath(FILE_PATH_LITERAL("chrome/test/data"))); |
| 188 base::FilePath src_dir; | 187 base::FilePath src_dir; |
| 189 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &src_dir)); | 188 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &src_dir)); |
| 190 base::FilePath test_data_dir = src_dir.AppendASCII("chrome/test/data"); | 189 base::FilePath test_data_dir = src_dir.AppendASCII("chrome/test/data"); |
| 191 | 190 |
| 192 // chrome::DIR_TEST_DATA isn't going to be setup until after we call | 191 // chrome::DIR_TEST_DATA isn't going to be setup until after we call |
| 193 // ContentMain. However that is after tests' constructors or SetUp methods, | 192 // ContentMain. However that is after tests' constructors or SetUp methods, |
| 194 // which sometimes need it. So just override it. | 193 // which sometimes need it. So just override it. |
| 195 CHECK(PathService::Override(chrome::DIR_TEST_DATA, test_data_dir)); | 194 CHECK(PathService::Override(chrome::DIR_TEST_DATA, |
| 195 src_dir.AppendASCII("chrome/test/data"))); |
| 196 | 196 |
| 197 #if defined(OS_MACOSX) | 197 #if defined(OS_MACOSX) |
| 198 bundle_swizzler_.reset(new ScopedBundleSwizzlerMac); | 198 bundle_swizzler_.reset(new ScopedBundleSwizzlerMac); |
| 199 #endif | 199 #endif |
| 200 } | 200 } |
| 201 | 201 |
| 202 InProcessBrowserTest::~InProcessBrowserTest() { | 202 InProcessBrowserTest::~InProcessBrowserTest() { |
| 203 } | 203 } |
| 204 | 204 |
| 205 void InProcessBrowserTest::SetUp() { | 205 void InProcessBrowserTest::SetUp() { |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 // On the Mac, this eventually reaches | 649 // On the Mac, this eventually reaches |
| 650 // -[BrowserWindowController windowWillClose:], which will post a deferred | 650 // -[BrowserWindowController windowWillClose:], which will post a deferred |
| 651 // -autorelease on itself to ultimately destroy the Browser object. The line | 651 // -autorelease on itself to ultimately destroy the Browser object. The line |
| 652 // below is necessary to pump these pending messages to ensure all Browsers | 652 // below is necessary to pump these pending messages to ensure all Browsers |
| 653 // get deleted. | 653 // get deleted. |
| 654 content::RunAllPendingInMessageLoop(); | 654 content::RunAllPendingInMessageLoop(); |
| 655 delete autorelease_pool_; | 655 delete autorelease_pool_; |
| 656 autorelease_pool_ = NULL; | 656 autorelease_pool_ = NULL; |
| 657 #endif | 657 #endif |
| 658 } | 658 } |
| OLD | NEW |