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

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

Issue 2712463002: ozone: Reject overlays when a test buffer can't be allocated. (Closed)
Patch Set: Created 3 years, 10 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
Index: ui/ozone/platform/drm/gpu/drm_overlay_validator_unittest.cc
diff --git a/ui/ozone/platform/drm/gpu/drm_overlay_validator_unittest.cc b/ui/ozone/platform/drm/gpu/drm_overlay_validator_unittest.cc
index 6a3b1b65a8202edae6722b0fd310544130ddeab7..a9bff3fe5852539dd318ff8bf0082c3b5a971cf2 100644
--- a/ui/ozone/platform/drm/gpu/drm_overlay_validator_unittest.cc
+++ b/ui/ozone/platform/drm/gpu/drm_overlay_validator_unittest.cc
@@ -628,3 +628,18 @@ TEST_F(DrmOverlayValidatorTest, DontResetOriginalBufferIfProcessedIsInvalid) {
plane_list_.back().processing_callback = base::Bind(
&DrmOverlayValidatorTest::ProcessBuffer, base::Unretained(this));
}
+
+TEST_F(DrmOverlayValidatorTest, RejectBufferAllocationFail) {
+ // If a buffer is too big, buffer allocation for scanout will fail.
dnicoara 2017/02/21 19:03:18 Since we're expecting the AddFramebuffer2() call t
Daniele Castagna 2017/02/21 19:12:21 You're right that what you described is the scenar
dnicoara 2017/02/21 19:19:39 Oh, you're right, that makes me feel a bit sad :(
+ // In that case we should reject the overlay candidate.
+ ui::OverlayCheck_Params too_big_candidate;
+
+ too_big_candidate.buffer_size = gfx::Size(4800, 3200);
+ too_big_candidate.display_rect = primary_rect_;
+ std::vector<ui::OverlayCheck_Params> overlay_params;
+ overlay_params.push_back(too_big_candidate);
+
+ std::vector<ui::OverlayCheck_Params> validated_params =
+ overlay_validator_->TestPageFlip(overlay_params, ui::OverlayPlaneList());
+ EXPECT_FALSE(validated_params.front().is_overlay_candidate);
+}
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_overlay_validator.cc ('k') | ui/ozone/platform/drm/gpu/mock_scanout_buffer_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698