diff options
author | mnaganov <mnaganov@chromium.org> | 2015-12-07 17:18:01 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-08 01:19:03 +0000 |
commit | fa1ee70280d221edda6efdee535e3f4164663f9b (patch) | |
tree | c77e9c7125159069d9b4f550c0106060c12bddc0 /android_webview/javatests/src/org/chromium | |
parent | 5dbbe211ae99d11578da87a9899bfd86d6ce4b8c (diff) | |
download | chromium_src-fa1ee70280d221edda6efdee535e3f4164663f9b.zip chromium_src-fa1ee70280d221edda6efdee535e3f4164663f9b.tar.gz chromium_src-fa1ee70280d221edda6efdee535e3f4164663f9b.tar.bz2 |
[Android WebView] Remove testNavigateBackToNoncacheableLoginPage
The test had been "temporarily" disabled for >2 years. The login page
which it simulates had also been changed and doesn't exhibit
the original issue. There isn't seem to be a point in keeping the test.
BUG=567262
Review URL: https://codereview.chromium.org/1509623002
Cr-Commit-Position: refs/heads/master@{#363674}
Diffstat (limited to 'android_webview/javatests/src/org/chromium')
-rw-r--r-- | android_webview/javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java | 105 |
1 files changed, 0 insertions, 105 deletions
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 b78bcf0..380fc68 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 { |