Index: chrome/browser/ui/browser_init_browsertest.cc |
diff --git a/chrome/browser/ui/browser_init_browsertest.cc b/chrome/browser/ui/browser_init_browsertest.cc |
index 4a2fda3c33f411dd65332378dd9112d3cde0bd48..e6ad36b9777efb7ca1ae84b6fc91e0afd47d1161 100644 |
--- a/chrome/browser/ui/browser_init_browsertest.cc |
+++ b/chrome/browser/ui/browser_init_browsertest.cc |
@@ -7,6 +7,7 @@ |
#include "base/utf_string_conversions.h" |
#include "chrome/browser/extensions/extension_browsertest.h" |
#include "chrome/browser/extensions/extension_service.h" |
+#include "chrome/browser/first_run/first_run.h" |
#include "chrome/browser/prefs/session_startup_pref.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/ui/browser.h" |
@@ -95,7 +96,9 @@ IN_PROC_BROWSER_TEST_F(BrowserInitTest, OpenURLsPopup) { |
ASSERT_EQ(popup, observer.added_browser_); |
CommandLine dummy(CommandLine::NO_PROGRAM); |
- BrowserInit::LaunchWithProfile launch(FilePath(), dummy); |
+ BrowserInit::IsFirstRun first_run = FirstRun::IsChromeFirstRun() ? |
+ BrowserInit::IS_FIRST_RUN : BrowserInit::IS_NOT_FIRST_RUN; |
+ BrowserInit::LaunchWithProfile 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); |
@@ -127,7 +130,9 @@ IN_PROC_BROWSER_TEST_F(BrowserInitTest, |
// Do a simple non-process-startup browser launch. |
CommandLine dummy(CommandLine::NO_PROGRAM); |
- BrowserInit::LaunchWithProfile launch(FilePath(), dummy); |
+ BrowserInit::IsFirstRun first_run = FirstRun::IsChromeFirstRun() ? |
+ BrowserInit::IS_FIRST_RUN : BrowserInit::IS_NOT_FIRST_RUN; |
+ BrowserInit::LaunchWithProfile 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 |
@@ -163,7 +168,9 @@ IN_PROC_BROWSER_TEST_F(BrowserInitTest, |
// Do a simple non-process-startup browser launch. |
CommandLine dummy(CommandLine::NO_PROGRAM); |
- BrowserInit::LaunchWithProfile launch(FilePath(), dummy); |
+ BrowserInit::IsFirstRun first_run = FirstRun::IsChromeFirstRun() ? |
+ BrowserInit::IS_FIRST_RUN : BrowserInit::IS_NOT_FIRST_RUN; |
+ BrowserInit::LaunchWithProfile launch(FilePath(), dummy, first_run); |
ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false)); |
// This should have created a new browser window. |
@@ -185,7 +192,9 @@ IN_PROC_BROWSER_TEST_F(BrowserInitTest, OpenAppShortcutNoPref) { |
CommandLine command_line(CommandLine::NO_PROGRAM); |
command_line.AppendSwitchASCII(switches::kAppId, extension_app->id()); |
- BrowserInit::LaunchWithProfile launch(FilePath(), command_line); |
+ BrowserInit::IsFirstRun first_run = FirstRun::IsChromeFirstRun() ? |
+ BrowserInit::IS_FIRST_RUN : BrowserInit::IS_NOT_FIRST_RUN; |
+ BrowserInit::LaunchWithProfile 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. |
@@ -211,7 +220,9 @@ IN_PROC_BROWSER_TEST_F(BrowserInitTest, OpenAppShortcutWindowPref) { |
CommandLine command_line(CommandLine::NO_PROGRAM); |
command_line.AppendSwitchASCII(switches::kAppId, extension_app->id()); |
- BrowserInit::LaunchWithProfile launch(FilePath(), command_line); |
+ BrowserInit::IsFirstRun first_run = FirstRun::IsChromeFirstRun() ? |
+ BrowserInit::IS_FIRST_RUN : BrowserInit::IS_NOT_FIRST_RUN; |
+ BrowserInit::LaunchWithProfile 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 |
@@ -239,7 +250,9 @@ IN_PROC_BROWSER_TEST_F(BrowserInitTest, OpenAppShortcutTabPref) { |
CommandLine command_line(CommandLine::NO_PROGRAM); |
command_line.AppendSwitchASCII(switches::kAppId, extension_app->id()); |
- BrowserInit::LaunchWithProfile launch(FilePath(), command_line); |
+ BrowserInit::IsFirstRun first_run = FirstRun::IsChromeFirstRun() ? |
+ BrowserInit::IS_FIRST_RUN : BrowserInit::IS_NOT_FIRST_RUN; |
+ BrowserInit::LaunchWithProfile 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 |
@@ -266,7 +279,9 @@ IN_PROC_BROWSER_TEST_F(BrowserInitTest, OpenAppShortcutPanel) { |
CommandLine command_line(CommandLine::NO_PROGRAM); |
command_line.AppendSwitchASCII(switches::kAppId, extension_app->id()); |
- BrowserInit::LaunchWithProfile launch(FilePath(), command_line); |
+ BrowserInit::IsFirstRun first_run = FirstRun::IsChromeFirstRun() ? |
+ BrowserInit::IS_FIRST_RUN : BrowserInit::IS_NOT_FIRST_RUN; |
+ BrowserInit::LaunchWithProfile 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. |