| 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/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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 #include "extensions/test/extension_test_message_listener.h" | 69 #include "extensions/test/extension_test_message_listener.h" |
| 70 #include "testing/gtest/include/gtest/gtest.h" | 70 #include "testing/gtest/include/gtest/gtest.h" |
| 71 #include "ui/app_list/app_list_switches.h" | 71 #include "ui/app_list/app_list_switches.h" |
| 72 #include "ui/app_list/views/app_list_item_view.h" | 72 #include "ui/app_list/views/app_list_item_view.h" |
| 73 #include "ui/app_list/views/apps_grid_view.h" | 73 #include "ui/app_list/views/apps_grid_view.h" |
| 74 #include "ui/app_list/views/start_page_view.h" | 74 #include "ui/app_list/views/start_page_view.h" |
| 75 #include "ui/app_list/views/tile_item_view.h" | 75 #include "ui/app_list/views/tile_item_view.h" |
| 76 #include "ui/aura/client/aura_constants.h" | 76 #include "ui/aura/client/aura_constants.h" |
| 77 #include "ui/aura/window.h" | 77 #include "ui/aura/window.h" |
| 78 #include "ui/base/window_open_disposition.h" | 78 #include "ui/base/window_open_disposition.h" |
| 79 #include "ui/display/test/display_manager_test_api.h" |
| 79 #include "ui/events/event.h" | 80 #include "ui/events/event.h" |
| 80 #include "ui/events/event_constants.h" | 81 #include "ui/events/event_constants.h" |
| 81 #include "ui/events/test/event_generator.h" | 82 #include "ui/events/test/event_generator.h" |
| 82 | 83 |
| 83 using ash::WmShelf; | 84 using ash::WmShelf; |
| 84 using extensions::AppWindow; | 85 using extensions::AppWindow; |
| 85 using extensions::Extension; | 86 using extensions::Extension; |
| 86 using content::WebContents; | 87 using content::WebContents; |
| 87 | 88 |
| 88 namespace { | 89 namespace { |
| (...skipping 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1883 bounds_shelf_1.CenterPoint().y()); | 1884 bounds_shelf_1.CenterPoint().y()); |
| 1884 base::RunLoop().RunUntilIdle(); | 1885 base::RunLoop().RunUntilIdle(); |
| 1885 // Issue an ESC and see that the operation gets cancelled. | 1886 // Issue an ESC and see that the operation gets cancelled. |
| 1886 generator.PressKey(ui::VKEY_ESCAPE, 0); | 1887 generator.PressKey(ui::VKEY_ESCAPE, 0); |
| 1887 generator.ReleaseKey(ui::VKEY_ESCAPE, 0); | 1888 generator.ReleaseKey(ui::VKEY_ESCAPE, 0); |
| 1888 EXPECT_FALSE(grid_view->dragging()); | 1889 EXPECT_FALSE(grid_view->dragging()); |
| 1889 EXPECT_FALSE(grid_view->has_dragged_view()); | 1890 EXPECT_FALSE(grid_view->has_dragged_view()); |
| 1890 generator.ReleaseLeftButton(); | 1891 generator.ReleaseLeftButton(); |
| 1891 } | 1892 } |
| 1892 | 1893 |
| 1893 // Used to test drag & drop an item between app list and shelf with multi | |
| 1894 // display environment. | |
| 1895 class ShelfAppBrowserTestWithMultiMonitor | |
| 1896 : public ShelfAppBrowserTestNoDefaultBrowser { | |
| 1897 protected: | |
| 1898 ShelfAppBrowserTestWithMultiMonitor() {} | |
| 1899 ~ShelfAppBrowserTestWithMultiMonitor() override {} | |
| 1900 | |
| 1901 void SetUpCommandLine(base::CommandLine* command_line) override { | |
| 1902 ShelfAppBrowserTestNoDefaultBrowser::SetUpCommandLine(command_line); | |
| 1903 command_line->AppendSwitchASCII("ash-host-window-bounds", | |
| 1904 "800x800,801+0-800x800"); | |
| 1905 } | |
| 1906 | |
| 1907 private: | |
| 1908 | |
| 1909 DISALLOW_COPY_AND_ASSIGN(ShelfAppBrowserTestWithMultiMonitor); | |
| 1910 }; | |
| 1911 | |
| 1912 // Do basic drag and drop interaction tests between the application list and | 1894 // Do basic drag and drop interaction tests between the application list and |
| 1913 // the launcher in the secondary monitor. | 1895 // the launcher in the secondary monitor. |
| 1914 // TODO(msw): fix, http://crbug.com/678622. | 1896 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, MultiDisplayBasicDragAndDrop) { |
| 1915 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTestWithMultiMonitor, | 1897 // Update the display configuration to add a secondary display. |
| 1916 DISABLED_BasicDragAndDrop) { | 1898 display::test::DisplayManagerTestApi( |
| 1899 ash::Shell::GetInstance()->display_manager()) |
| 1900 .UpdateDisplay("800x800,801+0-800x800"); |
| 1901 |
| 1917 // Get a number of interfaces we need. | 1902 // Get a number of interfaces we need. |
| 1918 DCHECK_EQ(ash::Shell::GetAllRootWindows().size(), 2U); | 1903 DCHECK_EQ(ash::Shell::GetAllRootWindows().size(), 2U); |
| 1919 aura::Window* secondary_root_window = ash::Shell::GetAllRootWindows()[1]; | 1904 aura::Window* secondary_root_window = ash::Shell::GetAllRootWindows()[1]; |
| 1920 ash::WmShelf* secondary_shelf = | 1905 ash::WmShelf* secondary_shelf = |
| 1921 ash::WmShelf::ForWindow(ash::WmWindowAura::Get(secondary_root_window)); | 1906 ash::WmShelf::ForWindow(ash::WmWindowAura::Get(secondary_root_window)); |
| 1922 | 1907 |
| 1923 ui::test::EventGenerator generator(secondary_root_window, gfx::Point()); | 1908 ui::test::EventGenerator generator(secondary_root_window, gfx::Point()); |
| 1924 ash::test::ShelfViewTestAPI test(secondary_shelf->GetShelfViewForTesting()); | 1909 ash::test::ShelfViewTestAPI test(secondary_shelf->GetShelfViewForTesting()); |
| 1925 AppListService* service = AppListService::Get(); | 1910 AppListService* service = AppListService::Get(); |
| 1926 | 1911 |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2420 | 2405 |
| 2421 // Close all windows via the menu item. | 2406 // Close all windows via the menu item. |
| 2422 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); | 2407 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); |
| 2423 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); | 2408 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); |
| 2424 | 2409 |
| 2425 // Check if "Close" is removed from the context menu. | 2410 // Check if "Close" is removed from the context menu. |
| 2426 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); | 2411 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); |
| 2427 ASSERT_FALSE( | 2412 ASSERT_FALSE( |
| 2428 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); | 2413 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); |
| 2429 } | 2414 } |
| OLD | NEW |