Index: ui/ozone/platform/drm/gpu/screen_manager_unittest.cc |
diff --git a/ui/ozone/platform/drm/gpu/screen_manager_unittest.cc b/ui/ozone/platform/drm/gpu/screen_manager_unittest.cc |
index 7ed42666ed0ff5373157780dad39649c798b1336..6cd9c7ecbf5b493d9d708015b75f0227c2ba382b 100644 |
--- a/ui/ozone/platform/drm/gpu/screen_manager_unittest.cc |
+++ b/ui/ozone/platform/drm/gpu/screen_manager_unittest.cc |
@@ -5,6 +5,7 @@ |
#include "testing/gtest/include/gtest/gtest.h" |
#include "ui/ozone/platform/drm/gpu/crtc_controller.h" |
#include "ui/ozone/platform/drm/gpu/drm_buffer.h" |
+#include "ui/ozone/platform/drm/gpu/drm_device_generator.h" |
#include "ui/ozone/platform/drm/gpu/drm_device_manager.h" |
#include "ui/ozone/platform/drm/gpu/drm_window.h" |
#include "ui/ozone/platform/drm/gpu/hardware_display_controller.h" |
@@ -41,6 +42,7 @@ class ScreenManagerTest : public testing::Test { |
void SetUp() override { |
drm_ = new ui::MockDrmDevice(); |
+ device_manager_.reset(new ui::DrmDeviceManager(nullptr)); |
buffer_generator_.reset(new ui::DrmBufferGenerator()); |
screen_manager_.reset(new ui::ScreenManager(buffer_generator_.get())); |
} |
@@ -51,6 +53,7 @@ class ScreenManagerTest : public testing::Test { |
protected: |
scoped_refptr<ui::MockDrmDevice> drm_; |
+ scoped_ptr<ui::DrmDeviceManager> device_manager_; |
scoped_ptr<ui::DrmBufferGenerator> buffer_generator_; |
scoped_ptr<ui::ScreenManager> screen_manager_; |
@@ -308,9 +311,8 @@ TEST_F(ScreenManagerTest, |
} |
TEST_F(ScreenManagerTest, CheckControllerToWindowMappingWithSameBounds) { |
- ui::DrmDeviceManager device_manager(drm_); |
scoped_ptr<ui::DrmWindow> window( |
- new ui::DrmWindow(1, &device_manager, screen_manager_.get())); |
+ new ui::DrmWindow(1, device_manager_.get(), screen_manager_.get())); |
window->Initialize(); |
window->OnBoundsChanged(GetPrimaryBounds()); |
screen_manager_->AddWindow(1, window.Pass()); |
@@ -327,9 +329,8 @@ TEST_F(ScreenManagerTest, CheckControllerToWindowMappingWithSameBounds) { |
} |
TEST_F(ScreenManagerTest, CheckControllerToWindowMappingWithDifferentBounds) { |
- ui::DrmDeviceManager device_manager(drm_); |
scoped_ptr<ui::DrmWindow> window( |
- new ui::DrmWindow(1, &device_manager, screen_manager_.get())); |
+ new ui::DrmWindow(1, device_manager_.get(), screen_manager_.get())); |
window->Initialize(); |
gfx::Rect new_bounds = GetPrimaryBounds(); |
new_bounds.Inset(0, 0, 1, 1); |
@@ -349,11 +350,10 @@ TEST_F(ScreenManagerTest, CheckControllerToWindowMappingWithDifferentBounds) { |
TEST_F(ScreenManagerTest, |
CheckControllerToWindowMappingWithOverlappingWindows) { |
- ui::DrmDeviceManager device_manager(drm_); |
const size_t kWindowCount = 2; |
for (size_t i = 1; i < kWindowCount + 1; ++i) { |
scoped_ptr<ui::DrmWindow> window( |
- new ui::DrmWindow(1, &device_manager, screen_manager_.get())); |
+ new ui::DrmWindow(i, device_manager_.get(), screen_manager_.get())); |
window->Initialize(); |
window->OnBoundsChanged(GetPrimaryBounds()); |
screen_manager_->AddWindow(i, window.Pass()); |
@@ -377,9 +377,8 @@ TEST_F(ScreenManagerTest, |
TEST_F(ScreenManagerTest, ShouldDissociateWindowOnControllerRemoval) { |
gfx::AcceleratedWidget window_id = 1; |
- ui::DrmDeviceManager device_manager(drm_); |
- scoped_ptr<ui::DrmWindow> window( |
- new ui::DrmWindow(window_id, &device_manager, screen_manager_.get())); |
+ scoped_ptr<ui::DrmWindow> window(new ui::DrmWindow( |
+ window_id, device_manager_.get(), screen_manager_.get())); |
window->Initialize(); |
window->OnBoundsChanged(GetPrimaryBounds()); |
screen_manager_->AddWindow(window_id, window.Pass()); |
@@ -400,9 +399,8 @@ TEST_F(ScreenManagerTest, ShouldDissociateWindowOnControllerRemoval) { |
} |
TEST_F(ScreenManagerTest, EnableControllerWhenWindowHasNoBuffer) { |
- ui::DrmDeviceManager device_manager(drm_); |
scoped_ptr<ui::DrmWindow> window( |
- new ui::DrmWindow(1, &device_manager, screen_manager_.get())); |
+ new ui::DrmWindow(1, device_manager_.get(), screen_manager_.get())); |
window->Initialize(); |
window->OnBoundsChanged(GetPrimaryBounds()); |
screen_manager_->AddWindow(1, window.Pass()); |