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

Unified Diff: chrome/browser/ui/browser_init_browsertest.cc

Issue 8093016: Show sync promo at startup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build error Created 9 years, 2 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
« no previous file with comments | « chrome/browser/ui/browser_init.cc ('k') | chrome/browser/ui/webui/sync_promo_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « chrome/browser/ui/browser_init.cc ('k') | chrome/browser/ui/webui/sync_promo_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698