Index: athena/wm/window_manager_unittest.cc |
diff --git a/athena/wm/window_manager_unittest.cc b/athena/wm/window_manager_unittest.cc |
index 35ab704a1ccf1731e8cfbdbef4f53e156c16bda3..9150f0fed329715b019250c87c24589e2d4ce448 100644 |
--- a/athena/wm/window_manager_unittest.cc |
+++ b/athena/wm/window_manager_unittest.cc |
@@ -4,9 +4,40 @@ |
#include "athena/wm/public/window_manager.h" |
+#include "athena/screen/public/screen_manager.h" |
#include "athena/test/athena_test_base.h" |
+#include "ui/aura/client/window_tree_client.h" |
+#include "ui/aura/window.h" |
+#include "ui/gfx/display.h" |
+#include "ui/gfx/insets.h" |
+#include "ui/gfx/screen.h" |
-typedef athena::test::AthenaTestBase WindowManagerTest; |
+namespace athena { |
+ |
+typedef test::AthenaTestBase WindowManagerTest; |
TEST_F(WindowManagerTest, Empty) { |
} |
+ |
+// Verifies that activities are created with the work area bounds. |
+TEST_F(WindowManagerTest, NewActivityBounds) { |
+ gfx::Insets work_area_insets(1, 2, 3, 4); |
+ ScreenManager::Get()->SetWorkAreaInsets(work_area_insets); |
+ |
+ aura::Window* window = new aura::Window(NULL); |
+ window->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
+ window->Init(aura::WINDOW_LAYER_TEXTURED); |
+ aura::client::ParentWindowWithContext( |
+ window, ScreenManager::Get()->GetContext(), gfx::Rect()); |
+ window->Show(); |
+ |
+ gfx::Display display = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); |
+ gfx::Rect expected_work_area_bounds = display.bounds(); |
+ expected_work_area_bounds.Inset(work_area_insets); |
+ EXPECT_EQ(expected_work_area_bounds.ToString(), |
+ display.work_area().ToString()); |
+ EXPECT_EQ(expected_work_area_bounds.ToString(), |
+ window->GetBoundsInScreen().ToString()); |
+} |
+ |
+} // namespace athena |