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

Unified Diff: ash/wm/panel_layout_manager_unittest.cc

Issue 11363250: Allow Chrome apps to create Ash Panels (apps v2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address feedback and add unit test for PanelLayoutManager minimize/restore Created 8 years, 1 month 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
Index: ash/wm/panel_layout_manager_unittest.cc
diff --git a/ash/wm/panel_layout_manager_unittest.cc b/ash/wm/panel_layout_manager_unittest.cc
index e0a63b0532bf030cf895924440a6b00f4cb22cba..2b54317737f47f285375af77b9fb65210dd2dfd4 100644
--- a/ash/wm/panel_layout_manager_unittest.cc
+++ b/ash/wm/panel_layout_manager_unittest.cc
@@ -15,8 +15,9 @@
#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
-#include "ui/aura/window.h"
+#include "ui/aura/client/aura_constants.h"
#include "ui/aura/test/test_windows.h"
+#include "ui/aura/window.h"
#include "ui/views/widget/widget.h"
namespace ash {
@@ -260,5 +261,28 @@ TEST_F(PanelLayoutManagerTest, RemoveNonActivePanel) {
EXPECT_TRUE(WindowIsAbove(w2.get(), w3.get()));
}
+TEST_F(PanelLayoutManagerTest, MinimizeRestorePanel) {
+ gfx::Rect bounds(0, 0, 201, 201);
+ scoped_ptr<aura::Window> window(CreatePanelWindow(bounds));
+ // Activate the window, ensure callout is visible.
+ wm::ActivateWindow(window.get());
+ RunAllPendingInMessageLoop();
+ EXPECT_TRUE(IsCalloutVisible());
+ // Minimize the panel, callout should be hidden.
+ window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
+ RunAllPendingInMessageLoop();
+ EXPECT_FALSE(IsCalloutVisible());
+ // Restore the pantel; panel should not be activated by default and callout
+ // should be hidden.
+ window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
+ RunAllPendingInMessageLoop();
+ EXPECT_FALSE(IsCalloutVisible());
+ // Activate the window, ensure callout is visible.
+ wm::ActivateWindow(window.get());
+ RunAllPendingInMessageLoop();
+ EXPECT_TRUE(IsCalloutVisible());
+}
+
sky 2012/11/21 00:39:42 nit: remove one of these lines.
stevenjb 2012/11/29 02:30:38 Done.
+
} // namespace internal
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698