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

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

Merge "Refactor common testing code for layerlifecyclemanager" into main

parents 3f001ca8 532d6456
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "frameworks_native_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["frameworks_native_license"],
}

cc_library_headers {
    name: "surfaceflinger_tests_common_headers",
    export_include_dirs: ["."],
}
+479 −0

File added.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ cc_test {
    ],
    test_suites: ["device-tests"],
    static_libs: ["libc++fs"],
    header_libs: ["surfaceflinger_tests_common_headers"],
    srcs: [
        ":libsurfaceflinger_mock_sources",
        ":libsurfaceflinger_sources",
+4 −442

File changed.

Preview size limit exceeded, changes collapsed.

+0 −12
Original line number Diff line number Diff line
@@ -61,18 +61,6 @@ public:

class LayerLifecycleManagerTest : public LayerHierarchyTestBase {
protected:
    std::unique_ptr<RequestedLayerState> rootLayer(uint32_t id) {
        return std::make_unique<RequestedLayerState>(createArgs(/*id=*/id, /*canBeRoot=*/true,
                                                                /*parent=*/UNASSIGNED_LAYER_ID,
                                                                /*mirror=*/UNASSIGNED_LAYER_ID));
    }

    std::unique_ptr<RequestedLayerState> childLayer(uint32_t id, uint32_t parentId) {
        return std::make_unique<RequestedLayerState>(createArgs(/*id=*/id, /*canBeRoot=*/false,
                                                                parentId,
                                                                /*mirror=*/UNASSIGNED_LAYER_ID));
    }

    RequestedLayerState* getRequestedLayerState(LayerLifecycleManager& lifecycleManager,
                                                uint32_t layerId) {
        return lifecycleManager.getLayerFromId(layerId);