| Index: ash/display/display_manager_unittest.cc
|
| diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc
|
| index dfcd69a0a1e77c9618fe237a4c98fb3db4cc28df..fbb737cfdc97e4833a6fb8d8bc6cc27205bb913a 100644
|
| --- a/ash/display/display_manager_unittest.cc
|
| +++ b/ash/display/display_manager_unittest.cc
|
| @@ -15,10 +15,12 @@
|
| #include "ash/test/ash_test_base.h"
|
| #include "ash/test/display_manager_test_api.h"
|
| #include "ash/test/mirror_window_test_api.h"
|
| +#include "ash/wm/window_state.h"
|
| #include "base/command_line.h"
|
| #include "base/format_macros.h"
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/stringprintf.h"
|
| +#include "ui/aura/client/aura_constants.h"
|
| #include "ui/aura/env.h"
|
| #include "ui/aura/window_observer.h"
|
| #include "ui/aura/window_tree_host.h"
|
| @@ -1512,6 +1514,27 @@ TEST_F(DisplayManagerTest, RotateUnifiedDesktop) {
|
| EXPECT_EQ("300x200", screen->GetPrimaryDisplay().size().ToString());
|
| }
|
|
|
| +// Makes sure the transition from unified to single won't crash
|
| +// with docked wnidows.
|
| +TEST_F(DisplayManagerTest, UnifiedWithDockWindows) {
|
| + if (!SupportsMultipleDisplays())
|
| + return;
|
| +
|
| + display_manager()->SetDefaultMultiDisplayMode(DisplayManager::UNIFIED);
|
| + display_manager()->SetMultiDisplayMode(DisplayManager::UNIFIED);
|
| + UpdateDisplay("300x200,400x500");
|
| +
|
| + scoped_ptr<aura::Window> docked(
|
| + CreateTestWindowInShellWithBounds(gfx::Rect(10, 10, 50, 50)));
|
| + docked->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_DOCKED);
|
| + ASSERT_TRUE(wm::GetWindowState(docked.get())->IsDocked());
|
| + EXPECT_EQ("0,0 250x453", docked->bounds().ToString());
|
| + UpdateDisplay("300x200");
|
| + // Make sure the window is still docked.
|
| + EXPECT_TRUE(wm::GetWindowState(docked.get())->IsDocked());
|
| + EXPECT_EQ("0,0 250x250", docked->bounds().ToString());
|
| +}
|
| +
|
| class ScreenShutdownTest : public test::AshTestBase {
|
| public:
|
| ScreenShutdownTest() {
|
|
|