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

Unified Diff: ui/ozone/platform/drm/gpu/screen_manager_unittest.cc

Issue 1100973002: [2/4]Allow hotplugging of primary DRM device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-hotplug
Patch Set: unittests Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_device.cc ('k') | ui/ozone/platform/drm/host/drm_native_display_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_device.cc ('k') | ui/ozone/platform/drm/host/drm_native_display_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698