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

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

Issue 809713006: Disable new bookmark apps flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix woopsies Created 5 years, 11 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/browser_browsertest.cc
diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc
index 38439426165e4949df0c73c13535d15d5a1b9bf4..e88a96c541277223cbed60398c00e4a9095c454e 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -20,6 +20,7 @@
#include "chrome/browser/devtools/devtools_window_testing.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/lifetime/application_lifetime.h"
@@ -1316,15 +1317,26 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, AppIdSwitch) {
chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN;
StartupBrowserCreatorImpl launch(base::FilePath(), command_line, first_run);
- EXPECT_FALSE(launch.OpenApplicationWindow(browser()->profile(), NULL));
- EXPECT_TRUE(launch.OpenApplicationTab(browser()->profile()));
- // Check that a new browser wasn't opened.
- EXPECT_EQ(1u, chrome::GetBrowserCount(browser()->profile(),
- browser()->host_desktop_type()));
+ bool new_bookmark_apps_enabled =
Lei Zhang 2015/01/13 01:34:40 Do you need all the conditionals below that depend
benwells 2015/01/13 03:22:52 I thought it might be better if the test would pas
+ extensions::util::IsStreamlinedHostedAppsEnabled();
- // Check that a new tab was opened.
- EXPECT_EQ(2, browser()->tab_strip_model()->count());
+ // If the new bookmark app flow is enabled, the app should open as an tab.
+ // Otherwise the app should open as an app window.
+ EXPECT_EQ(!new_bookmark_apps_enabled,
+ launch.OpenApplicationWindow(browser()->profile(), NULL));
+ EXPECT_EQ(new_bookmark_apps_enabled,
+ launch.OpenApplicationTab(browser()->profile()));
+
+ // Check that a the number of browsers and tabs is correct.
+ unsigned int expected_browsers = 1;
+ int expected_tabs = 1;
+ new_bookmark_apps_enabled ? expected_tabs++ : expected_browsers++;
+
+ EXPECT_EQ(expected_browsers,
+ chrome::GetBrowserCount(browser()->profile(),
+ browser()->host_desktop_type()));
+ EXPECT_EQ(expected_tabs, browser()->tab_strip_model()->count());
}
// Open an app window and the dev tools window and ensure that the location
« no previous file with comments | « chrome/browser/extensions/extension_util.cc ('k') | chrome/browser/ui/startup/startup_browser_creator_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698