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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc

Issue 2523053004: Enhance chrome.app.window API for shelf integration with restore support (Closed)
Patch Set: Review v2 Created 4 years 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 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/aura/wm_window_aura.h" 9 #include "ash/aura/wm_window_aura.h"
10 #include "ash/common/shelf/app_list_button.h" 10 #include "ash/common/shelf/app_list_button.h"
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 } 929 }
930 930
931 // Launches an app in the background and then tries to open it. This is test for 931 // Launches an app in the background and then tries to open it. This is test for
932 // a crash we had. 932 // a crash we had.
933 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchInBackground) { 933 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchInBackground) {
934 TabStripModel* tab_strip = browser()->tab_strip_model(); 934 TabStripModel* tab_strip = browser()->tab_strip_model();
935 int tab_count = tab_strip->count(); 935 int tab_count = tab_strip->count();
936 LoadAndLaunchExtension("app1", extensions::LAUNCH_CONTAINER_TAB, 936 LoadAndLaunchExtension("app1", extensions::LAUNCH_CONTAINER_TAB,
937 WindowOpenDisposition::NEW_BACKGROUND_TAB); 937 WindowOpenDisposition::NEW_BACKGROUND_TAB);
938 EXPECT_EQ(++tab_count, tab_strip->count()); 938 EXPECT_EQ(++tab_count, tab_strip->count());
939 controller_->LaunchApp(last_loaded_extension_id(), 939 controller_->LaunchApp(last_loaded_extension_id(), ash::LAUNCH_FROM_UNKNOWN,
940 ash::LAUNCH_FROM_UNKNOWN, 940 0);
941 0);
942 } 941 }
943 942
944 // Confirm that clicking a icon for an app running in one of 2 maxmized windows 943 // Confirm that clicking a icon for an app running in one of 2 maxmized windows
945 // activates the right window. 944 // activates the right window.
946 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchMaximized) { 945 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchMaximized) {
947 aura::Window* window1 = browser()->window()->GetNativeWindow(); 946 aura::Window* window1 = browser()->window()->GetNativeWindow();
948 ash::wm::WindowState* window1_state = ash::wm::GetWindowState(window1); 947 ash::wm::WindowState* window1_state = ash::wm::GetWindowState(window1);
949 window1_state->Maximize(); 948 window1_state->Maximize();
950 content::WindowedNotificationObserver open_observer( 949 content::WindowedNotificationObserver open_observer(
951 chrome::NOTIFICATION_BROWSER_WINDOW_READY, 950 chrome::NOTIFICATION_BROWSER_WINDOW_READY,
(...skipping 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after
2417 2416
2418 // Close all windows via the menu item. 2417 // Close all windows via the menu item.
2419 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); 2418 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE);
2420 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); 2419 EXPECT_EQ(0u, BrowserList::GetInstance()->size());
2421 2420
2422 // Check if "Close" is removed from the context menu. 2421 // Check if "Close" is removed from the context menu.
2423 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); 2422 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu();
2424 ASSERT_FALSE( 2423 ASSERT_FALSE(
2425 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); 2424 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE));
2426 } 2425 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698