TurbolinksSession implements TurbolinksScrollUpCallback { public void resetToColdBoot() { bridgeInjectionInProgress = false; turbolinksIsReady = false; coldBootInProgress = false; } private  TurbolinksSession(final Context context); static TurbolinksSession getNew(Context context); static TurbolinksSession getDefault(Context context); static void resetDefault(); static void setDebugLoggingEnabled(boolean enabled); TurbolinksSession activity(Activity activity); TurbolinksSession adapter(TurbolinksAdapter turbolinksAdapter); String getLocation(); String getPreviousLocation(); TurbolinksSession view(TurbolinksView turbolinksView); void visit(String location); void visitWithAuthHeader(String location, String token); TurbolinksSession progressView(View progressView, int progressIndicatorResId, int progressIndicatorDelay); TurbolinksSession addProgressObserver(ProgressObserver progressObserver); TurbolinksSession addPageObserver(PageObserver pageObserver); TurbolinksSession restoreWithCachedSnapshot(boolean restoreWithCachedSnapshot); @SuppressWarnings("unused") @android.webkit.JavascriptInterface void visitProposedToLocationWithAction(final String location, final String action); @SuppressWarnings("unused") @android.webkit.JavascriptInterface void visitStarted(String visitIdentifier, boolean visitHasCachedSnapshot); @SuppressWarnings("unused") @android.webkit.JavascriptInterface void visitRequestCompleted(String visitIdentifier); @SuppressWarnings("unused") @android.webkit.JavascriptInterface void visitRequestFailedWithStatusCode(final String visitIdentifier, final int statusCode); @SuppressWarnings("unused") @android.webkit.JavascriptInterface void visitRendered(String visitIdentifier); @SuppressWarnings("unused") @android.webkit.JavascriptInterface void visitCompleted(String visitIdentifier, String restorationIdentifier); @SuppressWarnings("unused") @android.webkit.JavascriptInterface void pageInvalidated(); @SuppressWarnings("unused") @android.webkit.JavascriptInterface void hideProgressView(final String visitIdentifier); @SuppressWarnings("unused") @android.webkit.JavascriptInterface void setTurbolinksIsReady(boolean turbolinksIsReady); @SuppressWarnings("unused") @android.webkit.JavascriptInterface void turbolinksDoesNotExist(); @SuppressLint("JavascriptInterface") void addJavascriptInterface(Object object, String name); Activity getActivity(); WebView getWebView(); void resetToColdBoot(); void runJavascript(final String functionName, final Object... params); void runJavascriptRaw(String rawJavascript); void setScreenshotsEnabled(boolean enabled); TurbolinksSession setPullToRefreshEnabled(boolean enabled); boolean turbolinksIsReady(); void visitLocationWithAction(String location, String action); @Override boolean canChildScrollUp();  }
@Test public void resetToColdBoot() { turbolinksSession.activity(activity) .adapter(adapter); turbolinksSession.bridgeInjectionInProgress = true; turbolinksSession.turbolinksIsReady = true; turbolinksSession.coldBootInProgress = false; turbolinksSession.resetToColdBoot(); assertThat(turbolinksSession.bridgeInjectionInProgress).isFalse(); assertThat(turbolinksSession.turbolinksIsReady).isFalse(); assertThat(turbolinksSession.coldBootInProgress).isFalse(); }