| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.download; | 5 package org.chromium.chrome.browser.download; |
| 6 | 6 |
| 7 import android.os.Environment; | 7 import android.os.Environment; |
| 8 import android.test.FlakyTest; |
| 8 import android.test.suitebuilder.annotation.MediumTest; | 9 import android.test.suitebuilder.annotation.MediumTest; |
| 9 import android.view.View; | 10 import android.view.View; |
| 10 | 11 |
| 11 import org.chromium.base.Log; | 12 import org.chromium.base.Log; |
| 12 import org.chromium.base.test.util.CommandLineFlags; | 13 import org.chromium.base.test.util.CommandLineFlags; |
| 13 import org.chromium.base.test.util.DisabledTest; | 14 import org.chromium.base.test.util.DisabledTest; |
| 14 import org.chromium.base.test.util.Feature; | 15 import org.chromium.base.test.util.Feature; |
| 15 import org.chromium.chrome.R; | 16 import org.chromium.chrome.R; |
| 16 import org.chromium.chrome.browser.ChromeSwitches; | 17 import org.chromium.chrome.browser.ChromeSwitches; |
| 17 import org.chromium.chrome.browser.compositor.CompositorViewHolder; | 18 import org.chromium.chrome.browser.compositor.CompositorViewHolder; |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 assertTrue("Missing first download", hasDownload("superbo.txt", SUPERBO_
CONTENTS)); | 196 assertTrue("Missing first download", hasDownload("superbo.txt", SUPERBO_
CONTENTS)); |
| 196 assertTrue("Missing second download", | 197 assertTrue("Missing second download", |
| 197 hasDownload("superbo (1).txt", SUPERBO_CONTENTS)); | 198 hasDownload("superbo (1).txt", SUPERBO_CONTENTS)); |
| 198 } | 199 } |
| 199 | 200 |
| 200 /* | 201 /* |
| 201 Bug http://crbug/415711 | 202 Bug http://crbug/415711 |
| 202 */ | 203 */ |
| 203 @MediumTest | 204 @MediumTest |
| 204 @Feature({"Downloads"}) | 205 @Feature({"Downloads"}) |
| 206 @FlakyTest |
| 205 public void testDuplicateHttpPostDownload_Dismiss() throws Exception { | 207 public void testDuplicateHttpPostDownload_Dismiss() throws Exception { |
| 206 // Download a file. | 208 // Download a file. |
| 207 loadUrl(mTestServer.getURL("/chrome/test/data/android/download/post.html
")); | 209 loadUrl(mTestServer.getURL("/chrome/test/data/android/download/post.html
")); |
| 208 waitForFocus(); | 210 waitForFocus(); |
| 209 View currentView = getActivity().getActivityTab().getView(); | 211 View currentView = getActivity().getActivityTab().getView(); |
| 210 int callCount = getChromeDownloadCallCount(); | 212 int callCount = getChromeDownloadCallCount(); |
| 211 singleClickView(currentView); | 213 singleClickView(currentView); |
| 212 assertTrue("Failed to finish downloading file for the first time.", | 214 assertTrue("Failed to finish downloading file for the first time.", |
| 213 waitForChromeDownloadToFinish(callCount)); | 215 waitForChromeDownloadToFinish(callCount)); |
| 214 | 216 |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 CriteriaHelper.pollUiThread(new Criteria() { | 402 CriteriaHelper.pollUiThread(new Criteria() { |
| 401 @Override | 403 @Override |
| 402 public boolean isSatisfied() { | 404 public boolean isSatisfied() { |
| 403 updateFailureReason("There should be " + size + " infobar but th
ere are " | 405 updateFailureReason("There should be " + size + " infobar but th
ere are " |
| 404 + getInfoBars().size() + " infobars."); | 406 + getInfoBars().size() + " infobars."); |
| 405 return getInfoBars().size() == size && !container.isAnimating(); | 407 return getInfoBars().size() == size && !container.isAnimating(); |
| 406 } | 408 } |
| 407 }); | 409 }); |
| 408 } | 410 } |
| 409 } | 411 } |
| OLD | NEW |