| Index: chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadTest.java
|
| diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadTest.java
|
| index 15496a076e6554f04497629239f384002d70b207..8c16fb543ac1b71c49c74391ee8f94fb8ef45c94 100644
|
| --- a/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadTest.java
|
| +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadTest.java
|
| @@ -93,6 +93,35 @@ public class DownloadTest extends DownloadTestBase {
|
|
|
| @MediumTest
|
| @Feature({"Downloads"})
|
| + public void testDangerousDownloadCancel() throws Exception {
|
| + loadUrl(mTestServer.getURL("/chrome/test/data/android/download/dangerous.html"));
|
| + waitForFocus();
|
| + View currentView = getActivity().getActivityTab().getView();
|
| + TouchCommon.longPressView(currentView);
|
| +
|
| + // Open in new tab so that the "CloseBlankTab" functionality is invoked later.
|
| + getInstrumentation().invokeContextMenuAction(getActivity(),
|
| + R.id.contextmenu_open_in_new_tab, 0);
|
| +
|
| + waitForNewTabToStabilize(2);
|
| + goToLastTab();
|
| + assertPollForInfoBarSize(1);
|
| +
|
| + assertTrue("Cancel button wasn't found",
|
| + InfoBarUtil.clickSecondaryButton(getInfoBars().get(0)));
|
| +
|
| + // "Cancel" should close the blank tab opened for this download.
|
| + CriteriaHelper.pollUiThread(
|
| + Criteria.equals(1, new Callable<Integer>() {
|
| + @Override
|
| + public Integer call() {
|
| + return getActivity().getCurrentTabModel().getCount();
|
| + }
|
| + }));
|
| + }
|
| +
|
| + @MediumTest
|
| + @Feature({"Downloads"})
|
| public void testHttpPostDownload() throws Exception {
|
| loadUrl(mTestServer.getURL("/chrome/test/data/android/download/post.html"));
|
| waitForFocus();
|
|
|