| 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 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1710 | 1710 |
| 1711 // Checks that after a session restore, we do not start applications on an | 1711 // Checks that after a session restore, we do not start applications on an |
| 1712 // activation. | 1712 // activation. |
| 1713 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, ActivateAfterSessionRestore) { | 1713 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, ActivateAfterSessionRestore) { |
| 1714 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); | 1714 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); |
| 1715 | 1715 |
| 1716 // Create a known application. | 1716 // Create a known application. |
| 1717 ash::ShelfID shortcut_id = CreateShortcut("app1"); | 1717 ash::ShelfID shortcut_id = CreateShortcut("app1"); |
| 1718 | 1718 |
| 1719 // Create a new browser - without activating it - and load an "app" into it. | 1719 // Create a new browser - without activating it - and load an "app" into it. |
| 1720 Browser::CreateParams params = Browser::CreateParams(profile()); | 1720 Browser::CreateParams params = Browser::CreateParams(profile(), true); |
| 1721 params.initial_show_state = ui::SHOW_STATE_INACTIVE; | 1721 params.initial_show_state = ui::SHOW_STATE_INACTIVE; |
| 1722 Browser* browser2 = new Browser(params); | 1722 Browser* browser2 = new Browser(params); |
| 1723 controller_->SetRefocusURLPatternForTest( | 1723 controller_->SetRefocusURLPatternForTest( |
| 1724 shortcut_id, GURL("http://www.example.com/path/*")); | 1724 shortcut_id, GURL("http://www.example.com/path/*")); |
| 1725 std::string url = "http://www.example.com/path/bla"; | 1725 std::string url = "http://www.example.com/path/bla"; |
| 1726 ui_test_utils::NavigateToURLWithDisposition( | 1726 ui_test_utils::NavigateToURLWithDisposition( |
| 1727 browser2, GURL(url), WindowOpenDisposition::NEW_FOREGROUND_TAB, | 1727 browser2, GURL(url), WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 1728 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 1728 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 1729 | 1729 |
| 1730 // Remember the number of tabs for each browser. | 1730 // Remember the number of tabs for each browser. |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2394 | 2394 |
| 2395 // Close all windows via the menu item. | 2395 // Close all windows via the menu item. |
| 2396 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); | 2396 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); |
| 2397 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); | 2397 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); |
| 2398 | 2398 |
| 2399 // Check if "Close" is removed from the context menu. | 2399 // Check if "Close" is removed from the context menu. |
| 2400 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); | 2400 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); |
| 2401 ASSERT_FALSE( | 2401 ASSERT_FALSE( |
| 2402 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); | 2402 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); |
| 2403 } | 2403 } |
| OLD | NEW |