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 <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/extension_util.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 309 |
310 std::string app_id_new; | 310 std::string app_id_new; |
311 LoadAndWaitForLaunch("management/launch_app_tab", &app_id_new); | 311 LoadAndWaitForLaunch("management/launch_app_tab", &app_id_new); |
312 ASSERT_FALSE(HasFatalFailure()); | 312 ASSERT_FALSE(HasFatalFailure()); |
313 | 313 |
314 // If the ID changed, then the pref will not apply to the app. | 314 // If the ID changed, then the pref will not apply to the app. |
315 ASSERT_EQ(app_id, app_id_new); | 315 ASSERT_EQ(app_id, app_id_new); |
316 | 316 |
317 unsigned expected_browser_count = 2; | 317 unsigned expected_browser_count = 2; |
318 #if defined(OS_MACOSX) | 318 #if defined(OS_MACOSX) |
319 // With the new Bookmark Apps, Mac currently has standalone browser | 319 // Without the new Bookmark Apps, Mac has no way of making standalone browser |
320 // windows disabled for apps, so it will add to the tabstrip instead. | 320 // windows for apps, so it will add to the tabstrip instead. |
321 EXPECT_TRUE(extensions::util::IsNewBookmarkAppsEnabled()); | 321 EXPECT_FALSE(extensions::util::IsNewBookmarkAppsEnabled()); |
322 expected_browser_count = 1; | 322 expected_browser_count = 1; |
323 ASSERT_EQ(2, browser()->tab_strip_model()->count()); | 323 ASSERT_EQ(2, browser()->tab_strip_model()->count()); |
324 #endif | 324 #endif |
325 // Find the app's browser. Opening in a new window will create | 325 // Find the app's browser. Opening in a new window will create |
326 // a new browser. | 326 // a new browser. |
327 ASSERT_EQ(expected_browser_count, | 327 ASSERT_EQ(expected_browser_count, |
328 chrome::GetBrowserCount(browser()->profile(), | 328 chrome::GetBrowserCount(browser()->profile(), |
329 browser()->host_desktop_type())); | 329 browser()->host_desktop_type())); |
330 if (expected_browser_count == 2) { | 330 if (expected_browser_count == 2) { |
331 Browser* app_browser = FindOtherBrowser(browser()); | 331 Browser* app_browser = FindOtherBrowser(browser()); |
332 ASSERT_TRUE(app_browser->is_app()); | 332 ASSERT_TRUE(app_browser->is_app()); |
333 } | 333 } |
334 } | 334 } |
335 | 335 |
336 IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, LaunchType) { | 336 IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, LaunchType) { |
337 LoadExtensions(); | 337 LoadExtensions(); |
338 base::FilePath basedir = test_data_dir_.AppendASCII("management"); | 338 base::FilePath basedir = test_data_dir_.AppendASCII("management"); |
339 LoadNamedExtension(basedir, "packaged_app"); | 339 LoadNamedExtension(basedir, "packaged_app"); |
340 | 340 |
341 ASSERT_TRUE(RunExtensionSubtest("management/test", "launchType.html")); | 341 ASSERT_TRUE(RunExtensionSubtest("management/test", "launchType.html")); |
342 } | 342 } |
OLD | NEW |