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

Side by Side Diff: content/public/android/javatests/src/org/chromium/content/browser/PopupZoomerTest.java

Issue 2407303005: Let embedder provide select action mode (Closed)
Patch Set: more comments addressed Created 4 years, 1 month 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 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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698