Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(577)

Side by Side Diff: chrome/test/base/chrome_test_suite.cc

Issue 13409003: Hide ContentClient getters from embedders so that they they don't reuse content's embedder API. The… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/chrome_test_suite.h" 5 #include "chrome/test/base/chrome_test_suite.h"
6 6
7 #if defined(OS_CHROMEOS) 7 #if defined(OS_CHROMEOS)
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 #endif 10 #endif
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 class ChromeTestSuiteInitializer : public testing::EmptyTestEventListener { 127 class ChromeTestSuiteInitializer : public testing::EmptyTestEventListener {
128 public: 128 public:
129 ChromeTestSuiteInitializer() { 129 ChromeTestSuiteInitializer() {
130 } 130 }
131 131
132 virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE { 132 virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE {
133 DCHECK(!g_browser_process); 133 DCHECK(!g_browser_process);
134 g_browser_process = new TestingBrowserProcess; 134 g_browser_process = new TestingBrowserProcess;
135 135
136 DCHECK(!content::GetContentClient());
137 content_client_.reset(new chrome::ChromeContentClient); 136 content_client_.reset(new chrome::ChromeContentClient);
137 content::SetContentClient(content_client_.get());
138 // TODO(ios): Bring this back once ChromeContentBrowserClient is building. 138 // TODO(ios): Bring this back once ChromeContentBrowserClient is building.
139 #if !defined(OS_IOS) 139 #if !defined(OS_IOS)
140 browser_content_client_.reset(new chrome::ChromeContentBrowserClient()); 140 browser_content_client_.reset(new chrome::ChromeContentBrowserClient());
141 content_client_->set_browser_for_testing(browser_content_client_.get()); 141 SetBrowserClientForTesting(browser_content_client_.get());
142 #endif 142 #endif
143 content::SetContentClient(content_client_.get());
144 143
145 SetUpHostResolver(); 144 SetUpHostResolver();
146 } 145 }
147 146
148 virtual void OnTestEnd(const testing::TestInfo& test_info) OVERRIDE { 147 virtual void OnTestEnd(const testing::TestInfo& test_info) OVERRIDE {
149 if (g_browser_process) { 148 if (g_browser_process) {
150 delete g_browser_process; 149 delete g_browser_process;
151 g_browser_process = NULL; 150 g_browser_process = NULL;
152 } 151 }
153 152
154 DCHECK_EQ(content_client_.get(), content::GetContentClient());
155 // TODO(ios): Bring this back once ChromeContentBrowserClient is building. 153 // TODO(ios): Bring this back once ChromeContentBrowserClient is building.
156 #if !defined(OS_IOS) 154 #if !defined(OS_IOS)
157 browser_content_client_.reset(); 155 browser_content_client_.reset();
158 #endif 156 #endif
159 content_client_.reset(); 157 content_client_.reset();
160 content::SetContentClient(NULL); 158 content::SetContentClient(NULL);
161 159
162 TearDownHostResolver(); 160 TearDownHostResolver();
163 } 161 }
164 162
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 #if defined(OS_MACOSX) && !defined(OS_IOS) 279 #if defined(OS_MACOSX) && !defined(OS_IOS)
282 base::mac::SetOverrideFrameworkBundle(NULL); 280 base::mac::SetOverrideFrameworkBundle(NULL);
283 #endif 281 #endif
284 282
285 base::StatsTable::set_current(NULL); 283 base::StatsTable::set_current(NULL);
286 stats_table_.reset(); 284 stats_table_.reset();
287 RemoveSharedMemoryFile(stats_filename_); 285 RemoveSharedMemoryFile(stats_filename_);
288 286
289 base::TestSuite::Shutdown(); 287 base::TestSuite::Shutdown();
290 } 288 }
OLDNEW
« no previous file with comments | « chrome/test/base/chrome_render_view_test.cc ('k') | chrome/test/base/in_process_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698