Chromium Code Reviews| 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); |
| +} |