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

Unified Diff: ash/display/display_manager_unittest.cc

Issue 1130653004: Remove the removed display from the active list after displays are added (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months 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
« no previous file with comments | « ash/display/display_manager.cc ('k') | ash/test/display_manager_test_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « ash/display/display_manager.cc ('k') | ash/test/display_manager_test_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698