Commit 04d941be authored by Min Qin's avatar Min Qin Committed by Chromium LUCI CQ

Fix another duplicate download infobar test

BUG=1155641

Change-Id: Id480d3e10659afa4fd52e89f5ffb9557e4820dd3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2575327Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
Commit-Queue: Min Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836961}
parent c1768757
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
package org.chromium.chrome.browser.download; package org.chromium.chrome.browser.download;
import android.os.Build;
import android.os.Environment; import android.os.Environment;
import android.support.test.InstrumentationRegistry; import android.support.test.InstrumentationRegistry;
import android.util.Pair; import android.util.Pair;
...@@ -239,7 +240,6 @@ import java.util.List; ...@@ -239,7 +240,6 @@ import java.util.List;
@Test @Test
@MediumTest @MediumTest
@DisabledTest(message = "crbug.com/849876")
@Feature({"Downloads"}) @Feature({"Downloads"})
public void testDuplicateHttpPostDownload_Download() throws Exception { public void testDuplicateHttpPostDownload_Download() throws Exception {
// Snackbar overlaps the infobar which is clicked in this test. // Snackbar overlaps the infobar which is clicked in this test.
...@@ -259,16 +259,19 @@ import java.util.List; ...@@ -259,16 +259,19 @@ import java.util.List;
currentView = mDownloadTestRule.getActivity().getActivityTab().getView(); currentView = mDownloadTestRule.getActivity().getActivityTab().getView();
callCount = mDownloadTestRule.getChromeDownloadCallCount(); callCount = mDownloadTestRule.getChromeDownloadCallCount();
TouchCommon.singleClickView(currentView); TouchCommon.singleClickView(currentView);
assertPollForInfoBarSize(1); waitForDuplicateInfobar();
Assert.assertTrue("Download button wasn't found", Assert.assertTrue("Download button wasn't found",
InfoBarUtil.clickPrimaryButton(mDownloadTestRule.getInfoBars().get(0))); InfoBarUtil.clickPrimaryButton(findDuplicateDownloadInfoBar()));
Assert.assertTrue("Failed to finish downloading file for the second time.", Assert.assertTrue("Failed to finish downloading file for the second time.",
mDownloadTestRule.waitForChromeDownloadToFinish(callCount)); mDownloadTestRule.waitForChromeDownloadToFinish(callCount));
Assert.assertTrue("Missing first download", if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
mDownloadTestRule.hasDownload(FILENAME_TEXT, SUPERBO_CONTENTS)); Assert.assertTrue("Missing first download",
Assert.assertTrue("Missing second download", mDownloadTestRule.hasDownload(FILENAME_TEXT, SUPERBO_CONTENTS));
mDownloadTestRule.hasDownload(FILENAME_TEXT_1, SUPERBO_CONTENTS)); Assert.assertTrue("Missing second download",
mDownloadTestRule.hasDownload(FILENAME_TEXT_1, SUPERBO_CONTENTS));
}
} }
@Test @Test
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment