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;
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 {
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);
}
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) {