| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |