Loading graphics/mapper/2.0/vts/functional/VtsHalGraphicsMapperTestUtils.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -30,10 +30,12 @@ Gralloc::Gralloc() { } void Gralloc::init() { mAllocator = ::testing::VtsHalHidlTargetTestBase::getService<IAllocator>(); mAllocator = ::testing::VtsHalHidlTargetTestBase::getService<IAllocator>( GraphicsMapperHidlEnvironment::Instance()->getServiceName<IAllocator>()); ASSERT_NE(nullptr, mAllocator.get()) << "failed to get allocator service"; mMapper = ::testing::VtsHalHidlTargetTestBase::getService<IMapper>(); mMapper = ::testing::VtsHalHidlTargetTestBase::getService<IMapper>( GraphicsMapperHidlEnvironment::Instance()->getServiceName<IMapper>()); ASSERT_NE(nullptr, mMapper.get()) << "failed to get mapper service"; ASSERT_FALSE(mMapper->isRemote()) << "mapper is not in passthrough mode"; } Loading graphics/mapper/2.0/vts/functional/VtsHalGraphicsMapperTestUtils.h +16 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <unordered_set> #include <VtsHalHidlTargetTestEnvBase.h> #include <android/hardware/graphics/allocator/2.0/IAllocator.h> #include <android/hardware/graphics/mapper/2.0/IMapper.h> #include <utils/StrongPointer.h> Loading Loading @@ -88,6 +89,21 @@ class Gralloc { std::unordered_set<const native_handle_t*> mImportedBuffers; }; // Test environment for graphics.mapper. class GraphicsMapperHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase { public: // get the test environment singleton static GraphicsMapperHidlEnvironment* Instance() { static GraphicsMapperHidlEnvironment* instance = new GraphicsMapperHidlEnvironment; return instance; } virtual void registerTestServices() override { registerTestService<IAllocator>(); registerTestService<IMapper>(); } }; } // namespace tests } // namespace V2_0 } // namespace mapper Loading graphics/mapper/2.0/vts/functional/VtsHalGraphicsMapperV2_0TargetTest.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -403,10 +403,11 @@ TEST_F(GraphicsMapperHidlTest, UnlockNegative) { } // namespace android int main(int argc, char** argv) { using android::hardware::graphics::mapper::V2_0::tests::GraphicsMapperHidlEnvironment; ::testing::AddGlobalTestEnvironment(GraphicsMapperHidlEnvironment::Instance()); ::testing::InitGoogleTest(&argc, argv); GraphicsMapperHidlEnvironment::Instance()->init(&argc, argv); int status = RUN_ALL_TESTS(); LOG(INFO) << "Test result = " << status; return status; } Loading
graphics/mapper/2.0/vts/functional/VtsHalGraphicsMapperTestUtils.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -30,10 +30,12 @@ Gralloc::Gralloc() { } void Gralloc::init() { mAllocator = ::testing::VtsHalHidlTargetTestBase::getService<IAllocator>(); mAllocator = ::testing::VtsHalHidlTargetTestBase::getService<IAllocator>( GraphicsMapperHidlEnvironment::Instance()->getServiceName<IAllocator>()); ASSERT_NE(nullptr, mAllocator.get()) << "failed to get allocator service"; mMapper = ::testing::VtsHalHidlTargetTestBase::getService<IMapper>(); mMapper = ::testing::VtsHalHidlTargetTestBase::getService<IMapper>( GraphicsMapperHidlEnvironment::Instance()->getServiceName<IMapper>()); ASSERT_NE(nullptr, mMapper.get()) << "failed to get mapper service"; ASSERT_FALSE(mMapper->isRemote()) << "mapper is not in passthrough mode"; } Loading
graphics/mapper/2.0/vts/functional/VtsHalGraphicsMapperTestUtils.h +16 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <unordered_set> #include <VtsHalHidlTargetTestEnvBase.h> #include <android/hardware/graphics/allocator/2.0/IAllocator.h> #include <android/hardware/graphics/mapper/2.0/IMapper.h> #include <utils/StrongPointer.h> Loading Loading @@ -88,6 +89,21 @@ class Gralloc { std::unordered_set<const native_handle_t*> mImportedBuffers; }; // Test environment for graphics.mapper. class GraphicsMapperHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase { public: // get the test environment singleton static GraphicsMapperHidlEnvironment* Instance() { static GraphicsMapperHidlEnvironment* instance = new GraphicsMapperHidlEnvironment; return instance; } virtual void registerTestServices() override { registerTestService<IAllocator>(); registerTestService<IMapper>(); } }; } // namespace tests } // namespace V2_0 } // namespace mapper Loading
graphics/mapper/2.0/vts/functional/VtsHalGraphicsMapperV2_0TargetTest.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -403,10 +403,11 @@ TEST_F(GraphicsMapperHidlTest, UnlockNegative) { } // namespace android int main(int argc, char** argv) { using android::hardware::graphics::mapper::V2_0::tests::GraphicsMapperHidlEnvironment; ::testing::AddGlobalTestEnvironment(GraphicsMapperHidlEnvironment::Instance()); ::testing::InitGoogleTest(&argc, argv); GraphicsMapperHidlEnvironment::Instance()->init(&argc, argv); int status = RUN_ALL_TESTS(); LOG(INFO) << "Test result = " << status; return status; }