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

Unified Diff: ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc

Issue 2361283002: Add GetDisplayWithDisplayId to display::Screen. (Closed)
Patch Set: rebase Created 4 years, 1 month 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
Index: ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc
diff --git a/ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc b/ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc
index 65fdeee7aa367274806508e13182465fa74e5f1a..031d11b2314ef97523d21d0e5501a9eafe362b66 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc
+++ b/ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc
@@ -213,6 +213,26 @@ TEST_F(DesktopScreenX11Test, RemoveMonitorOnLeft) {
EXPECT_EQ(1u, removed_display_.size());
}
+TEST_F(DesktopScreenX11Test, GetDisplayById) {
sky 2016/11/19 15:01:40 Can you clarify why you need the same test for eac
+ std::vector<display::Display> displays;
+ displays.push_back(
+ display::Display(kFirstDisplay, gfx::Rect(0, 0, 640, 480)));
+ displays.push_back(
+ display::Display(kSecondDisplay, gfx::Rect(640, 0, 1024, 768)));
+ NotifyDisplaysChanged(displays);
+
+ display::Display display1;
+ bool has_display1 =
+ screen()->GetDisplayWithDisplayId(kFirstDisplay, &display1);
+ display::Display display2;
+ bool has_display2 =
+ screen()->GetDisplayWithDisplayId(kSecondDisplay, &display2);
+ EXPECT_TRUE(has_display1);
+ EXPECT_TRUE(has_display2);
+ EXPECT_EQ(kFirstDisplay, display1.id());
+ EXPECT_EQ(kSecondDisplay, display2.id());
+}
+
TEST_F(DesktopScreenX11Test, GetDisplayNearestPoint) {
std::vector<display::Display> displays;
displays.push_back(
« ui/display/win/screen_win_unittest.cc ('K') | « ui/display/win/screen_win_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698