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; | |
9 import android.test.suitebuilder.annotation.MediumTest; | 8 import android.test.suitebuilder.annotation.MediumTest; |
10 import android.view.View; | 9 import android.view.View; |
11 | 10 |
12 import org.chromium.base.Log; | 11 import org.chromium.base.Log; |
13 import org.chromium.base.test.util.CommandLineFlags; | 12 import org.chromium.base.test.util.CommandLineFlags; |
14 import org.chromium.base.test.util.DisabledTest; | 13 import org.chromium.base.test.util.DisabledTest; |
15 import org.chromium.base.test.util.Feature; | 14 import org.chromium.base.test.util.Feature; |
15 import org.chromium.base.test.util.FlakyTest; | |
16 import org.chromium.chrome.R; | 16 import org.chromium.chrome.R; |
17 import org.chromium.chrome.browser.ChromeSwitches; | 17 import org.chromium.chrome.browser.ChromeSwitches; |
18 import org.chromium.chrome.browser.compositor.CompositorViewHolder; | 18 import org.chromium.chrome.browser.compositor.CompositorViewHolder; |
19 import org.chromium.chrome.browser.compositor.layouts.LayoutManager; | 19 import org.chromium.chrome.browser.compositor.layouts.LayoutManager; |
20 import org.chromium.chrome.browser.compositor.layouts.StaticLayout; | 20 import org.chromium.chrome.browser.compositor.layouts.StaticLayout; |
21 import org.chromium.chrome.browser.infobar.InfoBarContainer; | 21 import org.chromium.chrome.browser.infobar.InfoBarContainer; |
22 import org.chromium.chrome.browser.tabmodel.TabModel; | 22 import org.chromium.chrome.browser.tabmodel.TabModel; |
23 import org.chromium.chrome.browser.tabmodel.TabModelUtils; | 23 import org.chromium.chrome.browser.tabmodel.TabModelUtils; |
24 import org.chromium.chrome.test.util.InfoBarUtil; | 24 import org.chromium.chrome.test.util.InfoBarUtil; |
25 import org.chromium.content.browser.test.util.Criteria; | 25 import org.chromium.content.browser.test.util.Criteria; |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
196 assertTrue("Missing first download", hasDownload("superbo.txt", SUPERBO_ CONTENTS)); | 196 assertTrue("Missing first download", hasDownload("superbo.txt", SUPERBO_ CONTENTS)); |
197 assertTrue("Missing second download", | 197 assertTrue("Missing second download", |
198 hasDownload("superbo (1).txt", SUPERBO_CONTENTS)); | 198 hasDownload("superbo (1).txt", SUPERBO_CONTENTS)); |
199 } | 199 } |
200 | 200 |
201 /* | 201 /* |
202 Bug http://crbug/415711 | 202 Bug http://crbug/415711 |
203 */ | 203 */ |
204 @MediumTest | 204 @MediumTest |
205 @Feature({"Downloads"}) | 205 @Feature({"Downloads"}) |
206 @FlakyTest | 206 @FlakyTest |
mikecase (-- gone --)
2016/04/19 19:07:08
Change @FlakyTest to...
@FlakyTest(message = "crb
| |
207 public void testDuplicateHttpPostDownload_Dismiss() throws Exception { | 207 public void testDuplicateHttpPostDownload_Dismiss() throws Exception { |
208 // Download a file. | 208 // Download a file. |
209 loadUrl(mTestServer.getURL("/chrome/test/data/android/download/post.html ")); | 209 loadUrl(mTestServer.getURL("/chrome/test/data/android/download/post.html ")); |
210 waitForFocus(); | 210 waitForFocus(); |
211 View currentView = getActivity().getActivityTab().getView(); | 211 View currentView = getActivity().getActivityTab().getView(); |
212 int callCount = getChromeDownloadCallCount(); | 212 int callCount = getChromeDownloadCallCount(); |
213 singleClickView(currentView); | 213 singleClickView(currentView); |
214 assertTrue("Failed to finish downloading file for the first time.", | 214 assertTrue("Failed to finish downloading file for the first time.", |
215 waitForChromeDownloadToFinish(callCount)); | 215 waitForChromeDownloadToFinish(callCount)); |
216 | 216 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
402 CriteriaHelper.pollUiThread(new Criteria() { | 402 CriteriaHelper.pollUiThread(new Criteria() { |
403 @Override | 403 @Override |
404 public boolean isSatisfied() { | 404 public boolean isSatisfied() { |
405 updateFailureReason("There should be " + size + " infobar but th ere are " | 405 updateFailureReason("There should be " + size + " infobar but th ere are " |
406 + getInfoBars().size() + " infobars."); | 406 + getInfoBars().size() + " infobars."); |
407 return getInfoBars().size() == size && !container.isAnimating(); | 407 return getInfoBars().size() == size && !container.isAnimating(); |
408 } | 408 } |
409 }); | 409 }); |
410 } | 410 } |
411 } | 411 } |
OLD | NEW |