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

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

Issue 2944803003: Add regression test for javascript URLs dropping pending navigation entries
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 | « no previous file | 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/AwContentsTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsTest.java
index f682f148135286f63c3a2f9d3ddc3df465d102be..290fc864c8cc05062ec85b357453b3f86cc74d6f 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsTest.java
@@ -743,4 +743,29 @@ public class AwContentsTest extends AwTestBase {
awContents = createAwTestContainerView(mContentsClient).getAwContents();
awContents.resumeTimers();
}
+
+ /** Regression test for https://crbug.com/732976 */
+ @LargeTest
+ @Feature({"AndroidWebView"})
+ public void testJavaScriptUrlAfterLoadData() throws Throwable {
+ AwTestContainerView testView = createAwTestContainerViewOnMainSync(mContentsClient);
+ final AwContents awContents = testView.getAwContents();
+ getInstrumentation().runOnMainSync(new Runnable() {
+ @Override
+ public void run() {
+ // Run javascript navigation immediately, without waiting for the completion of data
+ // URL.
+ awContents.loadData("<html>test</html>", "text/html", "utf-8");
+ awContents.loadUrl("javascript: void(0)");
+ }
+ });
+
+ mContentsClient.getOnPageFinishedHelper().waitForCallback(
+ 0, 1, WAIT_TIMEOUT_MS, TimeUnit.MILLISECONDS);
+ assertEquals("data:text/html,<html>test</html>", awContents.getLastCommittedUrl());
+
+ TestAwContentsClient.AddMessageToConsoleHelper consoleHelper =
+ mContentsClient.getAddMessageToConsoleHelper();
+ assertEquals(0, consoleHelper.getMessages().size());
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698