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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator_browsertest.cc

Issue 10384106: Extract StartupTabs and startup types from StartupBrowserCreator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
===================================================================
--- chrome/browser/ui/startup/startup_browser_creator_browsertest.cc (revision 136582)
+++ chrome/browser/ui/startup/startup_browser_creator_browsertest.cc (working copy)
@@ -20,6 +20,7 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/startup/startup_browser_creator.h"
+#include "chrome/browser/ui/startup/startup_browser_creator_impl.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
@@ -109,8 +110,8 @@
};
// Test that when there is a popup as the active browser any requests to
-// StartupBrowserCreator::LaunchWithProfile::OpenURLsInBrowser don't crash
-// because there's no explicit profile given.
+// StartupBrowserCreatorImpl::OpenURLsInBrowser don't crash because there's no
+// explicit profile given.
IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, OpenURLsPopup) {
std::vector<GURL> urls;
urls.push_back(GURL("http://localhost"));
@@ -129,10 +130,10 @@
ASSERT_EQ(popup, observer.added_browser_);
CommandLine dummy(CommandLine::NO_PROGRAM);
- StartupBrowserCreator::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
- StartupBrowserCreator::IS_FIRST_RUN :
- StartupBrowserCreator::IS_NOT_FIRST_RUN;
- StartupBrowserCreator::LaunchWithProfile launch(FilePath(), dummy, first_run);
+ browser::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
+ browser::startup::IS_FIRST_RUN :
+ browser::startup::IS_NOT_FIRST_RUN;
+ StartupBrowserCreatorImpl launch(FilePath(), dummy, first_run);
// This should create a new window, but re-use the profile from |popup|. If
// it used a NULL or invalid profile, it would crash.
launch.OpenURLsInBrowser(popup, false, urls);
@@ -165,10 +166,10 @@
// Do a simple non-process-startup browser launch.
CommandLine dummy(CommandLine::NO_PROGRAM);
- StartupBrowserCreator::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
- StartupBrowserCreator::IS_FIRST_RUN :
- StartupBrowserCreator::IS_NOT_FIRST_RUN;
- StartupBrowserCreator::LaunchWithProfile launch(FilePath(), dummy, first_run);
+ browser::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
+ browser::startup::IS_FIRST_RUN :
+ browser::startup::IS_NOT_FIRST_RUN;
+ StartupBrowserCreatorImpl launch(FilePath(), dummy, first_run);
ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false));
// This should have created a new browser window. |browser()| is still
@@ -209,10 +210,9 @@
// Do a simple non-process-startup browser launch.
CommandLine dummy(CommandLine::NO_PROGRAM);
- StartupBrowserCreator::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
- StartupBrowserCreator::IS_FIRST_RUN :
- StartupBrowserCreator::IS_NOT_FIRST_RUN;
- StartupBrowserCreator::LaunchWithProfile launch(FilePath(), dummy, first_run);
+ browser::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
+ browser::startup::IS_FIRST_RUN : browser::startup::IS_NOT_FIRST_RUN;
+ StartupBrowserCreatorImpl launch(FilePath(), dummy, first_run);
ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false));
// This should have created a new browser window.
@@ -234,11 +234,9 @@
CommandLine command_line(CommandLine::NO_PROGRAM);
command_line.AppendSwitchASCII(switches::kAppId, extension_app->id());
- StartupBrowserCreator::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
- StartupBrowserCreator::IS_FIRST_RUN :
- StartupBrowserCreator::IS_NOT_FIRST_RUN;
- StartupBrowserCreator::LaunchWithProfile launch(FilePath(), command_line,
- first_run);
+ browser::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
+ browser::startup::IS_FIRST_RUN : browser::startup::IS_NOT_FIRST_RUN;
+ StartupBrowserCreatorImpl launch(FilePath(), command_line, first_run);
ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false));
// No pref was set, so the app should have opened in a window.
@@ -264,11 +262,9 @@
CommandLine command_line(CommandLine::NO_PROGRAM);
command_line.AppendSwitchASCII(switches::kAppId, extension_app->id());
- StartupBrowserCreator::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
- StartupBrowserCreator::IS_FIRST_RUN :
- StartupBrowserCreator::IS_NOT_FIRST_RUN;
- StartupBrowserCreator::LaunchWithProfile launch(FilePath(), command_line,
- first_run);
+ browser::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
+ browser::startup::IS_FIRST_RUN : browser::startup::IS_NOT_FIRST_RUN;
+ StartupBrowserCreatorImpl launch(FilePath(), command_line, first_run);
ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false));
// Pref was set to open in a window, so the app should have opened in a
@@ -296,11 +292,9 @@
CommandLine command_line(CommandLine::NO_PROGRAM);
command_line.AppendSwitchASCII(switches::kAppId, extension_app->id());
- StartupBrowserCreator::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
- StartupBrowserCreator::IS_FIRST_RUN :
- StartupBrowserCreator::IS_NOT_FIRST_RUN;
- StartupBrowserCreator::LaunchWithProfile launch(FilePath(), command_line,
- first_run);
+ browser::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
+ browser::startup::IS_FIRST_RUN : browser::startup::IS_NOT_FIRST_RUN;
+ StartupBrowserCreatorImpl launch(FilePath(), command_line, first_run);
ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false));
// When an app shortcut is open and the pref indicates a tab should
@@ -327,11 +321,9 @@
CommandLine command_line(CommandLine::NO_PROGRAM);
command_line.AppendSwitchASCII(switches::kAppId, extension_app->id());
- StartupBrowserCreator::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
- StartupBrowserCreator::IS_FIRST_RUN :
- StartupBrowserCreator::IS_NOT_FIRST_RUN;
- StartupBrowserCreator::LaunchWithProfile launch(FilePath(), command_line,
- first_run);
+ browser::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
+ browser::startup::IS_FIRST_RUN : browser::startup::IS_NOT_FIRST_RUN;
+ StartupBrowserCreatorImpl launch(FilePath(), command_line, first_run);
ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false));
// The launch should have created a new browser, with a panel type.
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator.cc ('k') | chrome/browser/ui/startup/startup_browser_creator_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698