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

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

Issue 1420943003: [Ozone-DRM] Fix double call of swap buffers callback on failure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2526
Patch Set: Created 5 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/drm/gpu/hardware_display_controller.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/hardware_display_controller_unittest.cc
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_controller_unittest.cc b/ui/ozone/platform/drm/gpu/hardware_display_controller_unittest.cc
index c5eff99b18160fa301947cfea40d2a5f5851e20f..6eaaff51633f8d672886c80d0fc7372ad3c1b11e 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_controller_unittest.cc
+++ b/ui/ozone/platform/drm/gpu/hardware_display_controller_unittest.cc
@@ -380,6 +380,40 @@ TEST_F(HardwareDisplayControllerTest, ModesetWhilePageFlipping) {
EXPECT_EQ(1, page_flips_);
}
+TEST_F(HardwareDisplayControllerTest, FailPageFlipping) {
+ drm_->set_page_flip_expectation(false);
+
+ ui::OverlayPlane plane1(scoped_refptr<ui::ScanoutBuffer>(
+ new MockScanoutBuffer(kDefaultModeSize)));
+ EXPECT_TRUE(controller_->Modeset(plane1, kDefaultMode));
+ std::vector<ui::OverlayPlane> planes =
+ std::vector<ui::OverlayPlane>(1, plane1);
+ EXPECT_FALSE(controller_->SchedulePageFlip(
+ planes, false /* test_only */,
+ base::Bind(&HardwareDisplayControllerTest::PageFlipCallback,
+ base::Unretained(this))));
+
+ drm_->RunCallbacks();
+ EXPECT_EQ(1, page_flips_);
+}
+
+TEST_F(HardwareDisplayControllerTest, FailPageFlippingDueToNoPrimaryPlane) {
+ ui::OverlayPlane plane1(
+ scoped_refptr<ui::ScanoutBuffer>(new MockScanoutBuffer(kDefaultModeSize)),
+ 1, gfx::OVERLAY_TRANSFORM_NONE, gfx::Rect(kDefaultModeSize),
+ gfx::RectF(0, 0, 1, 1));
+ EXPECT_TRUE(controller_->Modeset(plane1, kDefaultMode));
+ std::vector<ui::OverlayPlane> planes =
+ std::vector<ui::OverlayPlane>(1, plane1);
+ EXPECT_FALSE(controller_->SchedulePageFlip(
+ planes, false /* test_only */,
+ base::Bind(&HardwareDisplayControllerTest::PageFlipCallback,
+ base::Unretained(this))));
+
+ drm_->RunCallbacks();
+ EXPECT_EQ(1, page_flips_);
+}
+
TEST_F(HardwareDisplayControllerTest, AddCrtcMidPageFlip) {
ui::OverlayPlane plane1(scoped_refptr<ui::ScanoutBuffer>(
new MockScanoutBuffer(kDefaultModeSize)));
« no previous file with comments | « ui/ozone/platform/drm/gpu/hardware_display_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698