| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "ash/common/shelf/app_list_button.h" | 9 #include "ash/common/shelf/app_list_button.h" |
| 10 #include "ash/common/shelf/shelf_button.h" | 10 #include "ash/common/shelf/shelf_button.h" |
| (...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1705 | 1705 |
| 1706 // Checks that after a session restore, we do not start applications on an | 1706 // Checks that after a session restore, we do not start applications on an |
| 1707 // activation. | 1707 // activation. |
| 1708 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, ActivateAfterSessionRestore) { | 1708 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, ActivateAfterSessionRestore) { |
| 1709 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); | 1709 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); |
| 1710 | 1710 |
| 1711 // Create a known application. | 1711 // Create a known application. |
| 1712 ash::ShelfID shortcut_id = CreateShortcut("app1"); | 1712 ash::ShelfID shortcut_id = CreateShortcut("app1"); |
| 1713 | 1713 |
| 1714 // Create a new browser - without activating it - and load an "app" into it. | 1714 // Create a new browser - without activating it - and load an "app" into it. |
| 1715 Browser::CreateParams params = Browser::CreateParams(profile()); | 1715 Browser::CreateParams params = Browser::CreateParams(profile(), true); |
| 1716 params.initial_show_state = ui::SHOW_STATE_INACTIVE; | 1716 params.initial_show_state = ui::SHOW_STATE_INACTIVE; |
| 1717 Browser* browser2 = new Browser(params); | 1717 Browser* browser2 = new Browser(params); |
| 1718 controller_->SetRefocusURLPatternForTest( | 1718 controller_->SetRefocusURLPatternForTest( |
| 1719 shortcut_id, GURL("http://www.example.com/path/*")); | 1719 shortcut_id, GURL("http://www.example.com/path/*")); |
| 1720 std::string url = "http://www.example.com/path/bla"; | 1720 std::string url = "http://www.example.com/path/bla"; |
| 1721 ui_test_utils::NavigateToURLWithDisposition( | 1721 ui_test_utils::NavigateToURLWithDisposition( |
| 1722 browser2, GURL(url), WindowOpenDisposition::NEW_FOREGROUND_TAB, | 1722 browser2, GURL(url), WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 1723 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 1723 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 1724 | 1724 |
| 1725 // Remember the number of tabs for each browser. | 1725 // Remember the number of tabs for each browser. |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2390 | 2390 |
| 2391 // Close all windows via the menu item. | 2391 // Close all windows via the menu item. |
| 2392 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); | 2392 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); |
| 2393 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); | 2393 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); |
| 2394 | 2394 |
| 2395 // Check if "Close" is removed from the context menu. | 2395 // Check if "Close" is removed from the context menu. |
| 2396 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); | 2396 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); |
| 2397 ASSERT_FALSE( | 2397 ASSERT_FALSE( |
| 2398 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); | 2398 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); |
| 2399 } | 2399 } |
| OLD | NEW |