@Test public void testOnJSException() throws Exception { mInstance.onJSException(null,null,null); mInstance.onJSException("100","test","some error"); }
public void onJSException(final String errCode, final String function, final String exception) { if (mRenderListener != null && mContext != null) { runOnUiThread(new Runnable() { @Override public void run() { if (mRenderListener != null && mContext != null) { StringBuilder builder = new StringBuilder(); builder.append(function); builder.append(exception); mRenderListener.onException(WXSDKInstance.this, errCode, builder.toString()); } } }); } }
WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChangeListener { public void onJSException(final String errCode, final String function, final String exception) { if (mRenderListener != null && mContext != null) { runOnUiThread(new Runnable() { @Override public void run() { if (mRenderListener != null && mContext != null) { StringBuilder builder = new StringBuilder(); builder.append(function); builder.append(exception); mRenderListener.onException(WXSDKInstance.this, errCode, builder.toString()); } } }); } } }
WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChangeListener { public void onJSException(final String errCode, final String function, final String exception) { if (mRenderListener != null && mContext != null) { runOnUiThread(new Runnable() { @Override public void run() { if (mRenderListener != null && mContext != null) { StringBuilder builder = new StringBuilder(); builder.append(function); builder.append(exception); mRenderListener.onException(WXSDKInstance.this, errCode, builder.toString()); } } }); } } WXSDKInstance(Context context); @RestrictTo(Scope.TESTS)  WXSDKInstance(Context context,String id); }
WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChangeListener { public void onJSException(final String errCode, final String function, final String exception) { if (mRenderListener != null && mContext != null) { runOnUiThread(new Runnable() { @Override public void run() { if (mRenderListener != null && mContext != null) { StringBuilder builder = new StringBuilder(); builder.append(function); builder.append(exception); mRenderListener.onException(WXSDKInstance.this, errCode, builder.toString()); } } }); } } WXSDKInstance(Context context); @RestrictTo(Scope.TESTS)  WXSDKInstance(Context context,String id); List<String> getLayerOverFlowListeners(); void addLayerOverFlowListener(String ref); void removeLayerOverFlowListener(String ref); void setUseSingleProcess(boolean flag); void setUseSandBox(boolean flag); int getMaxHiddenEmbedsNum(); void setMaxHiddenEmbedsNum(int maxHiddenEmbedsNum); @WorkerThread @RestrictTo(Scope.LIBRARY) void addInActiveAddElementAction(String ref, GraphicActionAddElement action); @WorkerThread @RestrictTo(Scope.LIBRARY) void removeInActiveAddElmentAction(String ref); @WorkerThread @RestrictTo(Scope.LIBRARY) GraphicActionAddElement getInActiveAddElementAction(String ref); void setRenderContainer(RenderContainer a); boolean isTrackComponent(); void setTrackComponent(boolean trackComponent); boolean isLayerTypeEnabled(); void enableLayerType(boolean enable); @RestrictTo(RestrictTo.Scope.LIBRARY) @NonNull FlatGUIContext getFlatUIContext(); boolean isNeedValidate(); boolean isNeedReLoad(); void setNeedLoad(boolean load); void setInstanceViewPortWidth(int instanceViewPortWidth); int getInstanceViewPortWidth(); WXComponent getRootComponent(); void setNestedInstanceInterceptor(NestedInstanceInterceptor interceptor); final WXSDKInstance createNestedInstance(NestedContainer container); void addOnInstanceVisibleListener(OnInstanceVisibleListener l); void removeOnInstanceVisibleListener(OnInstanceVisibleListener l); void init(Context context); void setComponentObserver(ComponentObserver observer); ComponentObserver getComponentObserver(); NativeInvokeHelper getNativeInvokeHelper(); @Deprecated void setBizType(String bizType); ScrollView getScrollView(); void setRootScrollView(ScrollView scrollView); @Deprecated void registerScrollViewListener(WXScrollView.WXScrollViewListener scrollViewListener); @Deprecated WXScrollView.WXScrollViewListener getScrollViewListener(); @Deprecated void setIWXUserTrackAdapter(IWXUserTrackAdapter adapter); void render(String template, Map<String, Object> options, String jsonInitData); @Deprecated void render(String template, Map<String, Object> options, String jsonInitData, WXRenderStrategy flag); void render(String pageName, String template, Map<String, Object> options, String jsonInitData, WXRenderStrategy flag); @Deprecated void render(String pageName, String template, Map<String, Object> options, String jsonInitData, int width, int height, WXRenderStrategy flag); void render(String template); @Deprecated void render(String template, int width, int height); @Deprecated void renderByUrl(String pageName, final String url, Map<String, Object> options, final String jsonInitData, final int width, final int height, final WXRenderStrategy flag); void renderByUrl(String pageName, final String url, Map<String, Object> options, final String jsonInitData, final WXRenderStrategy flag); void reloadPage(boolean reloadThis); void refreshInstance(Map<String, Object> data); void refreshInstance(String jsonData); WXRenderStrategy getRenderStrategy(); Context getUIContext(); String getInstanceId(); Context getContext(); int getWeexHeight(); int getWeexWidth(); IWXImgLoaderAdapter getImgLoaderAdapter(); IDrawableLoader getDrawableLoader(); URIAdapter getURIAdapter(); Uri rewriteUri(Uri uri,String type); IWXHttpAdapter getWXHttpAdapter(); IWXStatisticsListener getWXStatisticsListener(); @Nullable IWebSocketAdapter getWXWebSocketAdapter(); @Deprecated void reloadImages(); boolean isPreRenderMode(); void setPreRenderMode(final boolean isPreRenderMode); void setContext(@NonNull Context context); void registerRenderListener(IWXRenderListener listener); @Deprecated void registerActivityStateListener(IWXActivityStateListener listener); void registerStatisticsListener(IWXStatisticsListener listener); void setRenderStartTime(long renderStartTime); @Override void onActivityCreate(); @Override void onActivityStart(); boolean onCreateOptionsMenu(Menu menu); @Override void onActivityPause(); @Override void onActivityResume(); @Override void onActivityStop(); @Override void onActivityDestroy(); @Override boolean onActivityBack(); boolean onBackPressed(); void onActivityResult(int requestCode, int resultCode, Intent data); void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults); void onViewDisappear(); void onViewAppear(); void onCreateFinish(); void onUpdateFinish(); void runOnUiThread(Runnable action); void onRenderSuccess(final int width, final int height); void onRefreshSuccess(final int width, final int height); void onElementChange(); void onRenderError(final String errCode, final String msg); void onJSException(final String errCode, final String function, final String exception); @Override final void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int
          oldTop, int oldRight, int oldBottom); void onLayoutChange(View godView); void firstScreenCreateInstanceTime(long time); void callJsTime(final long time); void onComponentCreate(WXComponent component,long createTime); void callActionAddElementTime(long time); void firstScreenRenderFinished(); void createInstanceFinished(long time); synchronized void destroy(); boolean isDestroy(); @Nullable String getBundleUrl(); View getRootView(); View getContainerView(); @Deprecated void setBundleUrl(String url); void onRootCreated(WXComponent root); void moveFixedView(View fixedChild); void removeFixedView(View fixedChild); int getRenderContainerPaddingLeft(); int getRenderContainerPaddingTop(); synchronized List<OnWXScrollListener> getWXScrollListeners(); synchronized void registerOnWXScrollListener(OnWXScrollListener wxScrollListener); void setSize(int width, int height); void fireGlobalEventCallback(String eventName, Map<String,Object> params); void fireEvent(String elementRef,final String type, final Map<String, Object> data,final Map<String, Object> domChanges, List<Object> eventArgs); void fireEvent(String elementRef,final String type, final Map<String, Object> data,final Map<String, Object> domChanges, List<Object> eventArgs, EventResult callback); void fireEvent(String elementRef,final String type, final Map<String, Object> data,final Map<String, Object> domChanges); void fireEvent(String elementRef,final String type, final Map<String, Object> data); void fireEvent(String ref, String type); void fireModuleEvent(String eventName, WXModule module,Map<String, Object> params); boolean checkModuleEventRegistered(String eventName,WXModule module); WXPerformance getWXPerformance(); Map<String, Serializable> getUserTrackParams(); void addUserTrackParameter(String key,Serializable value); void clearUserTrackParameters(); void removeUserTrackParameter(String key); int getMaxDeepLayer(); void setMaxDeepLayer(int maxDeepLayer); int getMaxDomDeep(); void setMaxDomDeep(int maxDomDeep); void onHttpStart(); String getTemplateInfo(); boolean isContentMd5Match(); String getTemplate(); void setTemplate(String template); void OnVSync(); void addContentBoxMeasurement(long renderObjectPtr, ContentBoxMeasurement contentBoxMeasurement); ContentBoxMeasurement getContentBoxMeasurement(long renderObjectPtr); }
WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChangeListener { public void onJSException(final String errCode, final String function, final String exception) { if (mRenderListener != null && mContext != null) { runOnUiThread(new Runnable() { @Override public void run() { if (mRenderListener != null && mContext != null) { StringBuilder builder = new StringBuilder(); builder.append(function); builder.append(exception); mRenderListener.onException(WXSDKInstance.this, errCode, builder.toString()); } } }); } } WXSDKInstance(Context context); @RestrictTo(Scope.TESTS)  WXSDKInstance(Context context,String id); List<String> getLayerOverFlowListeners(); void addLayerOverFlowListener(String ref); void removeLayerOverFlowListener(String ref); void setUseSingleProcess(boolean flag); void setUseSandBox(boolean flag); int getMaxHiddenEmbedsNum(); void setMaxHiddenEmbedsNum(int maxHiddenEmbedsNum); @WorkerThread @RestrictTo(Scope.LIBRARY) void addInActiveAddElementAction(String ref, GraphicActionAddElement action); @WorkerThread @RestrictTo(Scope.LIBRARY) void removeInActiveAddElmentAction(String ref); @WorkerThread @RestrictTo(Scope.LIBRARY) GraphicActionAddElement getInActiveAddElementAction(String ref); void setRenderContainer(RenderContainer a); boolean isTrackComponent(); void setTrackComponent(boolean trackComponent); boolean isLayerTypeEnabled(); void enableLayerType(boolean enable); @RestrictTo(RestrictTo.Scope.LIBRARY) @NonNull FlatGUIContext getFlatUIContext(); boolean isNeedValidate(); boolean isNeedReLoad(); void setNeedLoad(boolean load); void setInstanceViewPortWidth(int instanceViewPortWidth); int getInstanceViewPortWidth(); WXComponent getRootComponent(); void setNestedInstanceInterceptor(NestedInstanceInterceptor interceptor); final WXSDKInstance createNestedInstance(NestedContainer container); void addOnInstanceVisibleListener(OnInstanceVisibleListener l); void removeOnInstanceVisibleListener(OnInstanceVisibleListener l); void init(Context context); void setComponentObserver(ComponentObserver observer); ComponentObserver getComponentObserver(); NativeInvokeHelper getNativeInvokeHelper(); @Deprecated void setBizType(String bizType); ScrollView getScrollView(); void setRootScrollView(ScrollView scrollView); @Deprecated void registerScrollViewListener(WXScrollView.WXScrollViewListener scrollViewListener); @Deprecated WXScrollView.WXScrollViewListener getScrollViewListener(); @Deprecated void setIWXUserTrackAdapter(IWXUserTrackAdapter adapter); void render(String template, Map<String, Object> options, String jsonInitData); @Deprecated void render(String template, Map<String, Object> options, String jsonInitData, WXRenderStrategy flag); void render(String pageName, String template, Map<String, Object> options, String jsonInitData, WXRenderStrategy flag); @Deprecated void render(String pageName, String template, Map<String, Object> options, String jsonInitData, int width, int height, WXRenderStrategy flag); void render(String template); @Deprecated void render(String template, int width, int height); @Deprecated void renderByUrl(String pageName, final String url, Map<String, Object> options, final String jsonInitData, final int width, final int height, final WXRenderStrategy flag); void renderByUrl(String pageName, final String url, Map<String, Object> options, final String jsonInitData, final WXRenderStrategy flag); void reloadPage(boolean reloadThis); void refreshInstance(Map<String, Object> data); void refreshInstance(String jsonData); WXRenderStrategy getRenderStrategy(); Context getUIContext(); String getInstanceId(); Context getContext(); int getWeexHeight(); int getWeexWidth(); IWXImgLoaderAdapter getImgLoaderAdapter(); IDrawableLoader getDrawableLoader(); URIAdapter getURIAdapter(); Uri rewriteUri(Uri uri,String type); IWXHttpAdapter getWXHttpAdapter(); IWXStatisticsListener getWXStatisticsListener(); @Nullable IWebSocketAdapter getWXWebSocketAdapter(); @Deprecated void reloadImages(); boolean isPreRenderMode(); void setPreRenderMode(final boolean isPreRenderMode); void setContext(@NonNull Context context); void registerRenderListener(IWXRenderListener listener); @Deprecated void registerActivityStateListener(IWXActivityStateListener listener); void registerStatisticsListener(IWXStatisticsListener listener); void setRenderStartTime(long renderStartTime); @Override void onActivityCreate(); @Override void onActivityStart(); boolean onCreateOptionsMenu(Menu menu); @Override void onActivityPause(); @Override void onActivityResume(); @Override void onActivityStop(); @Override void onActivityDestroy(); @Override boolean onActivityBack(); boolean onBackPressed(); void onActivityResult(int requestCode, int resultCode, Intent data); void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults); void onViewDisappear(); void onViewAppear(); void onCreateFinish(); void onUpdateFinish(); void runOnUiThread(Runnable action); void onRenderSuccess(final int width, final int height); void onRefreshSuccess(final int width, final int height); void onElementChange(); void onRenderError(final String errCode, final String msg); void onJSException(final String errCode, final String function, final String exception); @Override final void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int
          oldTop, int oldRight, int oldBottom); void onLayoutChange(View godView); void firstScreenCreateInstanceTime(long time); void callJsTime(final long time); void onComponentCreate(WXComponent component,long createTime); void callActionAddElementTime(long time); void firstScreenRenderFinished(); void createInstanceFinished(long time); synchronized void destroy(); boolean isDestroy(); @Nullable String getBundleUrl(); View getRootView(); View getContainerView(); @Deprecated void setBundleUrl(String url); void onRootCreated(WXComponent root); void moveFixedView(View fixedChild); void removeFixedView(View fixedChild); int getRenderContainerPaddingLeft(); int getRenderContainerPaddingTop(); synchronized List<OnWXScrollListener> getWXScrollListeners(); synchronized void registerOnWXScrollListener(OnWXScrollListener wxScrollListener); void setSize(int width, int height); void fireGlobalEventCallback(String eventName, Map<String,Object> params); void fireEvent(String elementRef,final String type, final Map<String, Object> data,final Map<String, Object> domChanges, List<Object> eventArgs); void fireEvent(String elementRef,final String type, final Map<String, Object> data,final Map<String, Object> domChanges, List<Object> eventArgs, EventResult callback); void fireEvent(String elementRef,final String type, final Map<String, Object> data,final Map<String, Object> domChanges); void fireEvent(String elementRef,final String type, final Map<String, Object> data); void fireEvent(String ref, String type); void fireModuleEvent(String eventName, WXModule module,Map<String, Object> params); boolean checkModuleEventRegistered(String eventName,WXModule module); WXPerformance getWXPerformance(); Map<String, Serializable> getUserTrackParams(); void addUserTrackParameter(String key,Serializable value); void clearUserTrackParameters(); void removeUserTrackParameter(String key); int getMaxDeepLayer(); void setMaxDeepLayer(int maxDeepLayer); int getMaxDomDeep(); void setMaxDomDeep(int maxDomDeep); void onHttpStart(); String getTemplateInfo(); boolean isContentMd5Match(); String getTemplate(); void setTemplate(String template); void OnVSync(); void addContentBoxMeasurement(long renderObjectPtr, ContentBoxMeasurement contentBoxMeasurement); ContentBoxMeasurement getContentBoxMeasurement(long renderObjectPtr); public boolean mEnd; static final String BUNDLE_URL; static String requestUrl; public long mRenderStartNanos; public int mExecJSTraceId; public String mwxDims; public long measureTimes; public WeakReference<String> templateRef; public Map<String,List<String>> responseHeaders; public long mRenderStartTime; public PriorityQueue<WXEmbed> hiddenEmbeds; }