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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_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 unified diff | Download patch
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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
11 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "base/test/histogram_tester.h" 12 #include "base/test/histogram_tester.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/extensions/extension_browsertest.h" 14 #include "chrome/browser/extensions/extension_browsertest.h"
15 #include "chrome/browser/extensions/extension_service.h" 15 #include "chrome/browser/extensions/extension_service.h"
16 #include "chrome/browser/extensions/extension_util.h"
16 #include "chrome/browser/extensions/launch_util.h" 17 #include "chrome/browser/extensions/launch_util.h"
17 #include "chrome/browser/first_run/first_run.h" 18 #include "chrome/browser/first_run/first_run.h"
18 #include "chrome/browser/infobars/infobar_service.h" 19 #include "chrome/browser/infobars/infobar_service.h"
19 #include "chrome/browser/prefs/session_startup_pref.h" 20 #include "chrome/browser/prefs/session_startup_pref.h"
20 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
21 #include "chrome/browser/profiles/profile_impl.h" 22 #include "chrome/browser/profiles/profile_impl.h"
22 #include "chrome/browser/profiles/profile_manager.h" 23 #include "chrome/browser/profiles/profile_manager.h"
23 #include "chrome/browser/sessions/session_restore.h" 24 #include "chrome/browser/sessions/session_restore.h"
24 #include "chrome/browser/signin/signin_promo.h" 25 #include "chrome/browser/signin/signin_promo.h"
25 #include "chrome/browser/ui/browser.h" 26 #include "chrome/browser/ui/browser.h"
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; 319 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN;
319 StartupBrowserCreatorImpl launch(base::FilePath(), command_line, first_run); 320 StartupBrowserCreatorImpl launch(base::FilePath(), command_line, first_run);
320 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false, 321 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false,
321 browser()->host_desktop_type())); 322 browser()->host_desktop_type()));
322 323
323 // No pref was set, so the app should have opened in a tab in a new window. 324 // No pref was set, so the app should have opened in a tab in a new window.
324 // The launch should have created a new browser. 325 // The launch should have created a new browser.
325 Browser* new_browser = FindOneOtherBrowser(browser()); 326 Browser* new_browser = FindOneOtherBrowser(browser());
326 ASSERT_TRUE(new_browser); 327 ASSERT_TRUE(new_browser);
327 328
328 // It should be a standard tabbed window, not an app window. 329 // If new bookmark apps are enabled, it should be a standard tabbed window,
329 EXPECT_FALSE(new_browser->is_app()); 330 // not an app window; otherwise the reverse should be true.
330 EXPECT_TRUE(new_browser->is_type_tabbed()); 331 bool new_bookmark_apps_enabled =
332 extensions::util::IsStreamlinedHostedAppsEnabled();
333 EXPECT_EQ(!new_bookmark_apps_enabled, new_browser->is_app());
334 EXPECT_EQ(new_bookmark_apps_enabled, new_browser->is_type_tabbed());
331 } 335 }
332 336
333 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, OpenAppShortcutWindowPref) { 337 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, OpenAppShortcutWindowPref) {
334 const Extension* extension_app = NULL; 338 const Extension* extension_app = NULL;
335 ASSERT_NO_FATAL_FAILURE(LoadApp("app_with_tab_container", &extension_app)); 339 ASSERT_NO_FATAL_FAILURE(LoadApp("app_with_tab_container", &extension_app));
336 340
337 // Set a pref indicating that the user wants to open this app in a window. 341 // Set a pref indicating that the user wants to open this app in a window.
338 SetAppLaunchPref(extension_app->id(), extensions::LAUNCH_TYPE_WINDOW); 342 SetAppLaunchPref(extension_app->id(), extensions::LAUNCH_TYPE_WINDOW);
339 343
340 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); 344 base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1491 ASSERT_EQ(1, tab_strip->count()); 1495 ASSERT_EQ(1, tab_strip->count());
1492 EXPECT_EQ("title1.html", 1496 EXPECT_EQ("title1.html",
1493 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); 1497 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName());
1494 } 1498 }
1495 #endif // defined(ENABLE_CONFIGURATION_POLICY) 1499 #endif // defined(ENABLE_CONFIGURATION_POLICY)
1496 1500
1497 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) || 1501 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) ||
1498 // defined(ENABLE_CONFIGURATION_POLICY) 1502 // defined(ENABLE_CONFIGURATION_POLICY)
1499 1503
1500 #endif // !defined(OS_CHROMEOS) 1504 #endif // !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698