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

Commit c1a2764a authored by vadimt's avatar vadimt
Browse files

Support for memory tests

Change-Id: I867a232a293f7bddbc630f563f18c0db94ac4b6e
parent e4061fc9
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -112,6 +112,13 @@ public class TestInformationHandler implements ResourceBasedOverride {
                }
                break;
            }

            case TestProtocol.REQUEST_ALLOCATED_MEMORY: {
                final Runtime runtime = Runtime.getRuntime();
                response.putLong(TestProtocol.TEST_INFO_RESPONSE_FIELD,
                        runtime.totalMemory() - runtime.freeMemory());
                break;
            }
        }
        return response;
    }
+1 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ public final class TestProtocol {
    public static final String REQUEST_APP_LIST_FREEZE_FLAGS = "app-list-freeze-flags";
    public static final String REQUEST_OVERVIEW_LEFT_GESTURE_MARGIN = "overview-left-margin";
    public static final String REQUEST_OVERVIEW_RIGHT_GESTURE_MARGIN = "overview-right-margin";
    public static final String REQUEST_ALLOCATED_MEMORY = "allocated-memory";

    public static boolean sDebugTracing = false;
    public static final String REQUEST_ENABLE_DEBUG_TRACING = "enable-debug-tracing";
+5 −0
Original line number Diff line number Diff line
@@ -956,4 +956,9 @@ public final class LauncherInstrumentation {
    public void disableDebugTracing() {
        getTestInfo(TestProtocol.REQUEST_DISABLE_DEBUG_TRACING);
    }

    public long getAllocatedMemory() {
        return getTestInfo(TestProtocol.REQUEST_ALLOCATED_MEMORY).
                getLong(TestProtocol.TEST_INFO_RESPONSE_FIELD);
    }
}
 No newline at end of file