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

Unified Diff: ash/wm/panels/panel_layout_manager_unittest.cc

Issue 13482010: Align panels over hidden launcher icons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test PanelLayoutManagerTest.PanelAlignsToHiddenLauncherIcon Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/panels/panel_layout_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/panels/panel_layout_manager_unittest.cc
diff --git a/ash/wm/panels/panel_layout_manager_unittest.cc b/ash/wm/panels/panel_layout_manager_unittest.cc
index d1df50e948a03bf906600b4536afd39108c23fc1..23318f10a2d1db2741241d250c6c535ea1a9f169 100644
--- a/ash/wm/panels/panel_layout_manager_unittest.cc
+++ b/ash/wm/panels/panel_layout_manager_unittest.cc
@@ -11,6 +11,7 @@
#include "ash/launcher/launcher_view.h"
#include "ash/root_window_controller.h"
#include "ash/screen_ash.h"
+#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_types.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
@@ -121,7 +122,7 @@ class PanelLayoutManagerTest : public test::AshTestBase {
Launcher* launcher =
RootWindowController::ForLauncher(panel)->shelf()->launcher();
gfx::Rect icon_bounds = launcher->GetScreenBoundsOfItemIconForWindow(panel);
- ASSERT_FALSE(icon_bounds.IsEmpty());
+ ASSERT_FALSE(icon_bounds.width() == 0 && icon_bounds.height() == 0);
gfx::Rect window_bounds = panel->GetBoundsInScreen();
gfx::Rect launcher_bounds = launcher->shelf_widget()->
@@ -239,6 +240,15 @@ class PanelLayoutManagerTest : public test::AshTestBase {
return shell->GetShelfAlignment(root_window);
}
+ void SetShelfAutoHideBehavior(aura::Window* window,
+ ShelfAutoHideBehavior behavior) {
+ internal::ShelfLayoutManager* shelf =
+ RootWindowController::ForWindow(window)->shelf()->
+ shelf_layout_manager();
+ shelf->SetAutoHideBehavior(behavior);
+ shelf->UpdateAutoHideState();
+ }
+
private:
scoped_ptr<test::LauncherViewTestAPI> launcher_view_test_;
@@ -259,6 +269,17 @@ TEST_F(PanelLayoutManagerTest, AddOnePanel) {
EXPECT_NO_FATAL_FAILURE(IsPanelAboveLauncherIcon(window.get()));
}
+// Tests that a created panel window is successfully aligned over a hidden
+// launcher icon.
+TEST_F(PanelLayoutManagerTest, PanelAlignsToHiddenLauncherIcon) {
+ gfx::Rect bounds(0, 0, 201, 201);
+ SetShelfAutoHideBehavior(Shell::GetPrimaryRootWindow(),
+ SHELF_AUTO_HIDE_ALWAYS_HIDDEN);
+ scoped_ptr<aura::Window> window(CreatePanelWindow(bounds));
+ EXPECT_EQ(GetPanelContainer(window.get()), window->parent());
+ EXPECT_NO_FATAL_FAILURE(IsPanelAboveLauncherIcon(window.get()));
+}
+
// Tests interactions between multiple panels
TEST_F(PanelLayoutManagerTest, MultiplePanelsAreAboveIcons) {
gfx::Rect odd_bounds(0, 0, 201, 201);
« no previous file with comments | « ash/wm/panels/panel_layout_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698