From a9a7c7889991b1f43052a3c5260d79f07329d570 Mon Sep 17 00:00:00 2001 From: Marc Horowitz Date: Wed, 20 Jan 2016 22:31:48 -0800 Subject: [PATCH] Expose setGlobalVariable in CatalystInstance interface Summary: this helps with cleaning up some tests public Reviewed By: astreet Differential Revision: D2816285 fb-gh-sync-id: 37c4da7bdb3c8b5439184316bb5a8939160b40a3 --- .../com/facebook/react/bridge/CatalystInstance.java | 4 ++++ .../facebook/react/bridge/CatalystInstanceImpl.java | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java index e9240eb888153d..c0c98cf799cda4 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java @@ -12,6 +12,7 @@ import java.util.Collection; import com.facebook.react.bridge.queue.CatalystQueueConfiguration; +import com.facebook.react.common.annotations.VisibleForTesting; import com.facebook.proguard.annotations.DoNotStrip; import com.facebook.react.common.annotations.VisibleForTesting; @@ -66,4 +67,7 @@ public interface CatalystInstance { boolean supportsProfiling(); void startProfiler(String title); void stopProfiler(String title, String filename); + + @VisibleForTesting + void setGlobalVariable(String propName, String jsonValue); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java index 70af8e3804f7a3..31fe7a528cc846 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java @@ -306,11 +306,6 @@ public CatalystQueueConfiguration getCatalystQueueConfiguration() { return mCatalystQueueConfiguration; } - @VisibleForTesting - public ReactBridge getBridge() { - return mBridge; - } - @Override public T getJSModule(Class jsInterface) { return Assertions.assertNotNull(mJSModuleRegistry).getJavaScriptModule(jsInterface); @@ -366,6 +361,12 @@ public void stopProfiler(String title, String filename) { mBridge.stopProfiler(title, filename); } + @VisibleForTesting + @Override + public void setGlobalVariable(String propName, String jsonValue) { + mBridge.setGlobalVariable(propName, jsonValue); + } + private String buildModulesConfigJSONProperty( NativeModuleRegistry nativeModuleRegistry, JavaScriptModulesConfig jsModulesConfig) {