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

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

Issue 1072383003: ozone: drm: Fix HardwareDisplayController use-after-free (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test 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/screen_manager.cc ('k') | no next file » | 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 83963f1d1223191a7a1202b19f389c0adefca23a..bf0d211fbd3e2ce4f74d8f3125d07ec483e12ae1 100644
--- a/ui/ozone/platform/drm/gpu/screen_manager_unittest.cc
+++ b/ui/ozone/platform/drm/gpu/screen_manager_unittest.cc
@@ -374,3 +374,27 @@ TEST_F(ScreenManagerTest,
window->Shutdown();
}
}
+
+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()));
+ window->Initialize();
+ window->OnBoundsChanged(GetPrimaryBounds());
+ screen_manager_->AddWindow(window_id, window.Pass());
+
+ screen_manager_->AddDisplayController(drm_, kPrimaryCrtc, kPrimaryConnector);
+ screen_manager_->ConfigureDisplayController(
+ drm_, kPrimaryCrtc, kPrimaryConnector, GetPrimaryBounds().origin(),
+ kDefaultMode);
+
+ EXPECT_TRUE(screen_manager_->GetWindow(window_id)->GetController());
+
+ screen_manager_->RemoveDisplayController(drm_, kPrimaryCrtc);
+
+ EXPECT_FALSE(screen_manager_->GetWindow(window_id)->GetController());
+
+ window = screen_manager_->RemoveWindow(1);
+ window->Shutdown();
+}
« no previous file with comments | « ui/ozone/platform/drm/gpu/screen_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698