| Index: android_webview/javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java
|
| diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java
|
| index b78bcf0adbb4b62fc52b94c49ad485c720e1b707..380fc680839cb9d51f46463f10792ac31812a853 100644
|
| --- a/android_webview/javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java
|
| +++ b/android_webview/javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java
|
| @@ -9,7 +9,6 @@ import android.test.suitebuilder.annotation.SmallTest;
|
| import org.chromium.android_webview.AwContents;
|
| import org.chromium.android_webview.test.util.CommonResources;
|
| import org.chromium.base.ThreadUtils;
|
| -import org.chromium.base.annotations.SuppressFBWarnings;
|
| import org.chromium.base.test.util.DisabledTest;
|
| import org.chromium.content.browser.test.util.HistoryUtils;
|
| import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
|
| @@ -29,11 +28,6 @@ public class NavigationHistoryTest extends AwTestBase {
|
| private static final String PAGE_2_PATH = "/page2.html";
|
| private static final String PAGE_2_TITLE = "Page 2 Title";
|
| private static final String PAGE_WITH_HASHTAG_REDIRECT_TITLE = "Page with hashtag";
|
| - private static final String LOGIN_PAGE_PATH = "/login.html";
|
| - private static final String LOGIN_PAGE_TITLE = "Login page";
|
| - private static final String LOGIN_RESPONSE_PAGE_PATH = "/login-response.html";
|
| - private static final String LOGIN_RESPONSE_PAGE_TITLE = "Login response";
|
| - private static final String LOGIN_RESPONSE_PAGE_HELP_LINK_ID = "help";
|
|
|
| private TestWebServer mWebServer;
|
| private TestAwContentsClient mContentsClient;
|
| @@ -219,105 +213,6 @@ public class NavigationHistoryTest extends AwTestBase {
|
| checkHistoryItem(list.getEntryAtIndex(0), url, url, "", false);
|
| }
|
|
|
| - private String addNoncacheableLoginPageToServer(TestWebServer webServer) {
|
| - final String submitButtonId = "submit";
|
| - final String loginPageHtml =
|
| - "<html>"
|
| - + " <head>"
|
| - + " <title>" + LOGIN_PAGE_TITLE + "</title>"
|
| - + " <script>"
|
| - + " function startAction() {"
|
| - + " button = document.getElementById('" + submitButtonId + "');"
|
| - + " button.click();"
|
| - + " }"
|
| - + " </script>"
|
| - + " </head>"
|
| - + " <body onload='setTimeout(startAction, 0)'>"
|
| - + " <form action='" + LOGIN_RESPONSE_PAGE_PATH.substring(1) + "' method='post'>"
|
| - + " <input type='text' name='login'>"
|
| - + " <input id='" + submitButtonId + "' type='submit' value='Submit'>"
|
| - + " </form>"
|
| - + " </body>"
|
| - + "</html>";
|
| - return mWebServer.setResponse(LOGIN_PAGE_PATH,
|
| - loginPageHtml,
|
| - CommonResources.getTextHtmlHeaders(true));
|
| - }
|
| -
|
| - private String addNoncacheableLoginResponsePageToServer(TestWebServer webServer) {
|
| - final String loginResponsePageHtml =
|
| - "<html>"
|
| - + " <head>"
|
| - + " <title>" + LOGIN_RESPONSE_PAGE_TITLE + "</title>"
|
| - + " </head>"
|
| - + " <body>"
|
| - + " Login incorrect"
|
| - + " <div><a id='" + LOGIN_RESPONSE_PAGE_HELP_LINK_ID + "' href='"
|
| - + PAGE_1_PATH.substring(1) + "'>Help</a></div>'"
|
| - + " </body>"
|
| - + "</html>";
|
| - return mWebServer.setResponse(LOGIN_RESPONSE_PAGE_PATH,
|
| - loginResponsePageHtml,
|
| - CommonResources.getTextHtmlHeaders(true));
|
| - }
|
| -
|
| - // This test simulates Google login page behavior. The page is non-cacheable
|
| - // and uses POST method for submission. It also contains a help link, leading
|
| - // to another page. We are verifying that it is possible to go back to the
|
| - // submitted login page after visiting the help page.
|
| - /**
|
| - * Temporarily disabled. It is blocking a patch that fixes chromium's form
|
| - * resubmission defenses. This test should probably expect a modal dialog
|
| - * asking permission to re-post rather than expecting to just be able to navigate
|
| - * back to a page that specified Cache-Control: no-store.
|
| - *
|
| - * @MediumTest
|
| - * @Feature({"AndroidWebView"})
|
| - */
|
| - @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
|
| - @DisabledTest
|
| - public void testNavigateBackToNoncacheableLoginPage() throws Throwable {
|
| - final TestCallbackHelperContainer.OnPageFinishedHelper onPageFinishedHelper =
|
| - mContentsClient.getOnPageFinishedHelper();
|
| -
|
| - final String loginPageUrl = addNoncacheableLoginPageToServer(mWebServer);
|
| - final String loginResponsePageUrl = addNoncacheableLoginResponsePageToServer(mWebServer);
|
| - final String page1Url = addPage1ToServer(mWebServer);
|
| -
|
| - getAwSettingsOnUiThread(mAwContents).setJavaScriptEnabled(true);
|
| - loadUrlSync(mAwContents, onPageFinishedHelper, loginPageUrl);
|
| - // Since the page performs an async action, we can't rely on callbacks.
|
| - pollOnUiThread(new Callable<Boolean>() {
|
| - @Override
|
| - public Boolean call() {
|
| - String title = mAwContents.getTitle();
|
| - return LOGIN_RESPONSE_PAGE_TITLE.equals(title);
|
| - }
|
| - });
|
| - executeJavaScriptAndWaitForResult(mAwContents,
|
| - mContentsClient,
|
| - "link = document.getElementById('" + LOGIN_RESPONSE_PAGE_HELP_LINK_ID + "');"
|
| - + "link.click();");
|
| - pollOnUiThread(new Callable<Boolean>() {
|
| - @Override
|
| - public Boolean call() {
|
| - String title = mAwContents.getTitle();
|
| - return PAGE_1_TITLE.equals(title);
|
| - }
|
| - });
|
| - // Verify that we can still go back to the login response page despite that
|
| - // it is non-cacheable.
|
| - HistoryUtils.goBackSync(getInstrumentation(), mAwContents.getWebContents(),
|
| - onPageFinishedHelper);
|
| - pollOnUiThread(new Callable<Boolean>() {
|
| - @Override
|
| - public Boolean call() {
|
| - String title = mAwContents.getTitle();
|
| - return LOGIN_RESPONSE_PAGE_TITLE.equals(title);
|
| - }
|
| - });
|
| - }
|
| -
|
| // See http://crbug.com/481570
|
| @SmallTest
|
| public void testTitleUpdatedWhenGoingBack() throws Throwable {
|
|
|