Do not block RN start path with fsync calls

Reviewed By: bnham

Differential Revision: D4097184

fbshipit-source-id: b3a7aeac7f4196a510efe650194eebdc797b5ec9
This commit is contained in:
Michał Gregorczyk
2016-10-28 19:36:20 -07:00
committed by Facebook Github Bot
parent 9d86a1295e
commit afe1619eb8
3 changed files with 112 additions and 22 deletions

View File

@@ -71,7 +71,7 @@ public class ExistenceCheckingUnpackerTest extends UnpackerTestBase {
@Test
public void testFsyncsAfterUnpacking() throws IOException {
mockStatic(UnpackingJSBundleLoader.class);
mUnpacker.unpack(mContext, mIOBuffer);
mUnpacker.finishUnpacking(mContext);
verifyStatic(times(1));
UnpackingJSBundleLoader.fsync(mDestinationPath);
}

View File

@@ -71,7 +71,8 @@ public class UnpackingJSBundleLoaderTest {
mBuilder = UnpackingJSBundleLoader.newBuilder()
.setDestinationPath(mDestinationPath)
.setSourceURL(URL)
.setContext(mContext);
.setContext(mContext)
.setFinishOnBackgroundThread(false);
mMockUnpackers = new UnpackingJSBundleLoader.Unpacker[MOCK_UNPACKERS_NUM];
for (int i = 0; i < mMockUnpackers.length; ++i) {
@@ -165,6 +166,7 @@ public class UnpackingJSBundleLoaderTest {
verify(unpacker).unpack(
same(mContext),
any(byte[].class));
verify(unpacker).finishUnpacking(same(mContext));
verifyNoMoreInteractions(unpacker);
}
}