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

Unified Diff: chrome/browser/chrome_browser_main_unittest.cc

Issue 8539038: Add ChromeBrowserMainExtraParts for non main parts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again + explicit reset of parts_ Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_browser_main_linux.cc ('k') | chrome/browser/chrome_browser_parts_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main_unittest.cc
diff --git a/chrome/browser/chrome_browser_main_unittest.cc b/chrome/browser/chrome_browser_main_unittest.cc
index 4a2f265a95cfecdb20f5571878aff535ac2c83d6..f5c549b3223d9792964b88d6a627487f1ffe8d00 100644
--- a/chrome/browser/chrome_browser_main_unittest.cc
+++ b/chrome/browser/chrome_browser_main_unittest.cc
@@ -30,12 +30,9 @@ TEST_F(BrowserMainTest, WarmConnectionFieldTrial_WarmestSocket) {
scoped_ptr<content::MainFunctionParams> params(
new content::MainFunctionParams(command_line_));
- ScopedVector<content::BrowserMainParts> bwv;
- content::GetContentClient()->browser()->CreateBrowserMainParts(
- *params, &(bwv.get()));
- ChromeBrowserMainParts* cbw = NULL;
- if (bwv.size() >= 1)
- cbw = static_cast<ChromeBrowserMainParts*>(bwv[0]);
+ scoped_ptr<content::BrowserMainParts> bw(
+ content::GetContentClient()->browser()->CreateBrowserMainParts(*params));
+ ChromeBrowserMainParts* cbw = static_cast<ChromeBrowserMainParts*>(bw.get());
EXPECT_TRUE(cbw);
if (cbw) {
cbw->WarmConnectionFieldTrial();
@@ -46,12 +43,9 @@ TEST_F(BrowserMainTest, WarmConnectionFieldTrial_WarmestSocket) {
TEST_F(BrowserMainTest, WarmConnectionFieldTrial_Random) {
scoped_ptr<content::MainFunctionParams> params(
new content::MainFunctionParams(command_line_));
- ScopedVector<content::BrowserMainParts> bwv;
- content::GetContentClient()->browser()->CreateBrowserMainParts(
- *params, &(bwv.get()));
- ChromeBrowserMainParts* cbw = NULL;
- if (bwv.size() >= 1)
- cbw = static_cast<ChromeBrowserMainParts*>(bwv[0]);
+ scoped_ptr<content::BrowserMainParts> bw(
+ content::GetContentClient()->browser()->CreateBrowserMainParts(*params));
+ ChromeBrowserMainParts* cbw = static_cast<ChromeBrowserMainParts*>(bw.get());
EXPECT_TRUE(cbw);
if (cbw) {
const int kNumRuns = 1000;
@@ -71,17 +65,15 @@ TEST_F(BrowserMainTest, WarmConnectionFieldTrial_Invalid) {
new content::MainFunctionParams(command_line_));
// This test ends up launching a new process, and that doesn't initialize the
// ContentClient interfaces.
- ScopedVector<content::BrowserMainParts> bwv;
+ scoped_ptr<content::BrowserMainParts> bw;
if (content::GetContentClient()) {
- content::GetContentClient()->browser()->CreateBrowserMainParts(
- *params, &(bwv.get()));
+ bw.reset(content::GetContentClient()->browser()->CreateBrowserMainParts(
+ *params));
} else {
chrome::ChromeContentBrowserClient ccbc;
- ccbc.CreateBrowserMainParts(*params, &(bwv.get()));
+ bw.reset(ccbc.CreateBrowserMainParts(*params));
}
- ChromeBrowserMainParts* cbw = NULL;
- if (bwv.size() >= 1)
- cbw = static_cast<ChromeBrowserMainParts*>(bwv[0]);
+ ChromeBrowserMainParts* cbw = static_cast<ChromeBrowserMainParts*>(bw.get());
EXPECT_TRUE(cbw);
if (cbw) {
#if defined(NDEBUG) && defined(DCHECK_ALWAYS_ON)
« no previous file with comments | « chrome/browser/chrome_browser_main_linux.cc ('k') | chrome/browser/chrome_browser_parts_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698