From fa1ee70280d221edda6efdee535e3f4164663f9b Mon Sep 17 00:00:00 2001 From: mnaganov Date: Mon, 7 Dec 2015 17:18:01 -0800 Subject: [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} --- .../test/NavigationHistoryTest.java | 105 --------------------- 1 file changed, 105 deletions(-) (limited to 'android_webview/javatests/src/org/chromium') 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 = - "" - + " " - + " " + LOGIN_PAGE_TITLE + "" - + " " - + " " - + " " - + "
" - + " " - + " " - + "
" - + " " - + ""; - return mWebServer.setResponse(LOGIN_PAGE_PATH, - loginPageHtml, - CommonResources.getTextHtmlHeaders(true)); - } - - private String addNoncacheableLoginResponsePageToServer(TestWebServer webServer) { - final String loginResponsePageHtml = - "" - + " " - + " " + LOGIN_RESPONSE_PAGE_TITLE + "" - + " " - + " " - + " Login incorrect" - + "
Help
'" - + " " - + ""; - 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() { - @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() { - @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() { - @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 { -- cgit v1.1