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

Side by Side Diff: ash/wm/panels/panel_layout_manager_unittest.cc

Issue 2288993002: ash: Move AppList support to ShelfWidget, expose ShelfWidget in WmShelf (Closed)
Patch Set: missed one unit test Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/common/wm/panels/panel_layout_manager.h" 5 #include "ash/common/wm/panels/panel_layout_manager.h"
6 6
7 #include "ash/aura/wm_window_aura.h" 7 #include "ash/aura/wm_window_aura.h"
8 #include "ash/common/ash_switches.h" 8 #include "ash/common/ash_switches.h"
9 #include "ash/common/display/display_info.h" 9 #include "ash/common/display/display_info.h"
10 #include "ash/common/shelf/shelf_button.h" 10 #include "ash/common/shelf/shelf_button.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 shelf_view_test()->RunMessageLoopUntilAnimationsDone(); 152 shelf_view_test()->RunMessageLoopUntilAnimationsDone();
153 153
154 WmWindow* wm_panel = WmWindowAura::Get(panel); 154 WmWindow* wm_panel = WmWindowAura::Get(panel);
155 WmShelf* shelf = wm_panel->GetRootWindowController()->GetShelf(); 155 WmShelf* shelf = wm_panel->GetRootWindowController()->GetShelf();
156 gfx::Rect icon_bounds = shelf->GetScreenBoundsOfItemIconForWindow(wm_panel); 156 gfx::Rect icon_bounds = shelf->GetScreenBoundsOfItemIconForWindow(wm_panel);
157 ASSERT_FALSE(icon_bounds.width() == 0 && icon_bounds.height() == 0); 157 ASSERT_FALSE(icon_bounds.width() == 0 && icon_bounds.height() == 0);
158 158
159 gfx::Rect window_bounds = panel->GetBoundsInScreen(); 159 gfx::Rect window_bounds = panel->GetBoundsInScreen();
160 ASSERT_LT(icon_bounds.width(), window_bounds.width()); 160 ASSERT_LT(icon_bounds.width(), window_bounds.width());
161 ASSERT_LT(icon_bounds.height(), window_bounds.height()); 161 ASSERT_LT(icon_bounds.height(), window_bounds.height());
162 gfx::Rect shelf_bounds = 162 gfx::Rect shelf_bounds = shelf->shelf_widget()->GetWindowBoundsInScreen();
163 shelf->GetShelfWidgetForTesting()->GetWindowBoundsInScreen();
164 const ShelfAlignment alignment = shelf->alignment(); 163 const ShelfAlignment alignment = shelf->alignment();
165 164
166 if (IsHorizontal(alignment)) { 165 if (IsHorizontal(alignment)) {
167 // The horizontal bounds of the panel window should contain the bounds of 166 // The horizontal bounds of the panel window should contain the bounds of
168 // the shelf icon. 167 // the shelf icon.
169 EXPECT_LE(window_bounds.x(), icon_bounds.x()); 168 EXPECT_LE(window_bounds.x(), icon_bounds.x());
170 EXPECT_GE(window_bounds.right(), icon_bounds.right()); 169 EXPECT_GE(window_bounds.right(), icon_bounds.right());
171 } else { 170 } else {
172 // The vertical bounds of the panel window should contain the bounds of 171 // The vertical bounds of the panel window should contain the bounds of
173 // the shelf icon. 172 // the shelf icon.
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5)); 912 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5));
914 target = targeter->FindTargetForEvent(root, &touch); 913 target = targeter->FindTargetForEvent(root, &touch);
915 EXPECT_NE(w.get(), target); 914 EXPECT_NE(w.get(), target);
916 } 915 }
917 916
918 INSTANTIATE_TEST_CASE_P(LtrRtl, 917 INSTANTIATE_TEST_CASE_P(LtrRtl,
919 PanelLayoutManagerTextDirectionTest, 918 PanelLayoutManagerTextDirectionTest,
920 testing::Bool()); 919 testing::Bool());
921 920
922 } // namespace ash 921 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698