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/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/ui/browser.h" | 21 #include "chrome/browser/ui/browser.h" |
22 #include "chrome/browser/ui/browser_list.h" | 22 #include "chrome/browser/ui/browser_list.h" |
23 #include "chrome/browser/ui/browser_navigator.h" | 23 #include "chrome/browser/ui/browser_navigator.h" |
24 #include "chrome/browser/ui/browser_window.h" | 24 #include "chrome/browser/ui/browser_window.h" |
25 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 25 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
26 #include "chrome/common/chrome_constants.h" | 26 #include "chrome/common/chrome_constants.h" |
27 #include "chrome/common/chrome_paths.h" | 27 #include "chrome/common/chrome_paths.h" |
28 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
29 #include "chrome/common/logging_chrome.h" | 29 #include "chrome/common/logging_chrome.h" |
30 #include "chrome/common/url_constants.h" | 30 #include "chrome/common/url_constants.h" |
| 31 #include "chrome/renderer/chrome_content_renderer_client.h" |
31 #include "chrome/test/base/chrome_test_suite.h" | 32 #include "chrome/test/base/chrome_test_suite.h" |
32 #include "chrome/test/base/test_launcher_utils.h" | 33 #include "chrome/test/base/test_launcher_utils.h" |
33 #include "chrome/test/base/testing_browser_process.h" | 34 #include "chrome/test/base/testing_browser_process.h" |
34 #include "chrome/test/base/ui_test_utils.h" | 35 #include "chrome/test/base/ui_test_utils.h" |
35 #include "content/public/browser/notification_service.h" | 36 #include "content/public/browser/notification_service.h" |
36 #include "content/public/browser/notification_types.h" | 37 #include "content/public/browser/notification_types.h" |
37 #include "content/public/browser/render_process_host.h" | 38 #include "content/public/browser/render_process_host.h" |
38 #include "content/public/test/test_browser_thread.h" | 39 #include "content/public/test/test_browser_thread.h" |
39 #include "content/public/test/test_launcher.h" | 40 #include "content/public/test/test_launcher.h" |
40 #include "content/renderer/mock_content_renderer_client.h" | |
41 #include "net/base/mock_host_resolver.h" | 41 #include "net/base/mock_host_resolver.h" |
42 #include "net/test/test_server.h" | 42 #include "net/test/test_server.h" |
43 #include "ui/compositor/compositor_switches.h" | 43 #include "ui/compositor/compositor_switches.h" |
44 | 44 |
45 #if defined(OS_CHROMEOS) | 45 #if defined(OS_CHROMEOS) |
46 #include "chrome/browser/chromeos/audio/audio_handler.h" | 46 #include "chrome/browser/chromeos/audio/audio_handler.h" |
47 #elif defined(OS_MACOSX) | 47 #elif defined(OS_MACOSX) |
48 #include "base/mac/scoped_nsautorelease_pool.h" | 48 #include "base/mac/scoped_nsautorelease_pool.h" |
49 #endif | 49 #endif |
50 | 50 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // Allow subclasses the opportunity to make changes to the default user data | 107 // Allow subclasses the opportunity to make changes to the default user data |
108 // dir before running any tests. | 108 // dir before running any tests. |
109 ASSERT_TRUE(SetUpUserDataDirectory()) | 109 ASSERT_TRUE(SetUpUserDataDirectory()) |
110 << "Could not set up user data directory."; | 110 << "Could not set up user data directory."; |
111 | 111 |
112 // Single-process mode is not set in BrowserMain, so process it explicitly, | 112 // Single-process mode is not set in BrowserMain, so process it explicitly, |
113 // and set up renderer. | 113 // and set up renderer. |
114 if (command_line->HasSwitch(switches::kSingleProcess)) { | 114 if (command_line->HasSwitch(switches::kSingleProcess)) { |
115 content::RenderProcessHost::set_run_renderer_in_process(true); | 115 content::RenderProcessHost::set_run_renderer_in_process(true); |
116 single_process_renderer_client_.reset( | 116 single_process_renderer_client_.reset( |
117 new content::MockContentRendererClient); | 117 new chrome::ChromeContentRendererClient); |
118 content::GetContentClient()->set_renderer( | 118 content::GetContentClient()->set_renderer_for_testing( |
119 single_process_renderer_client_.get()); | 119 single_process_renderer_client_.get()); |
120 } | 120 } |
121 | 121 |
122 #if defined(OS_CHROMEOS) | 122 #if defined(OS_CHROMEOS) |
123 // Make sure that the log directory exists. | 123 // Make sure that the log directory exists. |
124 FilePath log_dir = logging::GetSessionLogFile(*command_line).DirName(); | 124 FilePath log_dir = logging::GetSessionLogFile(*command_line).DirName(); |
125 file_util::CreateDirectory(log_dir); | 125 file_util::CreateDirectory(log_dir); |
126 #endif // defined(OS_CHROMEOS) | 126 #endif // defined(OS_CHROMEOS) |
127 | 127 |
128 host_resolver_ = new net::RuleBasedHostResolverProc(NULL); | 128 host_resolver_ = new net::RuleBasedHostResolverProc(NULL); |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 // On the Mac, this eventually reaches | 396 // On the Mac, this eventually reaches |
397 // -[BrowserWindowController windowWillClose:], which will post a deferred | 397 // -[BrowserWindowController windowWillClose:], which will post a deferred |
398 // -autorelease on itself to ultimately destroy the Browser object. The line | 398 // -autorelease on itself to ultimately destroy the Browser object. The line |
399 // below is necessary to pump these pending messages to ensure all Browsers | 399 // below is necessary to pump these pending messages to ensure all Browsers |
400 // get deleted. | 400 // get deleted. |
401 ui_test_utils::RunAllPendingInMessageLoop(); | 401 ui_test_utils::RunAllPendingInMessageLoop(); |
402 delete autorelease_pool_; | 402 delete autorelease_pool_; |
403 autorelease_pool_ = NULL; | 403 autorelease_pool_ = NULL; |
404 #endif | 404 #endif |
405 } | 405 } |
OLD | NEW |