OLD | NEW |
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 display::DisplayObserver::DISPLAY_METRIC_BOUNDS | | 107 display::DisplayObserver::DISPLAY_METRIC_BOUNDS | |
108 display::DisplayObserver::DISPLAY_METRIC_WORK_AREA; | 108 display::DisplayObserver::DISPLAY_METRIC_WORK_AREA; |
109 EXPECT_CALL(observer1_, | 109 EXPECT_CALL(observer1_, |
110 OnDisplayMetricsChanged(EqualsDisplay(display), changed_metrics)); | 110 OnDisplayMetricsChanged(EqualsDisplay(display), changed_metrics)); |
111 | 111 |
112 gfx::Size size1(100, 100); | 112 gfx::Size size1(100, 100); |
113 screen_->UpdateDisplayScaleAndSize(2.0f, size1); | 113 screen_->UpdateDisplayScaleAndSize(2.0f, size1); |
114 EXPECT_EQ(size1, screen_->GetPrimaryDisplay().GetSizeInPixel()); | 114 EXPECT_EQ(size1, screen_->GetPrimaryDisplay().GetSizeInPixel()); |
115 } | 115 } |
116 | 116 |
| 117 TEST_F(BlimpScreenTest, GetDisplayById) { |
| 118 // display_ in BlimpScreen has id 1 |
| 119 display::Display display; |
| 120 bool has_display1 = screen_->GetDisplayWithDisplayId(0, &display); |
| 121 EXPECT_FALSE(has_display1); |
| 122 bool has_display2 = screen_->GetDisplayWithDisplayId(1, &display); |
| 123 EXPECT_TRUE(has_display2); |
| 124 EXPECT_EQ(1, display.id()); |
| 125 } |
| 126 |
117 } // namespace | 127 } // namespace |
118 } // namespace engine | 128 } // namespace engine |
119 } // namespace blimp | 129 } // namespace blimp |
OLD | NEW |