com.facebook.react.common.annotations.VisibleForTesting Java Examples

The following examples show how to use com.facebook.react.common.annotations.VisibleForTesting. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CatalystInstanceImpl.java    From react-native-GPay with MIT License 6 votes vote down vote up
/**
 * Initialize all the native modules
 */
@VisibleForTesting
@Override
public void initialize() {
  Log.d(ReactConstants.TAG, "CatalystInstanceImpl.initialize()");
  Assertions.assertCondition(
      !mInitialized,
      "This catalyst instance has already been initialized");
  // We assume that the instance manager blocks on running the JS bundle. If
  // that changes, then we need to set mAcceptCalls just after posting the
  // task that will run the js bundle.
  Assertions.assertCondition(
      mAcceptCalls,
      "RunJSBundle hasn't completed.");
  mInitialized = true;
  mNativeModulesQueueThread.runOnQueue(new Runnable() {
    @Override
    public void run() {
      mNativeModuleRegistry.notifyJSInstanceInitialized();
    }
  });
}
 
Example #2
Source File: ReactViewGroup.java    From react-native-GPay with MIT License 5 votes vote down vote up
@VisibleForTesting
public int getBackgroundColor() {
  if (getBackground() != null) {
    return ((ReactViewBackgroundDrawable) getBackground()).getColor();
  }
  return DEFAULT_BACKGROUND_COLOR;
}
 
Example #3
Source File: ReactViewBackgroundDrawable.java    From react-native-GPay with MIT License 4 votes vote down vote up
@VisibleForTesting
public int getColor() {
  return mColor;
}
 
Example #4
Source File: ReactPicker.java    From react-native-GPay with MIT License 4 votes vote down vote up
@VisibleForTesting
public int getMode() {
  return mMode;
}
 
Example #5
Source File: ReactModalHostView.java    From react-native-GPay with MIT License 4 votes vote down vote up
@VisibleForTesting
public @Nullable Dialog getDialog() {
  return mDialog;
}
 
Example #6
Source File: AsyncStorageModule.java    From react-native-GPay with MIT License 4 votes vote down vote up
@VisibleForTesting
AsyncStorageModule(ReactApplicationContext reactContext, Executor executor) {
  super(reactContext);
  this.executor = new SerialExecutor(executor);
  mReactDatabaseSupplier = ReactDatabaseSupplier.getInstance(reactContext);
}
 
Example #7
Source File: CatalystInstance.java    From react-native-GPay with MIT License 4 votes vote down vote up
@VisibleForTesting
void setGlobalVariable(String propName, String jsonValue);
 
Example #8
Source File: FabricUIManager.java    From react-native-GPay with MIT License 4 votes vote down vote up
@VisibleForTesting
ReactShadowNode getRootNode(int rootTag) {
  return mRootShadowNodeRegistry.getNode(rootTag);
}
 
Example #9
Source File: ReactInstanceManager.java    From react-native-GPay with MIT License 4 votes vote down vote up
@VisibleForTesting
public @Nullable ReactContext getCurrentReactContext() {
  synchronized (mReactContextLock) {
    return mCurrentReactContext;
  }
}
 
Example #10
Source File: ReactRootView.java    From react-native-GPay with MIT License 4 votes vote down vote up
/**
 * Is used by unit test to setup mIsAttachedToWindow flags, that will let this
 * view to be properly attached to catalyst instance by startReactApplication call
 */
@VisibleForTesting
/* package */ void simulateAttachForTesting() {
  mIsAttachedToInstance = true;
  mJSTouchDispatcher = new JSTouchDispatcher(this);
}
 
Example #11
Source File: NativeAnimatedModule.java    From react-native-GPay with MIT License 4 votes vote down vote up
@VisibleForTesting
public void setNodesManager(NativeAnimatedNodesManager nodesManager) {
  mNodesManager = nodesManager;
}
 
Example #12
Source File: CatalystInstance.java    From react-native-GPay with MIT License 2 votes vote down vote up
/**
 * Initialize all the native modules
 */
@VisibleForTesting
void initialize();