OneEditTextActivitySelectedTests.java revision da996f390e17e16f2dfa60e972e7ebc4f868f37e
1/* 2 * Copyright (C) 2007 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package com.android.imftest.samples; 18 19import com.android.imftest.R; 20 21import android.test.suitebuilder.annotation.LargeTest; 22import android.view.KeyEvent; 23import android.view.View; 24 25 26public class OneEditTextActivitySelectedTests extends ImfBaseTestCase<OneEditTextActivitySelected> { 27 28 public final String TAG = "OneEditTextActivitySelectedTests"; 29 30 public OneEditTextActivitySelectedTests() { 31 super(OneEditTextActivitySelected.class); 32 } 33 34 @LargeTest 35 public void testSoftKeyboardAutoPop() { 36 37 // Give the IME 2 seconds to appear. 38 pause(2000); 39 40 assertTrue(mImm.isAcceptingText()); 41 42 View rootView = ((OneEditTextActivitySelected) mTargetActivity).getRootView(); 43 View servedView = ((OneEditTextActivitySelected) mTargetActivity).getDefaultFocusedView(); 44 45 assertNotNull(rootView); 46 assertNotNull(servedView); 47 48 destructiveCheckImeInitialState(rootView, servedView); 49 50 verifyEditTextAdjustment(servedView, rootView.getMeasuredHeight()); 51 } 52 53} 54