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

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

Issue 2896273004: chromeos: converts PanelLayoutManager to aura::Window (Closed)
Patch Set: feedback Created 3 years, 7 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/accessibility_types.h" 9 #include "ash/accessibility_types.h"
10 #include "ash/drag_drop/drag_drop_controller.h" 10 #include "ash/drag_drop/drag_drop_controller.h"
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after
1530 ASSERT_TRUE(SelectWindow(window2.get())); 1530 ASSERT_TRUE(SelectWindow(window2.get()));
1531 SendKey(ui::VKEY_RETURN); 1531 SendKey(ui::VKEY_RETURN);
1532 EXPECT_FALSE(IsSelecting()); 1532 EXPECT_FALSE(IsSelecting());
1533 EXPECT_TRUE(wm::IsActiveWindow(window2.get())); 1533 EXPECT_TRUE(wm::IsActiveWindow(window2.get()));
1534 } 1534 }
1535 1535
1536 // Tests that overview mode hides the callout widget. 1536 // Tests that overview mode hides the callout widget.
1537 TEST_F(WindowSelectorTest, WindowOverviewHidesCalloutWidgets) { 1537 TEST_F(WindowSelectorTest, WindowOverviewHidesCalloutWidgets) {
1538 std::unique_ptr<aura::Window> panel1( 1538 std::unique_ptr<aura::Window> panel1(
1539 CreatePanelWindow(gfx::Rect(0, 0, 100, 100))); 1539 CreatePanelWindow(gfx::Rect(0, 0, 100, 100)));
1540 WmWindow* wm_panel1 = WmWindow::Get(panel1.get());
1541 std::unique_ptr<aura::Window> panel2( 1540 std::unique_ptr<aura::Window> panel2(
1542 CreatePanelWindow(gfx::Rect(0, 0, 100, 100))); 1541 CreatePanelWindow(gfx::Rect(0, 0, 100, 100)));
1543 WmWindow* wm_panel2 = WmWindow::Get(panel2.get()); 1542 PanelLayoutManager* panel_manager = PanelLayoutManager::Get(panel1.get());
1544 PanelLayoutManager* panel_manager = PanelLayoutManager::Get(wm_panel1);
1545 1543
1546 // By default, panel callout widgets are visible. 1544 // By default, panel callout widgets are visible.
1547 EXPECT_TRUE(panel_manager->GetCalloutWidgetForPanel(wm_panel1)->IsVisible()); 1545 EXPECT_TRUE(
1548 EXPECT_TRUE(panel_manager->GetCalloutWidgetForPanel(wm_panel2)->IsVisible()); 1546 panel_manager->GetCalloutWidgetForPanel(panel1.get())->IsVisible());
1547 EXPECT_TRUE(
1548 panel_manager->GetCalloutWidgetForPanel(panel2.get())->IsVisible());
1549 1549
1550 // Toggling the overview should hide the callout widgets. 1550 // Toggling the overview should hide the callout widgets.
1551 ToggleOverview(); 1551 ToggleOverview();
1552 EXPECT_FALSE(panel_manager->GetCalloutWidgetForPanel(wm_panel1)->IsVisible()); 1552 EXPECT_FALSE(
1553 EXPECT_FALSE(panel_manager->GetCalloutWidgetForPanel(wm_panel2)->IsVisible()); 1553 panel_manager->GetCalloutWidgetForPanel(panel1.get())->IsVisible());
1554 EXPECT_FALSE(
1555 panel_manager->GetCalloutWidgetForPanel(panel2.get())->IsVisible());
1554 1556
1555 // Ending the overview should show them again. 1557 // Ending the overview should show them again.
1556 ToggleOverview(); 1558 ToggleOverview();
1557 EXPECT_TRUE(panel_manager->GetCalloutWidgetForPanel(wm_panel1)->IsVisible()); 1559 EXPECT_TRUE(
1558 EXPECT_TRUE(panel_manager->GetCalloutWidgetForPanel(wm_panel2)->IsVisible()); 1560 panel_manager->GetCalloutWidgetForPanel(panel1.get())->IsVisible());
1561 EXPECT_TRUE(
1562 panel_manager->GetCalloutWidgetForPanel(panel2.get())->IsVisible());
1559 } 1563 }
1560 1564
1561 // Creates three windows and tests filtering them by title. 1565 // Creates three windows and tests filtering them by title.
1562 TEST_F(WindowSelectorTest, BasicTextFiltering) { 1566 TEST_F(WindowSelectorTest, BasicTextFiltering) {
1563 gfx::Rect bounds(0, 0, 100, 100); 1567 gfx::Rect bounds(0, 0, 100, 100);
1564 std::unique_ptr<aura::Window> window2(CreateWindow(bounds)); 1568 std::unique_ptr<aura::Window> window2(CreateWindow(bounds));
1565 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); 1569 std::unique_ptr<aura::Window> window1(CreateWindow(bounds));
1566 std::unique_ptr<aura::Window> window0(CreateWindow(bounds)); 1570 std::unique_ptr<aura::Window> window0(CreateWindow(bounds));
1567 base::string16 window2_title = base::UTF8ToUTF16("Highway to test"); 1571 base::string16 window2_title = base::UTF8ToUTF16("Highway to test");
1568 base::string16 window1_title = base::UTF8ToUTF16("For those about to test"); 1572 base::string16 window1_title = base::UTF8ToUTF16("For those about to test");
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
1847 aura::client::WINDOW_MOVE_SOURCE_MOUSE)); 1851 aura::client::WINDOW_MOVE_SOURCE_MOUSE));
1848 ASSERT_TRUE(resizer.get()); 1852 ASSERT_TRUE(resizer.get());
1849 gfx::Point location = resizer->GetInitialLocation(); 1853 gfx::Point location = resizer->GetInitialLocation();
1850 location.Offset(20, 20); 1854 location.Offset(20, 20);
1851 resizer->Drag(location, 0); 1855 resizer->Drag(location, 0);
1852 ToggleOverview(); 1856 ToggleOverview();
1853 resizer->RevertDrag(); 1857 resizer->RevertDrag();
1854 } 1858 }
1855 1859
1856 } // namespace ash 1860 } // 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