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

Commit 7dfd5448 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Enable more input tests on host" into main

parents a4b790af 9840a709
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <unistd.h>
#include <ctype.h>

#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/properties.h>
#include <android-base/stringprintf.h>
@@ -112,9 +113,13 @@ std::string getInputDeviceConfigurationFilePathByName(
        pathPrefixes.push_back("/apex/" + apex + "/etc/usr/");
    }
    // ANDROID_ROOT may not be set on host
    if (auto android_root = getenv("ANDROID_ROOT"); android_root != nullptr) {
        pathPrefixes.push_back(std::string(android_root) + "/usr/");
    if (auto androidRoot = getenv("ANDROID_ROOT"); androidRoot != nullptr) {
        pathPrefixes.push_back(std::string(androidRoot) + "/usr/");
    } else {
        // To support host-based tests, use the data contained near the executable test binary.
        pathPrefixes.push_back(base::GetExecutableDirectory() + "/system/usr/");
    }

    for (const auto& prefix : pathPrefixes) {
        path = prefix;
        appendInputDeviceConfigurationFileRelativePath(path, name, type);
+4 −0
Original line number Diff line number Diff line
@@ -89,6 +89,10 @@ cc_test {
        ":motion_predictor_model",
        "data/*",
    ],
    device_first_data: [
        ":keychars_test_data",
        ":keylayout_test_data",
    ],
    test_options: {
        unit_test: true,
    },
+0 −3
Original line number Diff line number Diff line
@@ -66,9 +66,6 @@ protected:
    }

    void SetUp() override {
#if !defined(__ANDROID__)
        GTEST_SKIP() << "b/253299089 Generic files are currently read directly from device.";
#endif
        loadKeyLayout("Generic");
        loadKeyCharacterMap("Generic");
    }
+4 −0
Original line number Diff line number Diff line
@@ -134,4 +134,8 @@ cc_test {
        "device-tests",
    ],
    native_coverage: false,
    device_first_data: [
        ":keychars_test_data",
        ":keylayout_test_data",
    ],
}
+0 −3
Original line number Diff line number Diff line
@@ -7681,9 +7681,6 @@ TEST_F(InputDispatcherTest, FocusedWindow_PolicyConsumedKeyIgnoresDisableUserAct
}
TEST_F(InputDispatcherTest, FocusedWindow_DoesNotReceivePolicyFallbackKey) {
#if !defined(__ANDROID__)
    GTEST_SKIP() << "b/253299089 Generic files are currently read directly from device.";
#endif
    InputDeviceInfo testDevice = generateTestDeviceInfo(/*vendorId=*/0,
                                                        /*productId=*/0, /*deviceId=*/1);
    std::unique_ptr<KeyCharacterMap> kcm = loadKeyCharacterMap("Generic");