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

Unified Diff: ash/wm/base_layout_manager_unittest.cc

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix new addition Created 8 years, 2 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/ui_controls_ash.cc ('k') | ash/wm/coordinate_conversion.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/base_layout_manager_unittest.cc
diff --git a/ash/wm/base_layout_manager_unittest.cc b/ash/wm/base_layout_manager_unittest.cc
index d9938851d3c13eb00dac2163176b069fc9cc8dc6..daaa153ba732d33084e35db651d58b644aa8734d 100644
--- a/ash/wm/base_layout_manager_unittest.cc
+++ b/ash/wm/base_layout_manager_unittest.cc
@@ -100,9 +100,9 @@ TEST_F(BaseLayoutManagerTest, Fullscreen) {
scoped_ptr<aura::Window> window(CreateTestWindow(bounds));
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
// Fullscreen window fills the whole display.
- EXPECT_EQ(
- gfx::Screen::GetDisplayNearestWindow(window.get()).bounds().ToString(),
- window->bounds().ToString());
+ EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow(
+ window.get()).bounds().ToString(),
+ window->bounds().ToString());
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
EXPECT_EQ(bounds.ToString(), window->bounds().ToString());
}
@@ -113,14 +113,14 @@ TEST_F(BaseLayoutManagerTest, FullscreenRootWindowResize) {
scoped_ptr<aura::Window> window(CreateTestWindow(bounds));
// Fullscreen window fills the whole display.
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
- EXPECT_EQ(
- gfx::Screen::GetDisplayNearestWindow(window.get()).bounds().ToString(),
- window->bounds().ToString());
+ EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow(
+ window.get()).bounds().ToString(),
+ window->bounds().ToString());
// Enlarge the root window. We should still match the display size.
Shell::GetPrimaryRootWindow()->SetHostSize(gfx::Size(800, 600));
- EXPECT_EQ(
- gfx::Screen::GetDisplayNearestWindow(window.get()).bounds().ToString(),
- window->bounds().ToString());
+ EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow(
+ window.get()).bounds().ToString(),
+ window->bounds().ToString());
}
// Fails on Mac only. Need to be implemented. http://crbug.com/111279.
@@ -135,21 +135,23 @@ TEST_F(BaseLayoutManagerTest, FullscreenRootWindowResize) {
TEST_F(BaseLayoutManagerTest, MAYBE_RootWindowResizeShrinksWindows) {
scoped_ptr<aura::Window> window(
CreateTestWindow(gfx::Rect(10, 20, 500, 400)));
- gfx::Rect work_area =
- gfx::Screen::GetDisplayNearestWindow(window.get()).work_area();
+ gfx::Rect work_area = Shell::GetScreen()->GetDisplayNearestWindow(
+ window.get()).work_area();
// Invariant: Window is smaller than work area.
EXPECT_LE(window->bounds().width(), work_area.width());
EXPECT_LE(window->bounds().height(), work_area.height());
// Make the root window narrower than our window.
Shell::GetPrimaryRootWindow()->SetHostSize(gfx::Size(300, 400));
- work_area = gfx::Screen::GetDisplayNearestWindow(window.get()).work_area();
+ work_area = Shell::GetScreen()->GetDisplayNearestWindow(
+ window.get()).work_area();
EXPECT_LE(window->bounds().width(), work_area.width());
EXPECT_LE(window->bounds().height(), work_area.height());
// Make the root window shorter than our window.
Shell::GetPrimaryRootWindow()->SetHostSize(gfx::Size(300, 200));
- work_area = gfx::Screen::GetDisplayNearestWindow(window.get()).work_area();
+ work_area = Shell::GetScreen()->GetDisplayNearestWindow(
+ window.get()).work_area();
EXPECT_LE(window->bounds().width(), work_area.width());
EXPECT_LE(window->bounds().height(), work_area.height());
@@ -164,7 +166,7 @@ TEST_F(BaseLayoutManagerTest, MAYBE_RootWindowResizeShrinksWindows) {
// to smaller than the full work area.
TEST_F(BaseLayoutManagerTest, BoundsWithScreenEdgeVisible) {
// Create a window with bounds that fill the screen.
- gfx::Rect bounds = gfx::Screen::GetPrimaryDisplay().bounds();
+ gfx::Rect bounds = Shell::GetScreen()->GetPrimaryDisplay().bounds();
scoped_ptr<aura::Window> window(CreateTestWindow(bounds));
// Maximize it, which writes the old bounds to restore bounds.
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
« no previous file with comments | « ash/ui_controls_ash.cc ('k') | ash/wm/coordinate_conversion.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698