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

Side by Side 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: Remove DCHECK that one plane would always succeed. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/ozone/platform/drm/gpu/drm_overlay_validator.h" 5 #include "ui/ozone/platform/drm/gpu/drm_overlay_validator.h"
6 6
7 #include <drm_fourcc.h> 7 #include <drm_fourcc.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 plane_list.back().buffer->GetFramebufferPixelFormat()); 621 plane_list.back().buffer->GetFramebufferPixelFormat());
622 plane_list_.back().processing_callback = base::Bind( 622 plane_list_.back().processing_callback = base::Bind(
623 &DrmOverlayValidatorTest::ReturnNullBuffer, base::Unretained(this)); 623 &DrmOverlayValidatorTest::ReturnNullBuffer, base::Unretained(this));
624 624
625 plane_list = overlay_validator_->PrepareBuffersForPageFlip(plane_list_); 625 plane_list = overlay_validator_->PrepareBuffersForPageFlip(plane_list_);
626 EXPECT_EQ(plane_list_.back().buffer->GetFramebufferPixelFormat(), 626 EXPECT_EQ(plane_list_.back().buffer->GetFramebufferPixelFormat(),
627 plane_list.back().buffer->GetFramebufferPixelFormat()); 627 plane_list.back().buffer->GetFramebufferPixelFormat());
628 plane_list_.back().processing_callback = base::Bind( 628 plane_list_.back().processing_callback = base::Bind(
629 &DrmOverlayValidatorTest::ProcessBuffer, base::Unretained(this)); 629 &DrmOverlayValidatorTest::ProcessBuffer, base::Unretained(this));
630 } 630 }
631
632 TEST_F(DrmOverlayValidatorTest, RejectBufferAllocationFail) {
633 // Buffer allocation for scanout might fail.
634 // In that case we should reject the overlay candidate.
635 buffer_generator_->set_allocation_failure(true);
636
637 std::vector<ui::OverlayCheck_Params> validated_params =
638 overlay_validator_->TestPageFlip(overlay_params_, ui::OverlayPlaneList());
639 EXPECT_FALSE(validated_params.front().is_overlay_candidate);
640 }
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_overlay_validator.cc ('k') | ui/ozone/platform/drm/gpu/mock_scanout_buffer_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698