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

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientVisitedHistoryTest.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
Index: android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientVisitedHistoryTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientVisitedHistoryTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientVisitedHistoryTest.java
index 04b8906faf66f74d63c3f52a8c5fa8c5d6c33767..0434d530fe22b85971e46f75727d411c5fe76670 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientVisitedHistoryTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientVisitedHistoryTest.java
@@ -67,8 +67,9 @@ public class AwContentsClientVisitedHistoryTest extends AwTestBase {
AwTestContainerView testView = createAwTestContainerViewOnMainSync(mContentsClient);
AwContents awContents = testView.getAwContents();
+ // Load a page with an iframe to make sure the callback only happens for the main frame URL.
final String path = "/testUpdateVisitedHistoryCallback.html";
- final String html = "testUpdateVisitedHistoryCallback";
+ final String html = "<iframe src=\"about:blank\"></iframe>";
TestWebServer webServer = TestWebServer.start();
try {
@@ -80,13 +81,14 @@ public class AwContentsClientVisitedHistoryTest extends AwTestBase {
doUpdateVisitedHistoryHelper.waitForCallback(callCount);
assertEquals(pageUrl, doUpdateVisitedHistoryHelper.getUrl());
assertEquals(false, doUpdateVisitedHistoryHelper.getIsReload());
+ assertEquals(callCount + 1, doUpdateVisitedHistoryHelper.getCallCount());
// Reload
- callCount = doUpdateVisitedHistoryHelper.getCallCount();
loadUrlAsync(awContents, pageUrl);
- doUpdateVisitedHistoryHelper.waitForCallback(callCount);
+ doUpdateVisitedHistoryHelper.waitForCallback(callCount + 1);
assertEquals(pageUrl, doUpdateVisitedHistoryHelper.getUrl());
assertEquals(true, doUpdateVisitedHistoryHelper.getIsReload());
+ assertEquals(callCount + 2, doUpdateVisitedHistoryHelper.getCallCount());
} finally {
webServer.shutdown();
}

Powered by Google App Engine
This is Rietveld 408576698