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

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/AwWebContentsObserverTest.java

Issue 2950043004: Only call doUpdateVisitedHistory for the main frame. (Closed)
Patch Set: Created 3 years, 6 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 | « android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientVisitedHistoryTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/javatests/src/org/chromium/android_webview/test/AwWebContentsObserverTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwWebContentsObserverTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwWebContentsObserverTest.java
index 0db88d641d3d2b5c44a193a76be159c674441538..0718fa1a4b028cc883718b112716407b1c5ae076 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwWebContentsObserverTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwWebContentsObserverTest.java
@@ -159,6 +159,20 @@ public class AwWebContentsObserverTest extends AwTestBase {
doUpdateVisitedHistoryHelper.getUrl());
assertEquals(false, doUpdateVisitedHistoryHelper.getIsReload());
+ callCount = doUpdateVisitedHistoryHelper.getCallCount();
+ mWebContentsObserver.didFinishNavigation(nullUrl, isInMainFrame, isErrorPage, hasCommitted,
+ !isSameDocument, fragmentNavigation, PageTransition.TYPED, errorCode,
+ errorDescription, httpStatusCode);
+ mWebContentsObserver.didFinishNavigation(EXAMPLE_URL, !isInMainFrame, isErrorPage,
+ hasCommitted, !isSameDocument, fragmentNavigation, PageTransition.TYPED, errorCode,
+ errorDescription, httpStatusCode);
+ doUpdateVisitedHistoryHelper.waitForCallback(callCount);
+ assertEquals("doUpdateVisitedHistory should only be called for the main frame.",
+ callCount + 1, doUpdateVisitedHistoryHelper.getCallCount());
+ assertEquals("doUpdateVisitedHistory should only be called for the main frame.", nullUrl,
+ doUpdateVisitedHistoryHelper.getUrl());
+ assertEquals(false, doUpdateVisitedHistoryHelper.getIsReload());
+
callCount = doUpdateVisitedHistoryHelper.getCallCount();
mWebContentsObserver.didFinishNavigation(EXAMPLE_URL, isInMainFrame, isErrorPage,
hasCommitted, isSameDocument, !fragmentNavigation, PageTransition.RELOAD, errorCode,
« no previous file with comments | « android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientVisitedHistoryTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698