diff options
author | Yurii Zubrytskyi <zyy@google.com> | 2021-02-19 00:08:36 -0800 |
---|---|---|
committer | Yurii Zubrytskyi <zyy@google.com> | 2021-02-22 05:15:50 +0000 |
commit | 3fde572afccd84e1a6573ebb02a89be3ff18d1fe (patch) | |
tree | 83abf13175c1272267b12a0ef09ffbe945824020 /services/incremental/test/IncrementalServiceTest.cpp | |
parent | a5946f7056fe30957f8eebd2beac06ea389dbbc9 (diff) |
Fix the progress getting for mapped files
Mapped files don't support querying their loading progress,
so we should simply skip them - they are already a part of
some other file, and will get accounted for loading when
that file's progress get queried
+ a bunch of small improvements
Bug: 180535478
Test: atest service.incremental_test, adb install --incremental
with mapped native libs
Change-Id: Ifc8a402144f2f3669a0419124fb0f35d7002190a
(cherry picked from commit 7731ebd1d8187c92a992d1f53c4114a6c40f7563)
Diffstat (limited to 'services/incremental/test/IncrementalServiceTest.cpp')
-rw-r--r-- | services/incremental/test/IncrementalServiceTest.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/services/incremental/test/IncrementalServiceTest.cpp b/services/incremental/test/IncrementalServiceTest.cpp index 154a55fd8bd1..b00a84fcd003 100644 --- a/services/incremental/test/IncrementalServiceTest.cpp +++ b/services/incremental/test/IncrementalServiceTest.cpp @@ -543,16 +543,16 @@ public: class MockFsWrapper : public FsWrapper { public: - MOCK_CONST_METHOD1(listFilesRecursive, std::vector<std::string>(std::string_view)); - void hasNoFile() { - ON_CALL(*this, listFilesRecursive(_)).WillByDefault(Return(std::vector<std::string>())); - } + MOCK_CONST_METHOD2(listFilesRecursive, void(std::string_view, FileCallback)); + void hasNoFile() { ON_CALL(*this, listFilesRecursive(_, _)).WillByDefault(Return()); } void hasFiles() { - ON_CALL(*this, listFilesRecursive(_)) + ON_CALL(*this, listFilesRecursive(_, _)) .WillByDefault(Invoke(this, &MockFsWrapper::fakeFiles)); } - std::vector<std::string> fakeFiles(std::string_view directoryPath) { - return {"base.apk", "split.apk", "lib/a.so"}; + void fakeFiles(std::string_view directoryPath, FileCallback onFile) { + for (auto file : {"base.apk", "split.apk", "lib/a.so"}) { + if (!onFile(file)) break; + } } }; |