| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 MotionEvent.obtain(downEvent, downEvent, MotionEvent.ACTION_DOWN
, x, y, 0)); | 73 MotionEvent.obtain(downEvent, downEvent, MotionEvent.ACTION_DOWN
, x, y, 0)); |
| 74 view.onTouchEvent( | 74 view.onTouchEvent( |
| 75 MotionEvent.obtain(downEvent, downEvent + 10, MotionEvent.ACTION
_UP, x, y, 0)); | 75 MotionEvent.obtain(downEvent, downEvent + 10, MotionEvent.ACTION
_UP, x, y, 0)); |
| 76 } | 76 } |
| 77 | 77 |
| 78 @Override | 78 @Override |
| 79 public void setUp() throws Exception { | 79 public void setUp() throws Exception { |
| 80 super.setUp(); | 80 super.setUp(); |
| 81 mPopupZoomer = createPopupZoomerForTest(getInstrumentation().getTargetCo
ntext()); | 81 mPopupZoomer = createPopupZoomerForTest(getInstrumentation().getTargetCo
ntext()); |
| 82 mContentViewCore = new ContentViewCore(getActivity(), ""); | 82 mContentViewCore = new ContentViewCore(getActivity(), ""); |
| 83 mContentViewCore.setActionModeForTesting( |
| 84 new WebActionMode(getActivity(), null, null, null, |
| 85 mContentViewCore.getRenderCoordinates(), WebActionMode.E
MPTY_CALLBACK)); |
| 83 mContentViewCore.setPopupZoomerForTest(mPopupZoomer); | 86 mContentViewCore.setPopupZoomerForTest(mPopupZoomer); |
| 84 mContentViewCore.setImeAdapterForTest( | 87 mContentViewCore.setImeAdapterForTest( |
| 85 new ImeAdapter(new TestInputMethodManagerWrapper(mContentViewCor
e), | 88 new ImeAdapter(new TestInputMethodManagerWrapper(mContentViewCor
e), |
| 86 new TestImeAdapterDelegate(getContentViewCore().getConta
inerView()))); | 89 new TestImeAdapterDelegate(getContentViewCore().getConta
inerView()))); |
| 87 } | 90 } |
| 88 | 91 |
| 89 @SmallTest | 92 @SmallTest |
| 90 @Feature({"Navigation"}) | 93 @Feature({"Navigation"}) |
| 91 public void testDefaultCreateState() throws Exception { | 94 public void testDefaultCreateState() throws Exception { |
| 92 assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); | 95 assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 mContentViewCore.onFocusChanged(false); | 204 mContentViewCore.onFocusChanged(false); |
| 202 | 205 |
| 203 // Wait for the hide animation to finish. | 206 // Wait for the hide animation to finish. |
| 204 mPopupZoomer.finishPendingDraws(); | 207 mPopupZoomer.finishPendingDraws(); |
| 205 | 208 |
| 206 // 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. |
| 207 assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); | 210 assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); |
| 208 assertFalse(mPopupZoomer.isShowing()); | 211 assertFalse(mPopupZoomer.isShowing()); |
| 209 } | 212 } |
| 210 } | 213 } |
| OLD | NEW |