mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Pass fabric flag from native to JS
Reviewed By: mdvacca Differential Revision: D7373722 fbshipit-source-id: 3cd051f38677900693f3da797effa11f9161df37
This commit is contained in:
committed by
Facebook Github Bot
parent
046d4cee8b
commit
cbb7c7c193
+1
-6
@@ -13,7 +13,6 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import com.facebook.react.bridge.JavaScriptModule;
|
||||
import com.facebook.react.bridge.ReactContext;
|
||||
import com.facebook.react.testing.fabric.FabricTestModule;
|
||||
import com.facebook.react.testing.idledetection.IdleWaiter;
|
||||
|
||||
/**
|
||||
@@ -116,11 +115,7 @@ public abstract class ReactInstrumentationTest extends
|
||||
* Override this method to provide extra native modules to be loaded before the app starts
|
||||
*/
|
||||
protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {
|
||||
ReactInstanceSpecForTest instanceSpec = new ReactInstanceSpecForTest();
|
||||
if (isFabricTest()) {
|
||||
instanceSpec.addNativeModule(new FabricTestModule(isFabricTest()));
|
||||
}
|
||||
return instanceSpec;
|
||||
return new ReactInstanceSpecForTest();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2014-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.testing.fabric;
|
||||
|
||||
import com.facebook.react.common.MapBuilder;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.facebook.react.bridge.BaseJavaModule;
|
||||
import com.facebook.react.bridge.ReactMethod;
|
||||
import com.facebook.react.bridge.ReadableArray;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
|
||||
/**
|
||||
* Module to indicate if a test is using Fabric
|
||||
*/
|
||||
public final class FabricTestModule extends BaseJavaModule {
|
||||
|
||||
private final boolean mIsFabricEnabled;
|
||||
|
||||
public FabricTestModule(boolean isFabricEnabled) {
|
||||
mIsFabricEnabled = isFabricEnabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "FabricTestModule";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getConstants() {
|
||||
return MapBuilder.<String, Object>of("IS_FABRIC_ENABLED", mIsFabricEnabled);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user