mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-05 09:29:07 +08:00
Do not block RN start path with fsync calls
Reviewed By: bnham Differential Revision: D4097184 fbshipit-source-id: b3a7aeac7f4196a510efe650194eebdc797b5ec9
This commit is contained in:
committed by
Facebook Github Bot
parent
9d86a1295e
commit
afe1619eb8
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user