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

Unified Diff: ui/ozone/platform/dri/hardware_display_controller_unittest.cc

Issue 641173003: [Ozone-DRI] Fix waiting for page flips in mirror mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 2 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/dri/hardware_display_controller.cc ('k') | ui/ozone/platform/dri/test/mock_dri_wrapper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/hardware_display_controller_unittest.cc
diff --git a/ui/ozone/platform/dri/hardware_display_controller_unittest.cc b/ui/ozone/platform/dri/hardware_display_controller_unittest.cc
index bde4d5ad386d9790af41a59429cb9d607300341e..23a2d597bcf7a88f1098105441180af1824c09ef 100644
--- a/ui/ozone/platform/dri/hardware_display_controller_unittest.cc
+++ b/ui/ozone/platform/dri/hardware_display_controller_unittest.cc
@@ -182,4 +182,38 @@ TEST_F(HardwareDisplayControllerTest, PageflipMirroredControllers) {
controller_->QueueOverlayPlane(plane2);
EXPECT_TRUE(controller_->SchedulePageFlip());
EXPECT_EQ(2, drm_->get_page_flip_call_count());
+
+ controller_->WaitForPageFlipEvent();
+ EXPECT_EQ(2, drm_->get_handle_events_count());
+}
+
+TEST_F(HardwareDisplayControllerTest,
+ PageflipMirroredControllersWithInvertedCrtcOrder) {
+ scoped_ptr<ui::CrtcController> crtc1(
+ new ui::CrtcController(drm_.get(), kPrimaryCrtc, kPrimaryConnector));
+ scoped_ptr<ui::CrtcController> crtc2(
+ new ui::CrtcController(drm_.get(), kSecondaryCrtc, kSecondaryConnector));
+
+ // Make sure that if the order is reversed everything is still fine.
+ std::queue<ui::CrtcController*> crtc_queue;
+ crtc_queue.push(crtc2.get());
+ crtc_queue.push(crtc1.get());
+
+ controller_.reset(new ui::HardwareDisplayController(crtc1.Pass()));
+ controller_->AddCrtc(crtc2.Pass());
+
+ ui::OverlayPlane plane1(scoped_refptr<ui::ScanoutBuffer>(
+ new MockScanoutBuffer(kDefaultModeSize)));
+ EXPECT_TRUE(controller_->Modeset(plane1, kDefaultMode));
+ EXPECT_EQ(2, drm_->get_set_crtc_call_count());
+
+ ui::OverlayPlane plane2(scoped_refptr<ui::ScanoutBuffer>(
+ new MockScanoutBuffer(kDefaultModeSize)));
+ controller_->QueueOverlayPlane(plane2);
+ EXPECT_TRUE(controller_->SchedulePageFlip());
+ EXPECT_EQ(2, drm_->get_page_flip_call_count());
+
+ drm_->set_controllers(crtc_queue);
+ controller_->WaitForPageFlipEvent();
+ EXPECT_EQ(2, drm_->get_handle_events_count());
}
« no previous file with comments | « ui/ozone/platform/dri/hardware_display_controller.cc ('k') | ui/ozone/platform/dri/test/mock_dri_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698