OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 #include "ui/ozone/platform/drm/gpu/crtc_controller.h" | 6 #include "ui/ozone/platform/drm/gpu/crtc_controller.h" |
7 #include "ui/ozone/platform/drm/gpu/drm_buffer.h" | 7 #include "ui/ozone/platform/drm/gpu/drm_buffer.h" |
8 #include "ui/ozone/platform/drm/gpu/drm_device_generator.h" | 8 #include "ui/ozone/platform/drm/gpu/drm_device_generator.h" |
9 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h" | 9 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h" |
10 #include "ui/ozone/platform/drm/gpu/drm_window.h" | 10 #include "ui/ozone/platform/drm/gpu/drm_window.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 kDefaultMode); | 141 kDefaultMode); |
142 drmModeModeInfo new_mode = kDefaultMode; | 142 drmModeModeInfo new_mode = kDefaultMode; |
143 new_mode.vdisplay = 10; | 143 new_mode.vdisplay = 10; |
144 screen_manager_->ConfigureDisplayController( | 144 screen_manager_->ConfigureDisplayController( |
145 drm_, kPrimaryCrtc, kPrimaryConnector, GetPrimaryBounds().origin(), | 145 drm_, kPrimaryCrtc, kPrimaryConnector, GetPrimaryBounds().origin(), |
146 new_mode); | 146 new_mode); |
147 | 147 |
148 gfx::Rect new_bounds(0, 0, new_mode.hdisplay, new_mode.vdisplay); | 148 gfx::Rect new_bounds(0, 0, new_mode.hdisplay, new_mode.vdisplay); |
149 EXPECT_TRUE(screen_manager_->GetDisplayController(new_bounds)); | 149 EXPECT_TRUE(screen_manager_->GetDisplayController(new_bounds)); |
150 EXPECT_FALSE(screen_manager_->GetDisplayController(GetSecondaryBounds())); | 150 EXPECT_FALSE(screen_manager_->GetDisplayController(GetSecondaryBounds())); |
151 drmModeModeInfo mode = | 151 drmModeModeInfo mode = screen_manager_->GetDisplayController(new_bounds) |
152 screen_manager_->GetDisplayController(new_bounds)->get_mode(); | 152 ->crtc_controllers()[0] |
| 153 ->mode(); |
153 EXPECT_EQ(new_mode.vdisplay, mode.vdisplay); | 154 EXPECT_EQ(new_mode.vdisplay, mode.vdisplay); |
154 EXPECT_EQ(new_mode.hdisplay, mode.hdisplay); | 155 EXPECT_EQ(new_mode.hdisplay, mode.hdisplay); |
155 } | 156 } |
156 | 157 |
157 TEST_F(ScreenManagerTest, CheckForControllersInMirroredMode) { | 158 TEST_F(ScreenManagerTest, CheckForControllersInMirroredMode) { |
158 screen_manager_->AddDisplayController(drm_, kPrimaryCrtc, kPrimaryConnector); | 159 screen_manager_->AddDisplayController(drm_, kPrimaryCrtc, kPrimaryConnector); |
159 screen_manager_->ConfigureDisplayController( | 160 screen_manager_->ConfigureDisplayController( |
160 drm_, kPrimaryCrtc, kPrimaryConnector, GetPrimaryBounds().origin(), | 161 drm_, kPrimaryCrtc, kPrimaryConnector, GetPrimaryBounds().origin(), |
161 kDefaultMode); | 162 kDefaultMode); |
162 screen_manager_->AddDisplayController(drm_, kSecondaryCrtc, | 163 screen_manager_->AddDisplayController(drm_, kSecondaryCrtc, |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 screen_manager_->AddDisplayController(drm_, kPrimaryCrtc, kPrimaryConnector); | 469 screen_manager_->AddDisplayController(drm_, kPrimaryCrtc, kPrimaryConnector); |
469 screen_manager_->ConfigureDisplayController( | 470 screen_manager_->ConfigureDisplayController( |
470 drm_, kPrimaryCrtc, kPrimaryConnector, GetPrimaryBounds().origin(), | 471 drm_, kPrimaryCrtc, kPrimaryConnector, GetPrimaryBounds().origin(), |
471 kDefaultMode); | 472 kDefaultMode); |
472 | 473 |
473 EXPECT_EQ(buffer->GetFramebufferId(), drm_->current_framebuffer()); | 474 EXPECT_EQ(buffer->GetFramebufferId(), drm_->current_framebuffer()); |
474 | 475 |
475 window = screen_manager_->RemoveWindow(1); | 476 window = screen_manager_->RemoveWindow(1); |
476 window->Shutdown(); | 477 window->Shutdown(); |
477 } | 478 } |
OLD | NEW |