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

Side by Side Diff: ash/wm/overview/window_selector_unittest.cc

Issue 1918883002: Makes Panel related classes use ash/wm/common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@phantom_window_controller
Patch Set: feedback Created 4 years, 8 months 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
« no previous file with comments | « ash/wm/overview/window_selector.cc ('k') | ash/wm/panels/panel_layout_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "ash/accessibility_delegate.h" 8 #include "ash/accessibility_delegate.h"
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/drag_drop/drag_drop_controller.h" 10 #include "ash/drag_drop/drag_drop_controller.h"
11 #include "ash/root_window_controller.h" 11 #include "ash/root_window_controller.h"
12 #include "ash/screen_util.h" 12 #include "ash/screen_util.h"
13 #include "ash/shelf/shelf.h" 13 #include "ash/shelf/shelf.h"
14 #include "ash/shelf/shelf_widget.h" 14 #include "ash/shelf/shelf_widget.h"
15 #include "ash/shell.h" 15 #include "ash/shell.h"
16 #include "ash/shell_window_ids.h" 16 #include "ash/shell_window_ids.h"
17 #include "ash/test/ash_test_base.h" 17 #include "ash/test/ash_test_base.h"
18 #include "ash/test/display_manager_test_api.h" 18 #include "ash/test/display_manager_test_api.h"
19 #include "ash/test/shelf_test_api.h" 19 #include "ash/test/shelf_test_api.h"
20 #include "ash/test/shelf_view_test_api.h" 20 #include "ash/test/shelf_view_test_api.h"
21 #include "ash/test/shell_test_api.h" 21 #include "ash/test/shell_test_api.h"
22 #include "ash/test/test_shelf_delegate.h" 22 #include "ash/test/test_shelf_delegate.h"
23 #include "ash/wm/aura/wm_window_aura.h"
23 #include "ash/wm/common/wm_event.h" 24 #include "ash/wm/common/wm_event.h"
24 #include "ash/wm/maximize_mode/maximize_mode_controller.h" 25 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
25 #include "ash/wm/mru_window_tracker.h" 26 #include "ash/wm/mru_window_tracker.h"
26 #include "ash/wm/overview/window_grid.h" 27 #include "ash/wm/overview/window_grid.h"
27 #include "ash/wm/overview/window_selector.h" 28 #include "ash/wm/overview/window_selector.h"
28 #include "ash/wm/overview/window_selector_controller.h" 29 #include "ash/wm/overview/window_selector_controller.h"
29 #include "ash/wm/overview/window_selector_item.h" 30 #include "ash/wm/overview/window_selector_item.h"
30 #include "ash/wm/panels/panel_layout_manager.h" 31 #include "ash/wm/panels/panel_layout_manager.h"
31 #include "ash/wm/window_state.h" 32 #include "ash/wm/window_state.h"
32 #include "ash/wm/window_state_aura.h" 33 #include "ash/wm/window_state_aura.h"
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 ASSERT_TRUE(SelectWindow(window2.get())); 1478 ASSERT_TRUE(SelectWindow(window2.get()));
1478 SendKey(ui::VKEY_RETURN); 1479 SendKey(ui::VKEY_RETURN);
1479 EXPECT_FALSE(IsSelecting()); 1480 EXPECT_FALSE(IsSelecting());
1480 EXPECT_TRUE(wm::IsActiveWindow(window2.get())); 1481 EXPECT_TRUE(wm::IsActiveWindow(window2.get()));
1481 } 1482 }
1482 1483
1483 // Tests that overview mode hides the callout widget. 1484 // Tests that overview mode hides the callout widget.
1484 TEST_F(WindowSelectorTest, WindowOverviewHidesCalloutWidgets) { 1485 TEST_F(WindowSelectorTest, WindowOverviewHidesCalloutWidgets) {
1485 std::unique_ptr<aura::Window> panel1( 1486 std::unique_ptr<aura::Window> panel1(
1486 CreatePanelWindow(gfx::Rect(0, 0, 100, 100))); 1487 CreatePanelWindow(gfx::Rect(0, 0, 100, 100)));
1488 wm::WmWindow* wm_panel1 = wm::WmWindowAura::Get(panel1.get());
1487 std::unique_ptr<aura::Window> panel2( 1489 std::unique_ptr<aura::Window> panel2(
1488 CreatePanelWindow(gfx::Rect(0, 0, 100, 100))); 1490 CreatePanelWindow(gfx::Rect(0, 0, 100, 100)));
1489 PanelLayoutManager* panel_manager = 1491 wm::WmWindow* wm_panel2 = wm::WmWindowAura::Get(panel2.get());
1490 static_cast<PanelLayoutManager*>(panel1->parent()->layout_manager()); 1492 PanelLayoutManager* panel_manager = PanelLayoutManager::Get(wm_panel1);
1491 1493
1492 // By default, panel callout widgets are visible. 1494 // By default, panel callout widgets are visible.
1493 EXPECT_TRUE( 1495 EXPECT_TRUE(panel_manager->GetCalloutWidgetForPanel(wm_panel1)->IsVisible());
1494 panel_manager->GetCalloutWidgetForPanel(panel1.get())->IsVisible()); 1496 EXPECT_TRUE(panel_manager->GetCalloutWidgetForPanel(wm_panel2)->IsVisible());
1495 EXPECT_TRUE(
1496 panel_manager->GetCalloutWidgetForPanel(panel2.get())->IsVisible());
1497 1497
1498 // Toggling the overview should hide the callout widgets. 1498 // Toggling the overview should hide the callout widgets.
1499 ToggleOverview(); 1499 ToggleOverview();
1500 EXPECT_FALSE( 1500 EXPECT_FALSE(panel_manager->GetCalloutWidgetForPanel(wm_panel1)->IsVisible());
1501 panel_manager->GetCalloutWidgetForPanel(panel1.get())->IsVisible()); 1501 EXPECT_FALSE(panel_manager->GetCalloutWidgetForPanel(wm_panel2)->IsVisible());
1502 EXPECT_FALSE(
1503 panel_manager->GetCalloutWidgetForPanel(panel2.get())->IsVisible());
1504 1502
1505 // Ending the overview should show them again. 1503 // Ending the overview should show them again.
1506 ToggleOverview(); 1504 ToggleOverview();
1507 EXPECT_TRUE( 1505 EXPECT_TRUE(panel_manager->GetCalloutWidgetForPanel(wm_panel1)->IsVisible());
1508 panel_manager->GetCalloutWidgetForPanel(panel1.get())->IsVisible()); 1506 EXPECT_TRUE(panel_manager->GetCalloutWidgetForPanel(wm_panel2)->IsVisible());
1509 EXPECT_TRUE(
1510 panel_manager->GetCalloutWidgetForPanel(panel2.get())->IsVisible());
1511 } 1507 }
1512 1508
1513 // Creates three windows and tests filtering them by title. 1509 // Creates three windows and tests filtering them by title.
1514 TEST_F(WindowSelectorTest, BasicTextFiltering) { 1510 TEST_F(WindowSelectorTest, BasicTextFiltering) {
1515 gfx::Rect bounds(0, 0, 100, 100); 1511 gfx::Rect bounds(0, 0, 100, 100);
1516 std::unique_ptr<aura::Window> window2(CreateWindow(bounds)); 1512 std::unique_ptr<aura::Window> window2(CreateWindow(bounds));
1517 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); 1513 std::unique_ptr<aura::Window> window1(CreateWindow(bounds));
1518 std::unique_ptr<aura::Window> window0(CreateWindow(bounds)); 1514 std::unique_ptr<aura::Window> window0(CreateWindow(bounds));
1519 base::string16 window2_title = base::UTF8ToUTF16("Highway to test"); 1515 base::string16 window2_title = base::UTF8ToUTF16("Highway to test");
1520 base::string16 window1_title = base::UTF8ToUTF16("For those about to test"); 1516 base::string16 window1_title = base::UTF8ToUTF16("For those about to test");
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 // Switch to overview mode. 1637 // Switch to overview mode.
1642 ToggleOverview(); 1638 ToggleOverview();
1643 ASSERT_TRUE(IsSelecting()); 1639 ASSERT_TRUE(IsSelecting());
1644 1640
1645 // Tap should now exit overview mode. 1641 // Tap should now exit overview mode.
1646 generator.GestureTapAt(point_in_background_page); 1642 generator.GestureTapAt(point_in_background_page);
1647 EXPECT_FALSE(IsSelecting()); 1643 EXPECT_FALSE(IsSelecting());
1648 } 1644 }
1649 1645
1650 } // namespace ash 1646 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/overview/window_selector.cc ('k') | ash/wm/panels/panel_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698