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

Commit 532d6456 authored by Vishnu Nair's avatar Vishnu Nair
Browse files

Refactor common testing code for layerlifecyclemanager

Pull out some helper functions that can be used with benchmark tests.

Flag: EXEMPT refactor
Bug: 353535845
Test: presubmit
Change-Id: I59392645e2b0bc675a2feb0f3e01ac91f7a57d1d
parent 687f9fea
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);