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

Side by Side Diff: blimp/engine/app/ui/blimp_screen_unittest.cc

Issue 2361283002: Add GetDisplayWithDisplayId to display::Screen. (Closed)
Patch Set: test Created 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "blimp/engine/app/ui/blimp_screen.h" 5 #include "blimp/engine/app/ui/blimp_screen.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 display::DisplayObserver::DISPLAY_METRIC_DEVICE_SCALE_FACTOR | 102 display::DisplayObserver::DISPLAY_METRIC_DEVICE_SCALE_FACTOR |
103 display::DisplayObserver::DISPLAY_METRIC_BOUNDS; 103 display::DisplayObserver::DISPLAY_METRIC_BOUNDS;
104 EXPECT_CALL(observer1_, 104 EXPECT_CALL(observer1_,
105 OnDisplayMetricsChanged(EqualsDisplay(display), changed_metrics)); 105 OnDisplayMetricsChanged(EqualsDisplay(display), changed_metrics));
106 106
107 gfx::Size size1(100, 100); 107 gfx::Size size1(100, 100);
108 screen_->UpdateDisplayScaleAndSize(2.0f, size1); 108 screen_->UpdateDisplayScaleAndSize(2.0f, size1);
109 EXPECT_EQ(size1, screen_->GetPrimaryDisplay().GetSizeInPixel()); 109 EXPECT_EQ(size1, screen_->GetPrimaryDisplay().GetSizeInPixel());
110 } 110 }
111 111
112 TEST_F(BlimpScreenTest, GetDisplayById) {
113 // display_ in BlimpScreen has id 1
114 display::Display display;
115 bool has_display1 = screen_->GetDisplayWithDisplayId(0, &display);
116 EXPECT_FALSE(has_display1);
117 bool has_display2 = screen_->GetDisplayWithDisplayId(1, &display);
118 EXPECT_FALSE(has_display2);
sadrul 2016/09/23 19:51:12 Should be TRUE?
riajiang 2016/10/05 14:54:11 Yes!
119 EXPECT_EQ(1, display.id());
120 }
121
112 } // namespace 122 } // namespace
113 } // namespace engine 123 } // namespace engine
114 } // namespace blimp 124 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698