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

Unified Diff: ash/display/display_controller_unittest.cc

Issue 10961021: Return primary display if out of bounds point or NULL ponter is passed to gfx::Screen::GeDisplayNea (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a few other tests that were using native coordinate. it shoud use screen coordinate now. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/display/display_controller.cc ('k') | ash/display/multi_display_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_controller_unittest.cc
diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc
index 6934cdd939b2aefba67a7a91a051b3bfbe43a783..97d7707730fb5131bf5925460bba13e4cbe61d1a 100644
--- a/ash/display/display_controller_unittest.cc
+++ b/ash/display/display_controller_unittest.cc
@@ -208,11 +208,19 @@ TEST_F(DisplayControllerTest, SwapPrimary) {
Shell::GetInstance()->launcher()->widget()->GetNativeView();
EXPECT_TRUE(primary_root->Contains(launcher_window));
EXPECT_FALSE(secondary_root->Contains(launcher_window));
+ EXPECT_EQ(primary_display.id(),
+ gfx::Screen::GetDisplayNearestPoint(gfx::Point(-100, -100)).id());
+ EXPECT_EQ(primary_display.id(),
+ gfx::Screen::GetDisplayNearestWindow(NULL).id());
// Switch primary and secondary
display_controller->SetPrimaryDisplay(secondary_display);
EXPECT_EQ(secondary_display.id(), gfx::Screen::GetPrimaryDisplay().id());
EXPECT_EQ(primary_display.id(), ScreenAsh::GetSecondaryDisplay().id());
+ EXPECT_EQ(secondary_display.id(),
+ gfx::Screen::GetDisplayNearestPoint(gfx::Point(-100, -100)).id());
+ EXPECT_EQ(secondary_display.id(),
+ gfx::Screen::GetDisplayNearestWindow(NULL).id());
EXPECT_EQ(
primary_root,
@@ -237,6 +245,10 @@ TEST_F(DisplayControllerTest, SwapPrimary) {
RunAllPendingInMessageLoop(); // RootWindow is deleted in a posted task.
EXPECT_EQ(1, gfx::Screen::GetNumDisplays());
EXPECT_EQ(primary_display.id(), gfx::Screen::GetPrimaryDisplay().id());
+ EXPECT_EQ(primary_display.id(),
+ gfx::Screen::GetDisplayNearestPoint(gfx::Point(-100, -100)).id());
+ EXPECT_EQ(primary_display.id(),
+ gfx::Screen::GetDisplayNearestWindow(NULL).id());
EXPECT_TRUE(tracker.Contains(primary_root));
EXPECT_FALSE(tracker.Contains(secondary_root));
EXPECT_TRUE(primary_root->Contains(launcher_window));
« no previous file with comments | « ash/display/display_controller.cc ('k') | ash/display/multi_display_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698