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

Side by Side Diff: chrome/browser/extensions/api/management/management_apitest.cc

Issue 937843004: Disable bookmark apps on non-ChromeOS platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wow - how did that compile anywhere Created 5 years, 10 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 <map> 5 #include <map>
6 6
7 #include "chrome/browser/chrome_notification_types.h" 7 #include "chrome/browser/chrome_notification_types.h"
8 #include "chrome/browser/extensions/extension_apitest.h" 8 #include "chrome/browser/extensions/extension_apitest.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/extension_util.h"
10 #include "chrome/browser/extensions/launch_util.h" 11 #include "chrome/browser/extensions/launch_util.h"
11 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/browser_commands.h" 14 #include "chrome/browser/ui/browser_commands.h"
14 #include "chrome/browser/ui/browser_finder.h" 15 #include "chrome/browser/ui/browser_finder.h"
15 #include "chrome/browser/ui/browser_iterator.h" 16 #include "chrome/browser/ui/browser_iterator.h"
16 #include "chrome/browser/ui/tabs/tab_strip_model.h" 17 #include "chrome/browser/ui/tabs/tab_strip_model.h"
17 #include "chrome/common/chrome_switches.h" 18 #include "chrome/common/chrome_switches.h"
18 #include "chrome/common/extensions/extension_constants.h" 19 #include "chrome/common/extensions/extension_constants.h"
19 #include "content/public/test/test_utils.h" 20 #include "content/public/test/test_utils.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 extensions::SetLaunchType(browser()->profile(), app_id, 304 extensions::SetLaunchType(browser()->profile(), app_id,
304 extensions::LAUNCH_TYPE_WINDOW); 305 extensions::LAUNCH_TYPE_WINDOW);
305 306
306 std::string app_id_new; 307 std::string app_id_new;
307 LoadAndWaitForLaunch("management/launch_app_tab", &app_id_new); 308 LoadAndWaitForLaunch("management/launch_app_tab", &app_id_new);
308 ASSERT_FALSE(HasFatalFailure()); 309 ASSERT_FALSE(HasFatalFailure());
309 310
310 // If the ID changed, then the pref will not apply to the app. 311 // If the ID changed, then the pref will not apply to the app.
311 ASSERT_EQ(app_id, app_id_new); 312 ASSERT_EQ(app_id, app_id_new);
312 313
314 unsigned expected_browser_count = 2;
315 #if defined(OS_MACOSX)
316 // Without the new Bookmark Apps, Mac has no way of making standalone browser
317 // windows for apps, so it will add to the tabstrip instead.
318 EXPECT_FALSE(extensions::util::IsNewBookmarkAppsEnabled());
319 expected_browser_count = 1;
320 ASSERT_EQ(2, browser()->tab_strip_model()->count());
321 #endif
313 // Find the app's browser. Opening in a new window will create 322 // Find the app's browser. Opening in a new window will create
314 // a new browser. 323 // a new browser.
315 ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile(), 324 ASSERT_EQ(expected_browser_count,
316 browser()->host_desktop_type())); 325 chrome::GetBrowserCount(browser()->profile(),
317 Browser* app_browser = FindOtherBrowser(browser()); 326 browser()->host_desktop_type()));
318 ASSERT_TRUE(app_browser->is_app()); 327 if (expected_browser_count == 2) {
328 Browser* app_browser = FindOtherBrowser(browser());
329 ASSERT_TRUE(app_browser->is_app());
330 }
319 } 331 }
320 332
321 IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, LaunchType) { 333 IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, LaunchType) {
322 LoadExtensions(); 334 LoadExtensions();
323 base::FilePath basedir = test_data_dir_.AppendASCII("management"); 335 base::FilePath basedir = test_data_dir_.AppendASCII("management");
324 LoadNamedExtension(basedir, "packaged_app"); 336 LoadNamedExtension(basedir, "packaged_app");
325 337
326 ASSERT_TRUE(RunExtensionSubtest("management/test", "launchType.html")); 338 ASSERT_TRUE(RunExtensionSubtest("management/test", "launchType.html"));
327 } 339 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/extensions/extension_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698