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

* changes:
  Merge changes from topic "nscobie-hwui_unit_tests" am: 463a012834 am: 1b66b6a52e
  Enable hwui_unit_tests in presubmit for libs/hwui am: ff0bf7b109 am: c80b1c677e
  Fix GraphicsStats#findRootPath and disable CacheManager#trimMemory tests am: 24921a0325 am: 600da2e030
  Change hwui_unit_tests (and benchmarks) to push to non-root writable dir am: 1aa54918b8 am: 85e8dbe6ae
This commit is contained in:
Automerger Merge Worker
2023-01-10 18:30:20 +00:00
committed by Android (Google) Code Review
5 changed files with 25 additions and 18 deletions

View File

@@ -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: {

View File

@@ -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>

View File

@@ -5,6 +5,9 @@
},
{
"name": "CtsAccelerationTestCases"
},
{
"name": "hwui_unit_tests"
}
],
"imports": [

View File

@@ -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();

View File

@@ -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) {