| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/launcher_context_menu.h" | 5 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "ash/common/shelf/shelf_item_types.h" | 9 #include "ash/common/shelf/shelf_item_types.h" |
| 10 #include "ash/common/wm_lookup.h" | 10 #include "ash/common/wm_lookup.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 EXPECT_FALSE( | 281 EXPECT_FALSE( |
| 282 IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_OPEN_NEW)); | 282 IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_OPEN_NEW)); |
| 283 EXPECT_FALSE(IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_PIN)); | 283 EXPECT_FALSE(IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_PIN)); |
| 284 EXPECT_TRUE(IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_CLOSE)); | 284 EXPECT_TRUE(IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_CLOSE)); |
| 285 EXPECT_TRUE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_CLOSE)); | 285 EXPECT_TRUE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_CLOSE)); |
| 286 } | 286 } |
| 287 | 287 |
| 288 // Tests that fullscreen which makes "Autohide shelf" option disappeared on | 288 // Tests that fullscreen which makes "Autohide shelf" option disappeared on |
| 289 // shelf is a per-display setting (crbug.com/496681). | 289 // shelf is a per-display setting (crbug.com/496681). |
| 290 TEST_F(LauncherContextMenuTest, AutohideShelfOptionOnExternalDisplay) { | 290 TEST_F(LauncherContextMenuTest, AutohideShelfOptionOnExternalDisplay) { |
| 291 if (!SupportsMultipleDisplays()) | |
| 292 return; | |
| 293 | |
| 294 UpdateDisplay("940x550,940x550"); | 291 UpdateDisplay("940x550,940x550"); |
| 295 int64_t primary_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); | 292 int64_t primary_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); |
| 296 int64_t secondary_id = display_manager()->GetSecondaryDisplay().id(); | 293 int64_t secondary_id = display_manager()->GetSecondaryDisplay().id(); |
| 297 | 294 |
| 298 // Create a normal window on primary display. | 295 // Create a normal window on primary display. |
| 299 views::Widget* widget = new views::Widget; | 296 views::Widget* widget = new views::Widget; |
| 300 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 297 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
| 301 params.context = ash::Shell::GetPrimaryRootWindow(); | 298 params.context = ash::Shell::GetPrimaryRootWindow(); |
| 302 widget->Init(params); | 299 widget->Init(params); |
| 303 widget->Show(); | 300 widget->Show(); |
| 304 | 301 |
| 305 widget->SetFullscreen(true); | 302 widget->SetFullscreen(true); |
| 306 std::unique_ptr<LauncherContextMenu> primary_menu(CreateLauncherContextMenu( | 303 std::unique_ptr<LauncherContextMenu> primary_menu(CreateLauncherContextMenu( |
| 307 ash::TYPE_BROWSER_SHORTCUT, GetWmShelf(primary_id))); | 304 ash::TYPE_BROWSER_SHORTCUT, GetWmShelf(primary_id))); |
| 308 std::unique_ptr<LauncherContextMenu> secondary_menu(CreateLauncherContextMenu( | 305 std::unique_ptr<LauncherContextMenu> secondary_menu(CreateLauncherContextMenu( |
| 309 ash::TYPE_BROWSER_SHORTCUT, GetWmShelf(secondary_id))); | 306 ash::TYPE_BROWSER_SHORTCUT, GetWmShelf(secondary_id))); |
| 310 EXPECT_FALSE(IsItemPresentInMenu(primary_menu.get(), | 307 EXPECT_FALSE(IsItemPresentInMenu(primary_menu.get(), |
| 311 LauncherContextMenu::MENU_AUTO_HIDE)); | 308 LauncherContextMenu::MENU_AUTO_HIDE)); |
| 312 EXPECT_TRUE(IsItemPresentInMenu(secondary_menu.get(), | 309 EXPECT_TRUE(IsItemPresentInMenu(secondary_menu.get(), |
| 313 LauncherContextMenu::MENU_AUTO_HIDE)); | 310 LauncherContextMenu::MENU_AUTO_HIDE)); |
| 314 } | 311 } |
| OLD | NEW |