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

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

Issue 10479023: Simplify how Content*Client interfaces are created. Instead of depending on the embedder to know wh… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: remove unused function declaration Created 8 years, 6 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 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/metrics/stats_table.h" 10 #include "base/metrics/stats_table.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 ChromeTestSuiteInitializer() { 98 ChromeTestSuiteInitializer() {
99 } 99 }
100 100
101 virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE { 101 virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE {
102 DCHECK(!g_browser_process); 102 DCHECK(!g_browser_process);
103 g_browser_process = new TestingBrowserProcess; 103 g_browser_process = new TestingBrowserProcess;
104 104
105 DCHECK(!content::GetContentClient()); 105 DCHECK(!content::GetContentClient());
106 content_client_.reset(new chrome::ChromeContentClient); 106 content_client_.reset(new chrome::ChromeContentClient);
107 browser_content_client_.reset(new chrome::ChromeContentBrowserClient()); 107 browser_content_client_.reset(new chrome::ChromeContentBrowserClient());
108 content_client_->set_browser(browser_content_client_.get()); 108 content_client_->set_browser_for_testing(browser_content_client_.get());
109 content::SetContentClient(content_client_.get()); 109 content::SetContentClient(content_client_.get());
110 110
111 SetUpHostResolver(); 111 SetUpHostResolver();
112 } 112 }
113 113
114 virtual void OnTestEnd(const testing::TestInfo& test_info) OVERRIDE { 114 virtual void OnTestEnd(const testing::TestInfo& test_info) OVERRIDE {
115 if (g_browser_process) { 115 if (g_browser_process) {
116 delete g_browser_process; 116 delete g_browser_process;
117 g_browser_process = NULL; 117 g_browser_process = NULL;
118 } 118 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 #if defined(OS_MACOSX) 213 #if defined(OS_MACOSX)
214 base::mac::SetOverrideFrameworkBundle(NULL); 214 base::mac::SetOverrideFrameworkBundle(NULL);
215 #endif 215 #endif
216 216
217 base::StatsTable::set_current(NULL); 217 base::StatsTable::set_current(NULL);
218 stats_table_.reset(); 218 stats_table_.reset();
219 RemoveSharedMemoryFile(stats_filename_); 219 RemoveSharedMemoryFile(stats_filename_);
220 220
221 base::TestSuite::Shutdown(); 221 base::TestSuite::Shutdown();
222 } 222 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698