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

Side by Side Diff: ash/wm/base_layout_manager_unittest.cc

Issue 23483041: [Cleanup] Remove mac code from aura/ash/views (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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/test/test_suite.cc ('k') | ash/wm/system_modal_container_layout_manager_unittest.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/wm/base_layout_manager.h" 5 #include "ash/wm/base_layout_manager.h"
6 6
7 #include "ash/screen_ash.h" 7 #include "ash/screen_ash.h"
8 #include "ash/session_state_delegate.h" 8 #include "ash/session_state_delegate.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow( 166 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow(
167 window.get()).bounds().ToString(), 167 window.get()).bounds().ToString(),
168 window->bounds().ToString()); 168 window->bounds().ToString());
169 // Enlarge the root window. We should still match the display size. 169 // Enlarge the root window. We should still match the display size.
170 UpdateDisplay("800x600"); 170 UpdateDisplay("800x600");
171 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow( 171 EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow(
172 window.get()).bounds().ToString(), 172 window.get()).bounds().ToString(),
173 window->bounds().ToString()); 173 window->bounds().ToString());
174 } 174 }
175 175
176 // Fails on Mac only. Need to be implemented. http://crbug.com/111279.
177 #if defined(OS_MACOSX)
178 #define MAYBE_RootWindowResizeShrinksWindows \
179 DISABLED_RootWindowResizeShrinksWindows
180 #else
181 #define MAYBE_RootWindowResizeShrinksWindows RootWindowResizeShrinksWindows
182 #endif
183 // Tests that when the screen gets smaller the windows aren't bigger than 176 // Tests that when the screen gets smaller the windows aren't bigger than
184 // the screen. 177 // the screen.
185 TEST_F(BaseLayoutManagerTest, MAYBE_RootWindowResizeShrinksWindows) { 178 TEST_F(BaseLayoutManagerTest, RootWindowResizeShrinksWindows) {
186 scoped_ptr<aura::Window> window( 179 scoped_ptr<aura::Window> window(
187 CreateTestWindow(gfx::Rect(10, 20, 500, 400))); 180 CreateTestWindow(gfx::Rect(10, 20, 500, 400)));
188 gfx::Rect work_area = Shell::GetScreen()->GetDisplayNearestWindow( 181 gfx::Rect work_area = Shell::GetScreen()->GetDisplayNearestWindow(
189 window.get()).work_area(); 182 window.get()).work_area();
190 // Invariant: Window is smaller than work area. 183 // Invariant: Window is smaller than work area.
191 EXPECT_LE(window->bounds().width(), work_area.width()); 184 EXPECT_LE(window->bounds().width(), work_area.width());
192 EXPECT_LE(window->bounds().height(), work_area.height()); 185 EXPECT_LE(window->bounds().height(), work_area.height());
193 186
194 // Make the root window narrower than our window. 187 // Make the root window narrower than our window.
195 UpdateDisplay("300x400"); 188 UpdateDisplay("300x400");
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 ScreenAsh::GetMaximizedWindowBoundsInParent(window.get()).ToString(), 300 ScreenAsh::GetMaximizedWindowBoundsInParent(window.get()).ToString(),
308 window_bounds.ToString()); 301 window_bounds.ToString());
309 302
310 Shell::GetInstance()->session_state_delegate()->UnlockScreen(); 303 Shell::GetInstance()->session_state_delegate()->UnlockScreen();
311 shelf->UpdateVisibilityState(); 304 shelf->UpdateVisibilityState();
312 EXPECT_EQ(window_bounds.ToString(), window->bounds().ToString()); 305 EXPECT_EQ(window_bounds.ToString(), window->bounds().ToString());
313 } 306 }
314 307
315 } // namespace 308 } // namespace
316 } // namespace ash 309 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/test_suite.cc ('k') | ash/wm/system_modal_container_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698