Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(787)

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/TransitionTest.java

Issue 672973003: Navigation transitions (web to native app): Clear navigation transition data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/android/java/src/org/chromium/content_public/browser/WebContents.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/javatests/src/org/chromium/content/browser/TransitionTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/TransitionTest.java b/content/public/android/javatests/src/org/chromium/content/browser/TransitionTest.java
index 88a7c614b68f7a8ac03a777bbfa66d25fe8efd3b..9d0c6881bf182042d94d626587433fb1d16f55bc 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/TransitionTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/TransitionTest.java
@@ -126,7 +126,7 @@ public class TransitionTest extends ContentShellTestBase {
/**
* Tests that the listener does not receive DidDeferAfterResponseStarted if we specify that
- * the transition is handled.
+ * the transition is not handled.
*/
@SmallTest
public void testDidDeferAfterResponseStartedNotCalled() throws Throwable {
@@ -149,6 +149,32 @@ public class TransitionTest extends ContentShellTestBase {
}
/**
+ * Tests clearNavigationTransitionData(). The listener does not receive
+ * DidDeferAfterResponseStarted even if we specify that the transition is handled
+ * because the data is cleared before the navigation.
+ */
+ @SmallTest
+ public void testDidDeferAfterResponseStartedNotCalledWithoutData() throws Throwable {
+ ContentShellActivity activity = launchContentShellWithUrl(URL_1);
+ waitForActiveShellToBeDoneLoading();
+ ContentViewCore contentViewCore = activity.getActiveContentViewCore();
+ TestCallbackHelperContainer testCallbackHelperContainer =
+ new TestCallbackHelperContainer(contentViewCore);
+
+ contentViewCore.getWebContents().setHasPendingNavigationTransitionForTesting();
+ TestNavigationTransitionDelegate delegate = new TestNavigationTransitionDelegate(
+ contentViewCore.getWebContents(),
+ true);
+ contentViewCore.getWebContents().setNavigationTransitionDelegate(delegate);
+
+ contentViewCore.getWebContents().clearNavigationTransitionData();
+ loadUrl(contentViewCore.getWebContents().getNavigationController(),
+ testCallbackHelperContainer, new LoadUrlParams(URL_1));
+
+ assertFalse("didDeferAfterResponseStarted called.", delegate.getDidCallDefer());
+ }
+
+ /**
* Tests that the resource handler doesn't query the listener if no transition is pending.
*/
@SmallTest
« no previous file with comments | « content/public/android/java/src/org/chromium/content_public/browser/WebContents.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698