change all vts hidl tests to use VtsHalHidlTargetBaseTest (internal master)

Bug: 33385836
Test: mma
Change-Id: Ide3ebc4a9db76257f33bcfb0c1f13d2ee33eeaa8
diff --git a/graphics/allocator/2.0/vts/functional/Android.bp b/graphics/allocator/2.0/vts/functional/Android.bp
index 8c0480b..fdc91ae 100644
--- a/graphics/allocator/2.0/vts/functional/Android.bp
+++ b/graphics/allocator/2.0/vts/functional/Android.bp
@@ -16,7 +16,6 @@
 
 cc_test {
     name: "VtsHalGraphicsAllocatorV2_0TargetTest",
-    gtest: true,
     srcs: ["VtsHalGraphicsAllocatorV2_0TargetTest.cpp"],
     shared_libs: [
         "libbase",
@@ -28,7 +27,7 @@
         "libutils",
         "android.hardware.graphics.allocator@2.0",
     ],
-    static_libs: ["libgtest"],
+    static_libs: ["VtsHalHidlTargetBaseTest"],
     cflags: [
         "-O0",
         "-g",
diff --git a/graphics/allocator/2.0/vts/functional/VtsHalGraphicsAllocatorV2_0TargetTest.cpp b/graphics/allocator/2.0/vts/functional/VtsHalGraphicsAllocatorV2_0TargetTest.cpp
index d45463e..a8ced8c 100644
--- a/graphics/allocator/2.0/vts/functional/VtsHalGraphicsAllocatorV2_0TargetTest.cpp
+++ b/graphics/allocator/2.0/vts/functional/VtsHalGraphicsAllocatorV2_0TargetTest.cpp
@@ -20,7 +20,7 @@
 
 #include <android-base/logging.h>
 #include <android/hardware/graphics/allocator/2.0/IAllocator.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
 
 namespace android {
 namespace hardware {
@@ -69,10 +69,10 @@
   BufferDescriptor mDescriptor;
 };
 
-class GraphicsAllocatorHidlTest : public ::testing::Test {
+class GraphicsAllocatorHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
  protected:
   void SetUp() override {
-    mAllocator = IAllocator::getService();
+    mAllocator = ::testing::VtsHalHidlTargetBaseTest::getService<IAllocator>();
     ASSERT_NE(mAllocator, nullptr);
 
     mAllocator->createClient([this](const auto& error, const auto& client) {
diff --git a/graphics/composer/2.1/vts/functional/Android.bp b/graphics/composer/2.1/vts/functional/Android.bp
index 1b8f351..9be04d1 100644
--- a/graphics/composer/2.1/vts/functional/Android.bp
+++ b/graphics/composer/2.1/vts/functional/Android.bp
@@ -16,7 +16,6 @@
 
 cc_test {
     name: "VtsHalGraphicsComposerV2_1TargetTest",
-    gtest: true,
     srcs: ["VtsHalGraphicsComposerV2_1TargetTest.cpp"],
     shared_libs: [
         "android.hardware.graphics.allocator@2.0",
@@ -32,7 +31,7 @@
         "libsync",
         "libutils",
     ],
-    static_libs: ["libgtest", "libhwcomposer-command-buffer"],
+    static_libs: ["VtsHalHidlTargetBaseTest", "libhwcomposer-command-buffer"],
     cflags: [
         "-O0",
         "-g",
diff --git a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp
index d9352e7..a565845 100644
--- a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp
+++ b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp
@@ -22,7 +22,7 @@
 #include <android/hardware/graphics/composer/2.1/IComposer.h>
 #include <android/hardware/graphics/mapper/2.0/IMapper.h>
 
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
 #include <unistd.h>
 
 #include <algorithm>
@@ -131,10 +131,10 @@
   int mInvalidVsyncCount = 0;
 };
 
-class GraphicsComposerHidlTest : public ::testing::Test {
+class GraphicsComposerHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
  protected:
   void SetUp() override {
-    mComposer = IComposer::getService();
+    mComposer = ::testing::VtsHalHidlTargetBaseTest::getService<IComposer>();
     ASSERT_NE(nullptr, mComposer.get());
 
     mComposerClient = createClient();
@@ -749,7 +749,7 @@
 
  private:
   void SetUpGralloc() {
-    mAllocator = IAllocator::getService();
+    mAllocator = ::testing::VtsHalHidlTargetBaseTest::getService<IAllocator>();
     ASSERT_NE(nullptr, mAllocator.get());
 
     mAllocator->createClient([this](const auto& error, const auto& client) {
@@ -759,7 +759,7 @@
     });
     ASSERT_NE(nullptr, mAllocatorClient.get());
 
-    mMapper = IMapper::getService();
+    mMapper = ::testing::VtsHalHidlTargetBaseTest::getService<IMapper>();
     ASSERT_NE(nullptr, mMapper.get());
     ASSERT_FALSE(mMapper->isRemote());
   }
diff --git a/graphics/mapper/2.0/vts/functional/Android.bp b/graphics/mapper/2.0/vts/functional/Android.bp
index 79e1a44..24cd1be 100644
--- a/graphics/mapper/2.0/vts/functional/Android.bp
+++ b/graphics/mapper/2.0/vts/functional/Android.bp
@@ -16,7 +16,6 @@
 
 cc_test {
     name: "VtsHalGraphicsMapperV2_0TargetTest",
-    gtest: true,
     srcs: ["VtsHalGraphicsMapperV2_0TargetTest.cpp"],
     shared_libs: [
         "libbase",
@@ -31,7 +30,7 @@
         "android.hardware.graphics.mapper@2.0",
         "android.hardware.graphics.common@1.0",
     ],
-    static_libs: ["libgtest"],
+    static_libs: ["VtsHalHidlTargetBaseTest"],
     cflags: [
         "-O0",
         "-g",
diff --git a/graphics/mapper/2.0/vts/functional/VtsHalGraphicsMapperV2_0TargetTest.cpp b/graphics/mapper/2.0/vts/functional/VtsHalGraphicsMapperV2_0TargetTest.cpp
index 65ad63a..b2a37dd 100644
--- a/graphics/mapper/2.0/vts/functional/VtsHalGraphicsMapperV2_0TargetTest.cpp
+++ b/graphics/mapper/2.0/vts/functional/VtsHalGraphicsMapperV2_0TargetTest.cpp
@@ -19,7 +19,7 @@
 #include <android-base/logging.h>
 #include <android/hardware/graphics/allocator/2.0/IAllocator.h>
 #include <android/hardware/graphics/mapper/2.0/IMapper.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
 #include <sync/sync.h>
 
 namespace android {
@@ -33,10 +33,10 @@
 using namespace android::hardware::graphics::allocator::V2_0;
 using namespace android::hardware::graphics::common::V1_0;
 
-class GraphicsMapperHidlTest : public ::testing::Test {
+class GraphicsMapperHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
  protected:
   void SetUp() override {
-    mAllocator = IAllocator::getService();
+    mAllocator = ::testing::VtsHalHidlTargetBaseTest::getService<IAllocator>();
     ASSERT_NE(mAllocator, nullptr);
 
     mAllocator->createClient([this](const auto& error, const auto& client) {
@@ -46,7 +46,7 @@
     });
     ASSERT_NE(mAllocatorClient, nullptr);
 
-    mMapper = IMapper::getService();
+    mMapper = ::testing::VtsHalHidlTargetBaseTest::getService<IMapper>();
     ASSERT_NE(nullptr, mMapper.get());
     ASSERT_FALSE(mMapper->isRemote());