Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae7d324f authored by Marissa Wall's avatar Marissa Wall
Browse files

test-hwc2: dump

Test: Add "#define HAVE_NO_SURFACE_FLINGER" to
          frameworks/native/libs/gui/BufferQueueCore.cpp.
      Recompile and flash.
      Run "mm" in frameworks/native/services/surfaceflinger/tests/hwc2.
      Push test-hwc2 to device.
      Run "adb root && adb shell stop".
      Run test case. Ex: "./test-hwc2"

Change-Id: I0215fea464fd126b5f9041435bef7e00b46c6ac8
parent bad1bc78
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -1022,6 +1022,23 @@ public:
        }
    }

    void dump(std::string* outBuffer)
    {
        auto pfn = reinterpret_cast<HWC2_PFN_DUMP>(
                getFunction(HWC2_FUNCTION_DUMP));
        ASSERT_TRUE(pfn) << "failed to get function";

        uint32_t size = 0;

        pfn(mHwc2Device, &size, nullptr);

        std::vector<char> buffer(size);

        pfn(mHwc2Device, &size, buffer.data());

        outBuffer->assign(buffer.data());
    }

    void getBadDisplay(hwc2_display_t* outDisplay)
    {
        for (hwc2_display_t display = 0; display < UINT64_MAX; display++) {
@@ -4529,3 +4546,11 @@ TEST_F(Hwc2Test, SET_OUTPUT_BUFFER_unsupported)
        } while (testVirtualDisplay.advance());
    }
}

/* TESTCASE: Tests that the HWC2 can dump debug information. */
TEST_F(Hwc2Test, DUMP)
{
    std::string buffer;

    ASSERT_NO_FATAL_FAILURE(dump(&buffer));
}