Adding/modifying tests for new 2.3 API
Adding new tests for getPerFrameMetadataKeys_2_3 and getHdrCapabilities_2_3. Modifying for optional API to not error on UNSUPPORTED Bug: 118343714 Test: ./VtsHalGraphicsComposerV2_3TargetTest Change-Id: I66e28cc1cb51b8c26d3e7777311a168086f938ca
This commit is contained in:
parent
e089050c92
commit
7de0be5cd4
1 changed files with 35 additions and 2 deletions
|
@ -247,6 +247,32 @@ TEST_F(GraphicsComposerHidlCommandTest, SET_LAYER_PER_FRAME_METADATA) {
|
||||||
ASSERT_NO_FATAL_FAILURE(mComposerClient->destroyLayer(mPrimaryDisplay, layer));
|
ASSERT_NO_FATAL_FAILURE(mComposerClient->destroyLayer(mPrimaryDisplay, layer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test IComposerClient::getHdrCapabilities_2_3
|
||||||
|
*/
|
||||||
|
TEST_F(GraphicsComposerHidlTest, GetHdrCapabilities_2_3) {
|
||||||
|
float maxLuminance;
|
||||||
|
float maxAverageLuminance;
|
||||||
|
float minLuminance;
|
||||||
|
ASSERT_NO_FATAL_FAILURE(mComposerClient->getHdrCapabilities_2_3(
|
||||||
|
mPrimaryDisplay, &maxLuminance, &maxAverageLuminance, &minLuminance));
|
||||||
|
ASSERT_TRUE(maxLuminance >= minLuminance);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test IComposerClient::getPerFrameMetadataKeys_2_3
|
||||||
|
*/
|
||||||
|
TEST_F(GraphicsComposerHidlTest, GetPerFrameMetadataKeys_2_3) {
|
||||||
|
std::vector<IComposerClient::PerFrameMetadataKey> keys;
|
||||||
|
mComposerClient->getRaw()->getPerFrameMetadataKeys_2_3(
|
||||||
|
mPrimaryDisplay, [&](const auto tmpError, const auto outKeys) {
|
||||||
|
if (tmpError != Error::UNSUPPORTED) {
|
||||||
|
ASSERT_EQ(Error::NONE, tmpError);
|
||||||
|
keys = outKeys;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TestIComposerClient::getReadbackBufferAttributes_2_3
|
* TestIComposerClient::getReadbackBufferAttributes_2_3
|
||||||
*/
|
*/
|
||||||
|
@ -254,8 +280,15 @@ TEST_F(GraphicsComposerHidlTest, GetReadbackBufferAttributes_2_3) {
|
||||||
Dataspace dataspace;
|
Dataspace dataspace;
|
||||||
PixelFormat pixelFormat;
|
PixelFormat pixelFormat;
|
||||||
|
|
||||||
ASSERT_NO_FATAL_FAILURE(mComposerClient->getReadbackBufferAttributes_2_3(
|
mComposerClient->getRaw()->getReadbackBufferAttributes_2_3(
|
||||||
mPrimaryDisplay, &pixelFormat, &dataspace));
|
mPrimaryDisplay,
|
||||||
|
[&](const auto tmpError, const auto outPixelFormat, const auto outDataspace) {
|
||||||
|
if (tmpError != Error::UNSUPPORTED) {
|
||||||
|
ASSERT_EQ(Error::NONE, tmpError);
|
||||||
|
dataspace = outDataspace;
|
||||||
|
pixelFormat = outPixelFormat;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue