Don't complete requests if mock response wasn't provided
Reviewed By: jingc Differential Revision: D4959691 fbshipit-source-id: 8a61c6fc559a2be4603b9d01dafa52f7441bd3a6
This commit is contained in:
parent
8478767044
commit
2d3a272e0e
|
@ -37,7 +37,7 @@ public class NetworkRecordingModuleMock extends ReactContextBaseJavaModule {
|
|||
public int mLastRequestId;
|
||||
public boolean mAbortedRequest;
|
||||
|
||||
private final boolean mCompleteRequest;
|
||||
private boolean mCompleteRequest;
|
||||
|
||||
public NetworkRecordingModuleMock(ReactApplicationContext reactContext) {
|
||||
this(reactContext, true);
|
||||
|
@ -116,6 +116,10 @@ public class NetworkRecordingModuleMock extends ReactContextBaseJavaModule {
|
|||
return true;
|
||||
}
|
||||
|
||||
public void setCompleteRequest(boolean completeRequest) {
|
||||
mCompleteRequest = completeRequest;
|
||||
}
|
||||
|
||||
private void onDataReceived(int requestId, String data) {
|
||||
WritableArray args = Arguments.createArray();
|
||||
args.pushInt(requestId);
|
||||
|
|
Loading…
Reference in New Issue