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

Commit 12c59c3f authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge changes from topic "am-37170c8f22554766afc25915c7a99d41" into tm-qpr-dev-plus-aosp

* changes:
  Merge changes from topic "nscobie-hwui_unit_tests" am: 463a0128 am: 1b66b6a5
  Enable hwui_unit_tests in presubmit for libs/hwui am: ff0bf7b1 am: c80b1c67
  Fix GraphicsStats#findRootPath and disable CacheManager#trimMemory tests am: 24921a03 am: 600da2e0
  Change hwui_unit_tests (and benchmarks) to push to non-root writable dir am: 1aa54918 am: 85e8dbe6
parents cdd0c443 531051d7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -634,7 +634,7 @@ cc_library_static {
cc_defaults {
    name: "hwui_test_defaults",
    defaults: ["hwui_defaults"],
    test_suites: ["device-tests"],
    test_suites: ["general-tests"],
    header_libs: ["libandroid_headers_private"],
    target: {
        android: {
+6 −6
Original line number Diff line number Diff line
@@ -16,22 +16,22 @@
<configuration description="Config for hwuimicro">
    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
        <option name="cleanup" value="true" />
        <option name="push" value="hwui_unit_tests->/data/nativetest/hwui_unit_tests" />
        <option name="push" value="hwuimicro->/data/benchmarktest/hwuimicro" />
        <option name="push" value="hwuimacro->/data/benchmarktest/hwuimacro" />
        <option name="push" value="hwui_unit_tests->/data/local/tmp/nativetest/hwui_unit_tests" />
        <option name="push" value="hwuimicro->/data/local/tmp/benchmarktest/hwuimicro" />
        <option name="push" value="hwuimacro->/data/local/tmp/benchmarktest/hwuimacro" />
    </target_preparer>
    <option name="test-suite-tag" value="apct" />
    <test class="com.android.tradefed.testtype.GTest" >
        <option name="native-test-device-path" value="/data/nativetest" />
        <option name="native-test-device-path" value="/data/local/tmp/nativetest" />
        <option name="module-name" value="hwui_unit_tests" />
    </test>
    <test class="com.android.tradefed.testtype.GoogleBenchmarkTest" >
        <option name="native-benchmark-device-path" value="/data/benchmarktest" />
        <option name="native-benchmark-device-path" value="/data/local/tmp/benchmarktest" />
        <option name="benchmark-module-name" value="hwuimicro" />
        <option name="file-exclusion-filter-regex" value=".*\.config$" />
    </test>
    <test class="com.android.tradefed.testtype.GoogleBenchmarkTest" >
        <option name="native-benchmark-device-path" value="/data/benchmarktest" />
        <option name="native-benchmark-device-path" value="/data/local/tmp/benchmarktest" />
        <option name="benchmark-module-name" value="hwuimacro" />
        <option name="file-exclusion-filter-regex" value=".*\.config$" />
    </test>
+3 −0
Original line number Diff line number Diff line
@@ -5,6 +5,9 @@
    },
    {
      "name": "CtsAccelerationTestCases"
    },
    {
      "name": "hwui_unit_tests"
    }
  ],
  "imports": [
+2 −1
Original line number Diff line number Diff line
@@ -32,7 +32,8 @@ static size_t getCacheUsage(GrDirectContext* grContext) {
    return cacheUsage;
}

RENDERTHREAD_SKIA_PIPELINE_TEST(CacheManager, trimMemory) {
// TOOD(258700630): fix this test and re-enable
RENDERTHREAD_SKIA_PIPELINE_TEST(CacheManager, DISABLED_trimMemory) {
    int32_t width = DeviceInfo::get()->getWidth();
    int32_t height = DeviceInfo::get()->getHeight();
    GrDirectContext* grContext = renderThread.getGrContext();
+13 −10
Original line number Diff line number Diff line
@@ -14,17 +14,18 @@
 * limitations under the License.
 */

#include <android-base/macros.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>

#include "protos/graphicsstats.pb.h"
#include "service/GraphicsStatsService.h"

#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

#include "protos/graphicsstats.pb.h"
#include "service/GraphicsStatsService.h"

using namespace android;
using namespace android::uirenderer;

@@ -49,12 +50,14 @@ std::string findRootPath() {

// No code left untested
TEST(GraphicsStats, findRootPath) {
#ifdef __LP64__
    std::string expected = "/data/nativetest64/hwui_unit_tests";
#else
    std::string expected = "/data/nativetest/hwui_unit_tests";
#endif
    EXPECT_EQ(expected, findRootPath());
    // Different tools/infrastructure seem to push this to different locations. It shouldn't really
    // matter where the binary is, so add new locations here as needed. This test still seems good
    // as it's nice to understand the possibility space, and ensure findRootPath continues working
    // as expected.
    std::string acceptableLocations[] = {"/data/nativetest/hwui_unit_tests",
                                         "/data/nativetest64/hwui_unit_tests",
                                         "/data/local/tmp/nativetest/hwui_unit_tests/" ABI_STRING};
    EXPECT_THAT(acceptableLocations, ::testing::Contains(findRootPath()));
}

TEST(GraphicsStats, saveLoad) {