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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_browsertest.cc

Issue 10692195: Consolidate Browser Creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/file_path.h" 6 #include "base/file_path.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/extensions/extension_browsertest.h" 9 #include "chrome/browser/extensions/extension_browsertest.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 urls.push_back(GURL("http://localhost")); 122 urls.push_back(GURL("http://localhost"));
123 123
124 // Note that in our testing we do not ever query the BrowserList for the "last 124 // Note that in our testing we do not ever query the BrowserList for the "last
125 // active" browser. That's because the browsers are set as "active" by 125 // active" browser. That's because the browsers are set as "active" by
126 // platform UI toolkit messages, and those messages are not sent during unit 126 // platform UI toolkit messages, and those messages are not sent during unit
127 // testing sessions. 127 // testing sessions.
128 128
129 OpenURLsPopupObserver observer; 129 OpenURLsPopupObserver observer;
130 BrowserList::AddObserver(&observer); 130 BrowserList::AddObserver(&observer);
131 131
132 Browser* popup = Browser::CreateWithParams( 132 Browser* popup = new Browser(
133 Browser::CreateParams(Browser::TYPE_POPUP, browser()->profile())); 133 Browser::CreateParams(Browser::TYPE_POPUP, browser()->profile()));
134 ASSERT_TRUE(popup->is_type_popup()); 134 ASSERT_TRUE(popup->is_type_popup());
135 ASSERT_EQ(popup, observer.added_browser_); 135 ASSERT_EQ(popup, observer.added_browser_);
136 136
137 CommandLine dummy(CommandLine::NO_PROGRAM); 137 CommandLine dummy(CommandLine::NO_PROGRAM);
138 chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? 138 chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
139 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; 139 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN;
140 StartupBrowserCreatorImpl launch(FilePath(), dummy, first_run); 140 StartupBrowserCreatorImpl launch(FilePath(), dummy, first_run);
141 // This should create a new window, but re-use the profile from |popup|. If 141 // This should create a new window, but re-use the profile from |popup|. If
142 // it used a NULL or invalid profile, it would crash. 142 // it used a NULL or invalid profile, it would crash.
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 ASSERT_EQ(1u, browser::GetBrowserCount(profile_urls)); 661 ASSERT_EQ(1u, browser::GetBrowserCount(profile_urls));
662 new_browser = FindOneOtherBrowserForProfile(profile_urls, NULL); 662 new_browser = FindOneOtherBrowserForProfile(profile_urls, NULL);
663 ASSERT_TRUE(new_browser); 663 ASSERT_TRUE(new_browser);
664 ASSERT_EQ(1, new_browser->tab_count()); 664 ASSERT_EQ(1, new_browser->tab_count());
665 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), 665 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL),
666 chrome::GetWebContentsAt(new_browser, 0)->GetURL()); 666 chrome::GetWebContentsAt(new_browser, 0)->GetURL());
667 EXPECT_EQ(1U, chrome::GetTabContentsAt(new_browser, 0)->infobar_tab_helper()-> 667 EXPECT_EQ(1U, chrome::GetTabContentsAt(new_browser, 0)->infobar_tab_helper()->
668 infobar_count()); 668 infobar_count());
669 } 669 }
670 #endif // !OS_CHROMEOS 670 #endif // !OS_CHROMEOS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698