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

Commit 6ce2e715 authored by Tomasz Mikolajewski's avatar Tomasz Mikolajewski
Browse files

Copy tests for archives to DocumentsUI.

Bug: 31783726
Test: All tests pass on APCT.
Change-Id: Ifbd6dcc00836066ee12d34f93658ef6717a48248
(cherry picked from commit 1782b12a)
parent 3e04db13
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@ public class Archive implements Closeable {
            @Nullable Uri notificationUri)
            throws IOException {
        File snapshotFile = null;
        // TODO: Do not create a snapshot if a seekable file descriptor is passed.
        try {
            // Create a copy of the archive, as ZipFile doesn't operate on streams.
            // Moreover, ZipInputStream would be inefficient for large files on
@@ -267,6 +268,14 @@ public class Archive implements Closeable {
            return false;
        }

        // TODO: Include the fake '/' entry in mEntries, and remove this check.
        // Fake entries are for directories which do not have entries in the ZIP
        // archive, but are reachable. Eg. /a, /a/b and /a/b/c for a single-entry
        // archive containing /a/b/c/file.txt.
        if (parsedParentId.mPath.equals("/")) {
            return true;
        }

        final ZipEntry parentEntry = mEntries.get(parsedParentId.mPath);
        if (parentEntry == null || !parentEntry.isDirectory()) {
            return false;
+4 −3
Original line number Diff line number Diff line

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

# unittests
@@ -8,6 +6,10 @@ LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := $(call all-java-files-under, common) \
    $(call all-java-files-under, unit) \
    $(call all-java-files-under, functional)

# For testing ZIP files.
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res

LOCAL_JAVA_LIBRARIES := android.test.runner
LOCAL_STATIC_JAVA_LIBRARIES := mockito-target ub-uiautomator espresso-core guava
LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
@@ -16,4 +18,3 @@ LOCAL_INSTRUMENTATION_FOR := DocumentsUI
LOCAL_CERTIFICATE := platform

include $(BUILD_PACKAGE)
+827 B

File added.

No diff preview for this file type.

+318 B

File added.

No diff preview for this file type.

+211 B

File added.

No diff preview for this file type.

Loading