OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.graphics.Bitmap; | 8 import android.graphics.Bitmap; |
9 import android.graphics.Canvas; | 9 import android.graphics.Canvas; |
10 import android.graphics.Rect; | 10 import android.graphics.Rect; |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 mPopupZoomer.show(new Rect(0, 0, 5, 5)); | 194 mPopupZoomer.show(new Rect(0, 0, 5, 5)); |
195 | 195 |
196 // Wait for the animation to finish. | 196 // Wait for the animation to finish. |
197 mPopupZoomer.finishPendingDraws(); | 197 mPopupZoomer.finishPendingDraws(); |
198 | 198 |
199 // The view should be visible. | 199 // The view should be visible. |
200 assertEquals(View.VISIBLE, mPopupZoomer.getVisibility()); | 200 assertEquals(View.VISIBLE, mPopupZoomer.getVisibility()); |
201 assertTrue(mPopupZoomer.isShowing()); | 201 assertTrue(mPopupZoomer.isShowing()); |
202 | 202 |
203 // Simulate losing the focus. | 203 // Simulate losing the focus. |
204 mContentViewCore.onFocusChanged(false); | 204 mContentViewCore.onFocusChanged(false, true); |
205 | 205 |
206 // Wait for the hide animation to finish. | 206 // Wait for the hide animation to finish. |
207 mPopupZoomer.finishPendingDraws(); | 207 mPopupZoomer.finishPendingDraws(); |
208 | 208 |
209 // Now that another view has been focused, the view should be invisible. | 209 // Now that another view has been focused, the view should be invisible. |
210 assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); | 210 assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); |
211 assertFalse(mPopupZoomer.isShowing()); | 211 assertFalse(mPopupZoomer.isShowing()); |
212 } | 212 } |
213 } | 213 } |
OLD | NEW |