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

Side by Side Diff: ash/display/multi_display_manager_unittest.cc

Issue 10795080: A couple of multiple displays support fixes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/display/multi_display_manager.cc ('k') | ash/wm/window_animations.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/display/multi_display_manager.h" 5 #include "ash/display/multi_display_manager.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/test/ash_test_base.h" 9 #include "ash/test/ash_test_base.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 #define MAYBE_NativeDisplayTest DISABLED_NativeDisplayTest 101 #define MAYBE_NativeDisplayTest DISABLED_NativeDisplayTest
102 #define MAYBE_EmulatorTest DISABLED_EmulatorTest 102 #define MAYBE_EmulatorTest DISABLED_EmulatorTest
103 #endif 103 #endif
104 104
105 TEST_F(MultiDisplayManagerTest, MAYBE_NativeDisplayTest) { 105 TEST_F(MultiDisplayManagerTest, MAYBE_NativeDisplayTest) {
106 aura::DisplayManager::set_use_fullscreen_host_window(true); 106 aura::DisplayManager::set_use_fullscreen_host_window(true);
107 107
108 EXPECT_EQ(1U, display_manager()->GetNumDisplays()); 108 EXPECT_EQ(1U, display_manager()->GetNumDisplays());
109 109
110 // Update primary and add seconary. 110 // Update primary and add seconary.
111 LOG(ERROR) << "A"; 111 UpdateDisplay("100+0-500x500,0+501-400x400");
112 UpdateDisplay("0+0-500x500,0+501-400x400");
113 EXPECT_EQ(2U, display_manager()->GetNumDisplays()); 112 EXPECT_EQ(2U, display_manager()->GetNumDisplays());
113 EXPECT_EQ("0,0 500x500",
114 display_manager()->GetDisplayAt(0)->bounds().ToString());
115
114 EXPECT_EQ("1 1 0", GetCountSummary()); 116 EXPECT_EQ("1 1 0", GetCountSummary());
115 EXPECT_EQ(display_manager()->GetDisplayAt(0)->id(), changed()[0].id()); 117 EXPECT_EQ(display_manager()->GetDisplayAt(0)->id(), changed()[0].id());
116 EXPECT_EQ(display_manager()->GetDisplayAt(1)->id(), added()[0].id()); 118 EXPECT_EQ(display_manager()->GetDisplayAt(1)->id(), added()[0].id());
117 EXPECT_EQ("0,0 500x500", changed()[0].bounds().ToString()); 119 EXPECT_EQ("0,0 500x500", changed()[0].bounds().ToString());
118 // Secondary display is on right. 120 // Secondary display is on right.
119 EXPECT_EQ("500,0 400x400", added()[0].bounds().ToString()); 121 EXPECT_EQ("500,0 400x400", added()[0].bounds().ToString());
120 EXPECT_EQ("0,501 400x400", added()[0].bounds_in_pixel().ToString()); 122 EXPECT_EQ("0,501 400x400", added()[0].bounds_in_pixel().ToString());
121 reset(); 123 reset();
122 124
123 LOG(ERROR) << "B";
124 // Delete secondary. 125 // Delete secondary.
125 UpdateDisplay("0+0-500x500"); 126 UpdateDisplay("100+0-500x500");
126 EXPECT_EQ("0 0 1", GetCountSummary()); 127 EXPECT_EQ("0 0 1", GetCountSummary());
127 reset(); 128 reset();
128 129
129 // Change primary. 130 // Change primary.
130 UpdateDisplay("0+0-1000x600"); 131 UpdateDisplay("0+0-1000x600");
131 EXPECT_EQ("1 0 0", GetCountSummary()); 132 EXPECT_EQ("1 0 0", GetCountSummary());
132 EXPECT_EQ(display_manager()->GetDisplayAt(0)->id(), changed()[0].id()); 133 EXPECT_EQ(display_manager()->GetDisplayAt(0)->id(), changed()[0].id());
133 EXPECT_EQ("0,0 1000x600", changed()[0].bounds().ToString()); 134 EXPECT_EQ("0,0 1000x600", changed()[0].bounds().ToString());
134 reset(); 135 reset();
135 136
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 UpdateDisplay("1000x600*2"); 245 UpdateDisplay("1000x600*2");
245 EXPECT_EQ(2, 246 EXPECT_EQ(2,
246 Shell::GetPrimaryRootWindow()->compositor()->device_scale_factor()); 247 Shell::GetPrimaryRootWindow()->compositor()->device_scale_factor());
247 EXPECT_EQ("500x300", 248 EXPECT_EQ("500x300",
248 Shell::GetPrimaryRootWindow()->bounds().size().ToString()); 249 Shell::GetPrimaryRootWindow()->bounds().size().ToString());
249 aura::DisplayManager::set_use_fullscreen_host_window(false); 250 aura::DisplayManager::set_use_fullscreen_host_window(false);
250 } 251 }
251 252
252 } // namespace test 253 } // namespace test
253 } // namespace ash 254 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/multi_display_manager.cc ('k') | ash/wm/window_animations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698