| OLD | NEW |
| 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" |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false, | 319 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false, |
| 320 browser()->host_desktop_type())); | 320 browser()->host_desktop_type())); |
| 321 | 321 |
| 322 // No pref was set, so the app should have opened in a tab in a new window. | 322 // No pref was set, so the app should have opened in a tab in a new window. |
| 323 // The launch should have created a new browser. | 323 // The launch should have created a new browser. |
| 324 Browser* new_browser = FindOneOtherBrowser(browser()); | 324 Browser* new_browser = FindOneOtherBrowser(browser()); |
| 325 ASSERT_TRUE(new_browser); | 325 ASSERT_TRUE(new_browser); |
| 326 | 326 |
| 327 // If new bookmark apps are enabled, it should be a standard tabbed window, | 327 // If new bookmark apps are enabled, it should be a standard tabbed window, |
| 328 // not an app window; otherwise the reverse should be true. | 328 // not an app window; otherwise the reverse should be true. |
| 329 bool new_bookmark_apps_enabled = | 329 bool new_bookmark_apps_enabled = extensions::util::IsNewBookmarkAppsEnabled(); |
| 330 extensions::util::IsStreamlinedHostedAppsEnabled(); | |
| 331 EXPECT_EQ(!new_bookmark_apps_enabled, new_browser->is_app()); | 330 EXPECT_EQ(!new_bookmark_apps_enabled, new_browser->is_app()); |
| 332 EXPECT_EQ(new_bookmark_apps_enabled, new_browser->is_type_tabbed()); | 331 EXPECT_EQ(new_bookmark_apps_enabled, new_browser->is_type_tabbed()); |
| 333 } | 332 } |
| 334 | 333 |
| 335 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, OpenAppShortcutWindowPref) { | 334 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, OpenAppShortcutWindowPref) { |
| 336 const Extension* extension_app = NULL; | 335 const Extension* extension_app = NULL; |
| 337 ASSERT_NO_FATAL_FAILURE(LoadApp("app_with_tab_container", &extension_app)); | 336 ASSERT_NO_FATAL_FAILURE(LoadApp("app_with_tab_container", &extension_app)); |
| 338 | 337 |
| 339 // Set a pref indicating that the user wants to open this app in a window. | 338 // Set a pref indicating that the user wants to open this app in a window. |
| 340 SetAppLaunchPref(extension_app->id(), extensions::LAUNCH_TYPE_WINDOW); | 339 SetAppLaunchPref(extension_app->id(), extensions::LAUNCH_TYPE_WINDOW); |
| (...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1493 ASSERT_EQ(1, tab_strip->count()); | 1492 ASSERT_EQ(1, tab_strip->count()); |
| 1494 EXPECT_EQ("title1.html", | 1493 EXPECT_EQ("title1.html", |
| 1495 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); | 1494 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); |
| 1496 } | 1495 } |
| 1497 #endif // defined(ENABLE_CONFIGURATION_POLICY) | 1496 #endif // defined(ENABLE_CONFIGURATION_POLICY) |
| 1498 | 1497 |
| 1499 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) || | 1498 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) || |
| 1500 // defined(ENABLE_CONFIGURATION_POLICY) | 1499 // defined(ENABLE_CONFIGURATION_POLICY) |
| 1501 | 1500 |
| 1502 #endif // !defined(OS_CHROMEOS) | 1501 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |