Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / ash / wm / workspace / workspace_layout_manager_unittest.cc
index 3a9a58a..76c7b24 100644 (file)
@@ -162,6 +162,19 @@ TEST_F(WorkspaceLayoutManagerTest, KeepMinimumVisibilityInDisplays) {
   EXPECT_EQ("10,-500 200x200", window2->GetBoundsInScreen().ToString());
 }
 
+TEST_F(WorkspaceLayoutManagerTest, NoMinimumVisibilityForPopupWindows) {
+  UpdateDisplay("300x400");
+
+  // Create a popup window out of display boundaries and make sure it is not
+  // moved to have minimum visibility.
+  scoped_ptr<aura::Window> window(
+      CreateTestWindowInShellWithDelegateAndType(NULL,
+                                                 ui::wm::WINDOW_TYPE_POPUP,
+                                                 0,
+                                                 gfx::Rect(400, 100, 50, 50)));
+  EXPECT_EQ("400,100 50x50", window->GetBoundsInScreen().ToString());
+}
+
 TEST_F(WorkspaceLayoutManagerTest, KeepRestoredWindowInDisplay) {
   if (!SupportsHostWindowResize())
     return;
@@ -510,8 +523,7 @@ TEST_F(WorkspaceLayoutManagerTest, NotifyFullscreenChanges) {
   EXPECT_FALSE(observer.is_fullscreen());
 }
 
-// Following tests were originally written for BaseLayoutManager.
-
+// Following "Solo" tests were originally written for BaseLayoutManager.
 namespace {
 
 class WorkspaceLayoutManagerSoloTest : public test::AshTestBase {
@@ -519,15 +531,6 @@ class WorkspaceLayoutManagerSoloTest : public test::AshTestBase {
   WorkspaceLayoutManagerSoloTest() {}
   virtual ~WorkspaceLayoutManagerSoloTest() {}
 
-  virtual void SetUp() OVERRIDE {
-    test::AshTestBase::SetUp();
-    UpdateDisplay("800x600");
-    aura::Window* default_container = Shell::GetContainer(
-        Shell::GetPrimaryRootWindow(), kShellWindowId_DefaultContainer);
-    default_container->SetLayoutManager(
-        new WorkspaceLayoutManager(Shell::GetPrimaryRootWindow()));
-  }
-
   aura::Window* CreateTestWindow(const gfx::Rect& bounds) {
     return CreateTestWindowInShellWithBounds(bounds);
   }
@@ -980,8 +983,8 @@ class WorkspaceLayoutManagerKeyboardTest : public test::AshTestBase {
     UpdateDisplay("800x600");
     aura::Window* default_container = Shell::GetContainer(
         Shell::GetPrimaryRootWindow(), kShellWindowId_DefaultContainer);
-    layout_manager_ = new WorkspaceLayoutManager(Shell::GetPrimaryRootWindow());
-    default_container->SetLayoutManager(layout_manager_);
+    layout_manager_ = static_cast<WorkspaceLayoutManager*>(
+        default_container->layout_manager());
   }
 
   aura::Window* CreateTestWindow(const gfx::Rect& bounds) {