Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/widget/ToolbarProgressBarTest.java

Issue 1297073004: Fix various errorprone warnings and errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove third_party/mojo/src change. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.widget; 5 package org.chromium.chrome.browser.widget;
6 6
7 import static org.chromium.base.test.util.Restriction.RESTRICTION_TYPE_PHONE; 7 import static org.chromium.base.test.util.Restriction.RESTRICTION_TYPE_PHONE;
8 8
9 import android.animation.Animator; 9 import android.animation.Animator;
10 import android.animation.Animator.AnimatorListener; 10 import android.animation.Animator.AnimatorListener;
(...skipping 26 matching lines...) Expand all
37 37
38 /** 38 /**
39 * Test that calling progressBar.setProgress(# > 0) followed by progressBar. setProgress(0) 39 * Test that calling progressBar.setProgress(# > 0) followed by progressBar. setProgress(0)
40 * results in a hidden progress bar. 40 * results in a hidden progress bar.
41 * @throws InterruptedException 41 * @throws InterruptedException
42 */ 42 */
43 @Feature({"Android-Toolbar"}) 43 @Feature({"Android-Toolbar"})
44 @MediumTest 44 @MediumTest
45 @Restriction(RESTRICTION_TYPE_PHONE) 45 @Restriction(RESTRICTION_TYPE_PHONE)
46 @SuppressFBWarnings({"WA_NOT_IN_LOOP", "UW_UNCOND_WAIT"}) 46 @SuppressFBWarnings({"WA_NOT_IN_LOOP", "UW_UNCOND_WAIT"})
47 @SuppressWarnings("WaitNotInLoop")
nyquist 2015/08/19 09:51:33 This seems dubious to me. Given the possible spuri
mikecase (-- gone --) 2015/08/19 23:15:08 Done
47 public void testProgressBarDisappearsAfterFastShowHide() throws InterruptedE xception { 48 public void testProgressBarDisappearsAfterFastShowHide() throws InterruptedE xception {
48 // onAnimationEnd will be signaled on progress bar showing/hiding animat ion end. 49 // onAnimationEnd will be signaled on progress bar showing/hiding animat ion end.
49 final Object onAnimationEnd = new Object(); 50 final Object onAnimationEnd = new Object();
50 final AtomicReference<ToolbarProgressBar> progressBar = 51 final AtomicReference<ToolbarProgressBar> progressBar =
51 new AtomicReference<ToolbarProgressBar>(); 52 new AtomicReference<ToolbarProgressBar>();
52 ThreadUtils.runOnUiThreadBlocking(new Runnable() { 53 ThreadUtils.runOnUiThreadBlocking(new Runnable() {
53 @Override 54 @Override
54 public void run() { 55 public void run() {
55 progressBar.set((ToolbarProgressBar) getActivity().findViewById( R.id.progress)); 56 progressBar.set((ToolbarProgressBar) getActivity().findViewById( R.id.progress));
56 progressBar.get().setAlphaAnimationDuration(10); 57 progressBar.get().setAlphaAnimationDuration(10);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 progressBar.get().finish(true); 105 progressBar.get().finish(true);
105 } 106 }
106 }); 107 });
107 108
108 onAnimationEnd.wait(); 109 onAnimationEnd.wait();
109 assertEquals(0.0f, progressBar.get().getAlpha()); 110 assertEquals(0.0f, progressBar.get().getAlpha());
110 assertNotSame(View.VISIBLE, progressBar.get().getVisibility()); 111 assertNotSame(View.VISIBLE, progressBar.get().getVisibility());
111 } 112 }
112 } 113 }
113 } 114 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698