| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 ThreadUtils.runOnUiThreadBlocking(new Runnable() { | 94 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
| 95 @Override | 95 @Override |
| 96 public void run() { | 96 public void run() { |
| 97 Context context = mActivityTestRule.getActivity(); | 97 Context context = mActivityTestRule.getActivity(); |
| 98 WebContents webContents = mActivityTestRule.getContentViewCore()
.getWebContents(); | 98 WebContents webContents = mActivityTestRule.getContentViewCore()
.getWebContents(); |
| 99 mContentViewCore = new ContentViewCore(context, ""); | 99 mContentViewCore = new ContentViewCore(context, ""); |
| 100 mContentViewCore.setSelectionPopupControllerForTesting(new Selec
tionPopupController( | 100 mContentViewCore.setSelectionPopupControllerForTesting(new Selec
tionPopupController( |
| 101 context, null, webContents, null, mContentViewCore.getRe
nderCoordinates())); | 101 context, null, webContents, null, mContentViewCore.getRe
nderCoordinates())); |
| 102 mContentViewCore.setImeAdapterForTest(new ImeAdapter(webContents
, | 102 mContentViewCore.setImeAdapterForTest(new ImeAdapter(webContents
, |
| 103 mActivityTestRule.getContentViewCore().getContainerView(
), | 103 mActivityTestRule.getContentViewCore().getContainerView(
), |
| 104 new TestInputMethodManagerWrapper(mContentViewCore))); | 104 new TestInputMethodManagerWrapper(mContentViewCore), |
| 105 mContentViewCore.getRenderCoordinates())); |
| 105 mPopupZoomer = createPopupZoomerForTest(InstrumentationRegistry.
getTargetContext()); | 106 mPopupZoomer = createPopupZoomerForTest(InstrumentationRegistry.
getTargetContext()); |
| 106 mContentViewCore.setPopupZoomerForTest(mPopupZoomer); | 107 mContentViewCore.setPopupZoomerForTest(mPopupZoomer); |
| 107 } | 108 } |
| 108 }); | 109 }); |
| 109 } | 110 } |
| 110 | 111 |
| 111 @Test | 112 @Test |
| 112 @SmallTest | 113 @SmallTest |
| 113 @Feature({"Navigation"}) | 114 @Feature({"Navigation"}) |
| 114 public void testDefaultCreateState() throws Exception { | 115 public void testDefaultCreateState() throws Exception { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 mContentViewCore.onFocusChanged(false, true); | 231 mContentViewCore.onFocusChanged(false, true); |
| 231 | 232 |
| 232 // Wait for the hide animation to finish. | 233 // Wait for the hide animation to finish. |
| 233 mPopupZoomer.finishPendingDraws(); | 234 mPopupZoomer.finishPendingDraws(); |
| 234 | 235 |
| 235 // Now that another view has been focused, the view should be invisible. | 236 // Now that another view has been focused, the view should be invisible. |
| 236 Assert.assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); | 237 Assert.assertEquals(View.INVISIBLE, mPopupZoomer.getVisibility()); |
| 237 Assert.assertFalse(mPopupZoomer.isShowing()); | 238 Assert.assertFalse(mPopupZoomer.isShowing()); |
| 238 } | 239 } |
| 239 } | 240 } |
| OLD | NEW |