summaryrefslogtreecommitdiffstats
path: root/tests/ImfTest
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-02-13 12:57:50 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-02-13 12:57:50 -0800
commitda996f390e17e16f2dfa60e972e7ebc4f868f37e (patch)
tree00a0f15270d4c7b619fd34d8383257e1761082f4 /tests/ImfTest
parentd24b8183b93e781080b2c16c487e60d51c12da31 (diff)
downloadframeworks_base-da996f390e17e16f2dfa60e972e7ebc4f868f37e.zip
frameworks_base-da996f390e17e16f2dfa60e972e7ebc4f868f37e.tar.gz
frameworks_base-da996f390e17e16f2dfa60e972e7ebc4f868f37e.tar.bz2
auto import from //branches/cupcake/...@131421
Diffstat (limited to 'tests/ImfTest')
-rwxr-xr-xtests/ImfTest/AndroidManifest.xml18
-rw-r--r--tests/ImfTest/res/values/config.xml21
-rw-r--r--tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextNonScrollablePanScan.java35
-rw-r--r--tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextNonScrollableResize.java35
-rw-r--r--tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityNonScrollablePanScan.java49
-rw-r--r--tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityNonScrollableResize.java49
-rw-r--r--tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityScrollablePanScan.java (renamed from tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextScrollablePanScan.java)31
-rw-r--r--tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityScrollableResize.java (renamed from tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextScrollableResize.java)31
-rw-r--r--tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityPanScan.java25
-rw-r--r--tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityResize.java25
-rw-r--r--tests/ImfTest/src/com/android/imftest/samples/ButtonActivity.java12
-rw-r--r--tests/ImfTest/src/com/android/imftest/samples/EditTextActivityDialog.java (renamed from tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentEditTextDialog.java)10
-rw-r--r--tests/ImfTest/src/com/android/imftest/samples/EditTextActivityNoScrollPanScan.java38
-rw-r--r--tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScan.java43
-rw-r--r--tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScan.java51
-rw-r--r--tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollResize.java24
-rw-r--r--tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivityNotSelected.java48
-rw-r--r--tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivitySelected.java40
-rwxr-xr-xtests/ImfTest/tests/Android.mk16
-rwxr-xr-xtests/ImfTest/tests/AndroidManifest.xml34
-rwxr-xr-xtests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityNonScrollablePanScanTests.java49
-rwxr-xr-xtests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityNonScrollableResizeTests.java48
-rwxr-xr-xtests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityScrollablePanScanTests.java48
-rwxr-xr-xtests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityScrollableResizeTests.java49
-rwxr-xr-xtests/ImfTest/tests/src/com/android/imftest/samples/BottomEditTextActivityPanScanTests.java49
-rwxr-xr-xtests/ImfTest/tests/src/com/android/imftest/samples/BottomEditTextActivityResizeTests.java49
-rwxr-xr-xtests/ImfTest/tests/src/com/android/imftest/samples/ButtonActivityTest.java58
-rwxr-xr-xtests/ImfTest/tests/src/com/android/imftest/samples/ImfBaseTestCase.java135
-rwxr-xr-xtests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityBaseTestCase.java40
-rwxr-xr-xtests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScanTests.java36
-rwxr-xr-xtests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScanTests.java37
-rwxr-xr-xtests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityScrollResizeTests.java37
-rwxr-xr-xtests/ImfTest/tests/src/com/android/imftest/samples/OneEditTextActivityNotSelectedTests.java50
-rwxr-xr-xtests/ImfTest/tests/src/com/android/imftest/samples/OneEditTextActivitySelectedTests.java53
34 files changed, 1136 insertions, 237 deletions
diff --git a/tests/ImfTest/AndroidManifest.xml b/tests/ImfTest/AndroidManifest.xml
index 627ee6d..55e5d38 100755
--- a/tests/ImfTest/AndroidManifest.xml
+++ b/tests/ImfTest/AndroidManifest.xml
@@ -19,7 +19,7 @@
</intent-filter>
</activity>
- <activity android:name=".samples.AppAdjustmentBigEditTextNonScrollablePanScan" android:label="Big ET !Scroll Pan/Scan">
+ <activity android:name=".samples.BigEditTextActivityNonScrollablePanScan" android:label="Big ET !Scroll Pan/Scan">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER" />
@@ -35,7 +35,7 @@
</intent-filter>
</activity>
- <activity android:name=".samples.AppAdjustmentBigEditTextNonScrollableResize" android:label="Big ET !Scroll Resize">
+ <activity android:name=".samples.BigEditTextActivityNonScrollableResize" android:label="Big ET !Scroll Resize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER" />
@@ -43,7 +43,7 @@
</intent-filter>
</activity>
- <activity android:name=".samples.AppAdjustmentBigEditTextScrollablePanScan" android:label="Big ET Scroll Pan/Scan">
+ <activity android:name=".samples.BigEditTextActivityScrollablePanScan" android:label="Big ET Scroll Pan/Scan">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER" />
@@ -51,7 +51,7 @@
</intent-filter>
</activity>
- <activity android:name=".samples.AppAdjustmentBigEditTextScrollableResize" android:label="Big ET Scroll Resize">
+ <activity android:name=".samples.BigEditTextActivityScrollableResize" android:label="Big ET Scroll Resize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER" />
@@ -59,7 +59,7 @@
</intent-filter>
</activity>
- <activity android:name=".samples.AppAdjustmentEditTextDialog" android:label="ET Dialog">
+ <activity android:name=".samples.EditTextActivityDialog" android:label="ET Dialog">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER" />
@@ -130,14 +130,6 @@
<category android:name="android.intent.category.IMF_TEST" />
</intent-filter>
</activity>
-
- <activity android:name=".samples.OneEditTextActivityLandscape" android:label="OneEditTextActivityLandscape" android:screenOrientation="landscape">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER" />
- <category android:name="android.intent.category.IMF_TEST" />
- </intent-filter>
- </activity>
<activity android:name=".samples.DialogActivity" android:label="DialogActivity" android:screenOrientation="portrait">
<intent-filter>
diff --git a/tests/ImfTest/res/values/config.xml b/tests/ImfTest/res/values/config.xml
new file mode 100644
index 0000000..5ae40a3
--- /dev/null
+++ b/tests/ImfTest/res/values/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/**
+ * Copyright (c) 2009, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<resources>
+ <bool name="def_expect_ime_autopop">false</bool>
+</resources>
diff --git a/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextNonScrollablePanScan.java b/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextNonScrollablePanScan.java
deleted file mode 100644
index 15a29c8..0000000
--- a/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextNonScrollablePanScan.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.android.imftest.samples;
-
-import com.android.imftest.R;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.view.ViewGroup;
-import android.view.WindowManager;
-import android.widget.EditText;
-import android.widget.LinearLayout;
-
-public class AppAdjustmentBigEditTextNonScrollablePanScan extends Activity {
-
- private LinearLayout mLayout;
-
- @Override
- protected void onCreate(Bundle icicle) {
- super.onCreate(icicle);
-
- getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
-
- mLayout = new LinearLayout(this);
- mLayout.setOrientation(LinearLayout.VERTICAL);
- mLayout.setLayoutParams(new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
- ViewGroup.LayoutParams.FILL_PARENT));
-
- EditText editText = (EditText) getLayoutInflater().inflate(R.layout.full_screen_edit_text, mLayout, false);
-
- mLayout.addView(editText);
-
- setContentView(mLayout);
- }
-
-}
diff --git a/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextNonScrollableResize.java b/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextNonScrollableResize.java
deleted file mode 100644
index 0726823..0000000
--- a/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextNonScrollableResize.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.android.imftest.samples;
-
-import com.android.imftest.R;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.view.ViewGroup;
-import android.view.WindowManager;
-import android.widget.EditText;
-import android.widget.LinearLayout;
-
-public class AppAdjustmentBigEditTextNonScrollableResize extends Activity {
-
- private LinearLayout mLayout;
-
- @Override
- protected void onCreate(Bundle icicle) {
- super.onCreate(icicle);
-
- getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
-
- mLayout = new LinearLayout(this);
- mLayout.setOrientation(LinearLayout.VERTICAL);
- mLayout.setLayoutParams(new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
- ViewGroup.LayoutParams.FILL_PARENT));
-
- EditText editText = (EditText) getLayoutInflater().inflate(R.layout.full_screen_edit_text, mLayout, false);
-
- mLayout.addView(editText);
-
- setContentView(mLayout);
- }
-
-}
diff --git a/tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityNonScrollablePanScan.java b/tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityNonScrollablePanScan.java
new file mode 100644
index 0000000..9754381
--- /dev/null
+++ b/tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityNonScrollablePanScan.java
@@ -0,0 +1,49 @@
+package com.android.imftest.samples;
+
+import com.android.imftest.R;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.widget.EditText;
+import android.widget.LinearLayout;
+import android.widget.ScrollView;
+
+public class BigEditTextActivityNonScrollablePanScan extends Activity {
+
+ private View mRootView;
+ private View mDefaultFocusedView;
+
+ @Override
+ protected void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+
+ getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
+
+ mRootView = new LinearLayout(this);
+ ((LinearLayout) mRootView).setOrientation(LinearLayout.VERTICAL);
+ mRootView.setLayoutParams(new ViewGroup.LayoutParams(
+ ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.FILL_PARENT));
+
+ View view = getLayoutInflater().inflate(
+ R.layout.full_screen_edit_text, ((LinearLayout) mRootView), false);
+
+ ((LinearLayout) mRootView).addView(view);
+
+ mDefaultFocusedView = view.findViewById(R.id.data);
+
+ setContentView(mRootView);
+ }
+
+ public View getRootView() {
+ return mRootView;
+ }
+
+ public View getDefaultFocusedView() {
+ return mDefaultFocusedView;
+ }
+
+}
diff --git a/tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityNonScrollableResize.java b/tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityNonScrollableResize.java
new file mode 100644
index 0000000..701795f
--- /dev/null
+++ b/tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityNonScrollableResize.java
@@ -0,0 +1,49 @@
+package com.android.imftest.samples;
+
+import com.android.imftest.R;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.widget.EditText;
+import android.widget.LinearLayout;
+import android.widget.ScrollView;
+
+public class BigEditTextActivityNonScrollableResize extends Activity {
+
+ private View mRootView;
+ private View mDefaultFocusedView;
+
+ @Override
+ protected void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+
+ getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
+
+ mRootView = new LinearLayout(this);
+ ((LinearLayout) mRootView).setOrientation(LinearLayout.VERTICAL);
+ mRootView.setLayoutParams(new ViewGroup.LayoutParams(
+ ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.FILL_PARENT));
+
+ View view = getLayoutInflater().inflate(
+ R.layout.full_screen_edit_text, ((LinearLayout) mRootView), false);
+
+ ((LinearLayout) mRootView).addView(view);
+
+ mDefaultFocusedView = view.findViewById(R.id.data);
+
+ setContentView(mRootView);
+ }
+
+ public View getRootView() {
+ return mRootView;
+ }
+
+ public View getDefaultFocusedView() {
+ return mDefaultFocusedView;
+ }
+
+}
diff --git a/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextScrollablePanScan.java b/tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityScrollablePanScan.java
index 50a980b..bb3f767 100644
--- a/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextScrollablePanScan.java
+++ b/tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityScrollablePanScan.java
@@ -4,15 +4,17 @@ import com.android.imftest.R;
import android.app.Activity;
import android.os.Bundle;
+import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ScrollView;
-public class AppAdjustmentBigEditTextScrollablePanScan extends Activity {
+public class BigEditTextActivityScrollablePanScan extends Activity {
- private ScrollView mScrollView;
+ private View mRootView;
+ private View mDefaultFocusedView;
private LinearLayout mLayout;
@Override
@@ -21,9 +23,9 @@ public class AppAdjustmentBigEditTextScrollablePanScan extends Activity {
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
- mScrollView = new ScrollView(this);
- mScrollView.setFillViewport(true);
- mScrollView.setLayoutParams(new ViewGroup.LayoutParams(
+ mRootView = new ScrollView(this);
+ ((ScrollView) mRootView).setFillViewport(true);
+ mRootView.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT));
@@ -33,12 +35,23 @@ public class AppAdjustmentBigEditTextScrollablePanScan extends Activity {
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT));
- EditText editText = (EditText) getLayoutInflater().inflate(R.layout.full_screen_edit_text, mScrollView, false);
+ View view = getLayoutInflater().inflate(
+ R.layout.full_screen_edit_text, ((ScrollView) mRootView), false);
- mLayout.addView(editText);
- mScrollView.addView(mLayout);
+ mLayout.addView(view);
- setContentView(mScrollView);
+ ((ScrollView) mRootView).addView(mLayout);
+ mDefaultFocusedView = view.findViewById(R.id.data);
+
+ setContentView(mRootView);
+ }
+
+ public View getRootView() {
+ return mRootView;
+ }
+
+ public View getDefaultFocusedView() {
+ return mDefaultFocusedView;
}
}
diff --git a/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextScrollableResize.java b/tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityScrollableResize.java
index a256878..f2cae1c 100644
--- a/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextScrollableResize.java
+++ b/tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityScrollableResize.java
@@ -4,15 +4,17 @@ import com.android.imftest.R;
import android.app.Activity;
import android.os.Bundle;
+import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ScrollView;
-public class AppAdjustmentBigEditTextScrollableResize extends Activity {
+public class BigEditTextActivityScrollableResize extends Activity {
- private ScrollView mScrollView;
+ private View mRootView;
+ private View mDefaultFocusedView;
private LinearLayout mLayout;
@Override
@@ -21,9 +23,9 @@ public class AppAdjustmentBigEditTextScrollableResize extends Activity {
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
- mScrollView = new ScrollView(this);
- mScrollView.setFillViewport(true);
- mScrollView.setLayoutParams(new ViewGroup.LayoutParams(
+ mRootView = new ScrollView(this);
+ ((ScrollView) mRootView).setFillViewport(true);
+ mRootView.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT));
@@ -33,12 +35,23 @@ public class AppAdjustmentBigEditTextScrollableResize extends Activity {
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT));
- EditText editText = (EditText) getLayoutInflater().inflate(R.layout.full_screen_edit_text, mScrollView, false);
+ View view = getLayoutInflater().inflate(
+ R.layout.full_screen_edit_text, ((ScrollView) mRootView), false);
- mLayout.addView(editText);
- mScrollView.addView(mLayout);
+ mLayout.addView(view);
- setContentView(mScrollView);
+ ((ScrollView) mRootView).addView(mLayout);
+ mDefaultFocusedView = view.findViewById(R.id.data);
+
+ setContentView(mRootView);
+ }
+
+ public View getRootView() {
+ return mRootView;
+ }
+
+ public View getDefaultFocusedView() {
+ return mDefaultFocusedView;
}
}
diff --git a/tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityPanScan.java b/tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityPanScan.java
index d74b9dd..51f5045 100644
--- a/tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityPanScan.java
+++ b/tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityPanScan.java
@@ -17,21 +17,30 @@ import com.android.imftest.R;
*/
public class BottomEditTextActivityPanScan extends Activity
{
- private LayoutInflater mInflater;
+ private View mRootView;
+ private View mDefaultFocusedView;
+
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
- LinearLayout layout = new LinearLayout(this);
- layout.setOrientation(LinearLayout.VERTICAL);
+ mRootView = new LinearLayout(this);
+ ((LinearLayout) mRootView).setOrientation(LinearLayout.VERTICAL);
- mInflater = getLayoutInflater();
-
- View view = mInflater.inflate(R.layout.one_edit_text_activity, layout, false);
- layout.addView(view);
+ View view = getLayoutInflater().inflate(R.layout.one_edit_text_activity, ((LinearLayout) mRootView), false);
+ mDefaultFocusedView = view.findViewById(R.id.dialog_edit_text);
+ ((LinearLayout) mRootView).addView(view);
- setContentView(layout);
+ setContentView(mRootView);
this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
}
+
+ public View getRootView() {
+ return mRootView;
+ }
+
+ public View getDefaultFocusedView() {
+ return mDefaultFocusedView;
+ }
} \ No newline at end of file
diff --git a/tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityResize.java b/tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityResize.java
index 82da29a..eb94b4f 100644
--- a/tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityResize.java
+++ b/tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityResize.java
@@ -17,21 +17,30 @@ import com.android.imftest.R;
*/
public class BottomEditTextActivityResize extends Activity
{
- private LayoutInflater mInflater;
+ private View mRootView;
+ private View mDefaultFocusedView;
+
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
- LinearLayout layout = new LinearLayout(this);
- layout.setOrientation(LinearLayout.VERTICAL);
+ mRootView = new LinearLayout(this);
+ ((LinearLayout) mRootView).setOrientation(LinearLayout.VERTICAL);
- mInflater = getLayoutInflater();
-
- View view = mInflater.inflate(R.layout.one_edit_text_activity, layout, false);
- layout.addView(view);
+ View view = getLayoutInflater().inflate(R.layout.one_edit_text_activity, ((LinearLayout) mRootView), false);
+ mDefaultFocusedView = view.findViewById(R.id.dialog_edit_text);
+ ((LinearLayout) mRootView).addView(view);
- setContentView(layout);
+ setContentView(mRootView);
this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
}
+
+ public View getRootView() {
+ return mRootView;
+ }
+
+ public View getDefaultFocusedView() {
+ return mDefaultFocusedView;
+ }
} \ No newline at end of file
diff --git a/tests/ImfTest/src/com/android/imftest/samples/ButtonActivity.java b/tests/ImfTest/src/com/android/imftest/samples/ButtonActivity.java
index 4233811..1191f19 100644
--- a/tests/ImfTest/src/com/android/imftest/samples/ButtonActivity.java
+++ b/tests/ImfTest/src/com/android/imftest/samples/ButtonActivity.java
@@ -13,6 +13,8 @@ import android.widget.TextView;
public class ButtonActivity extends Activity
{
static boolean mKeyboardIsActive = false;
+ public static final int BUTTON_ID = 0;
+ private View mRootView;
@Override
public void onCreate(Bundle savedInstanceState)
@@ -23,6 +25,8 @@ public class ButtonActivity extends Activity
final Button myButton = new Button(this);
myButton.setClickable(true);
myButton.setText("Keyboard UP!");
+ myButton.setId(BUTTON_ID);
+ myButton.setFocusableInTouchMode(true);
myButton.setOnClickListener(new View.OnClickListener()
{
public void onClick (View v)
@@ -36,7 +40,8 @@ public class ButtonActivity extends Activity
}
else
{
- imm.showSoftInput(null, 0);
+ myButton.requestFocusFromTouch();
+ imm.showSoftInput(v, 0);
myButton.setText("Keyboard DOWN!");
}
@@ -48,5 +53,10 @@ public class ButtonActivity extends Activity
layout.setOrientation(LinearLayout.VERTICAL);
layout.addView(myButton);
setContentView(layout);
+ mRootView = layout;
+ }
+
+ public View getRootView() {
+ return mRootView;
}
}
diff --git a/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentEditTextDialog.java b/tests/ImfTest/src/com/android/imftest/samples/EditTextActivityDialog.java
index e82f1d5..bd1e934 100644
--- a/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentEditTextDialog.java
+++ b/tests/ImfTest/src/com/android/imftest/samples/EditTextActivityDialog.java
@@ -14,7 +14,7 @@ import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ScrollView;
-public class AppAdjustmentEditTextDialog extends Activity {
+public class EditTextActivityDialog extends Activity {
private static final int SCROLLABLE_DIALOG_ID = 0;
private static final int NONSCROLLABLE_DIALOG_ID = 1;
@@ -75,18 +75,18 @@ public class AppAdjustmentEditTextDialog extends Activity {
EditText editText;
if (scrollable) {
- layout = new ScrollView(AppAdjustmentEditTextDialog.this);
+ layout = new ScrollView(EditTextActivityDialog.this);
((ScrollView) layout).setMinimumHeight(mLayout.getHeight());
((ScrollView) layout).addView((
- LinearLayout) View.inflate(AppAdjustmentEditTextDialog.this,
+ LinearLayout) View.inflate(EditTextActivityDialog.this,
R.layout.dialog_edit_text_no_scroll, null));
} else {
- layout = View.inflate(AppAdjustmentEditTextDialog.this,
+ layout = View.inflate(EditTextActivityDialog.this,
R.layout.dialog_edit_text_no_scroll, null);
}
- Dialog d = new Dialog(AppAdjustmentEditTextDialog.this);
+ Dialog d = new Dialog(EditTextActivityDialog.this);
d.setTitle(getString(R.string.test_dialog));
d.setCancelable(true);
d.setContentView(layout);
diff --git a/tests/ImfTest/src/com/android/imftest/samples/EditTextActivityNoScrollPanScan.java b/tests/ImfTest/src/com/android/imftest/samples/EditTextActivityNoScrollPanScan.java
deleted file mode 100644
index b596023..0000000
--- a/tests/ImfTest/src/com/android/imftest/samples/EditTextActivityNoScrollPanScan.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.android.imftest.samples;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.view.KeyEvent;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.WindowManager;
-import android.widget.LinearLayout;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.EditText;
-import android.widget.Button;
-import android.widget.TextView;
-import android.widget.ScrollView;
-
-import com.android.internal.R;
-
-public class EditTextActivityNoScrollPanScan extends Activity
-{
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
-
- LinearLayout layout = new LinearLayout(this);
- layout.setOrientation(LinearLayout.VERTICAL);
-
- String string = new String();
- for (int i=0; i<9; i++)
- {
- final EditText editText = new EditText(this);
- editText.setText(string.valueOf(i));
- layout.addView(editText);
- }
- setContentView(layout);
- this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
- }
-}
diff --git a/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScan.java b/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScan.java
index 4cb3af6..54ab57a 100644
--- a/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScan.java
+++ b/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScan.java
@@ -20,22 +20,31 @@ import com.android.internal.R;
*/
public class ManyEditTextActivityNoScrollPanScan extends Activity
{
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
-
- LinearLayout layout = new LinearLayout(this);
- layout.setOrientation(LinearLayout.VERTICAL);
-
- String string = new String();
- for (int i=0; i<9; i++)
- {
- final EditText editText = new EditText(this);
- editText.setText(string.valueOf(i));
- layout.addView(editText);
- }
- setContentView(layout);
- this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
+ public static final int NUM_EDIT_TEXTS = 9;
+
+ private View mRootView;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+
+ mRootView = new LinearLayout(this);
+ ((LinearLayout) mRootView).setOrientation(LinearLayout.VERTICAL);
+
+ for (int i=0; i<NUM_EDIT_TEXTS; i++)
+ {
+ final EditText editText = new EditText(this);
+ editText.setText(String.valueOf(i));
+ editText.setId(i);
+ ((LinearLayout) mRootView).addView(editText);
+ }
+ setContentView(mRootView);
+ this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
}
+
+ public View getRootView() {
+ return mRootView;
+ }
+
}
diff --git a/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScan.java b/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScan.java
index bd32828..b228d34 100644
--- a/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScan.java
+++ b/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScan.java
@@ -20,26 +20,33 @@ import com.android.internal.R;
*/
public class ManyEditTextActivityScrollPanScan extends Activity
{
- private ScrollView mScrollView;
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- mScrollView = new ScrollView(this);
-
- LinearLayout layout = new LinearLayout(this);
- layout.setOrientation(LinearLayout.VERTICAL);
-
- String string = new String();
- for (int i=0; i<12; i++)
- {
- final EditText editText = new EditText(this);
- editText.setText(string.valueOf(i));
- layout.addView(editText);
- }
-
- mScrollView.addView(layout);
- setContentView(mScrollView);
- this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
- }
+ public static final int NUM_EDIT_TEXTS = 12;
+
+ private View mRootView;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ mRootView = new ScrollView(this);
+
+ LinearLayout layout = new LinearLayout(this);
+ layout.setOrientation(LinearLayout.VERTICAL);
+
+ for (int i=0; i<NUM_EDIT_TEXTS; i++)
+ {
+ final EditText editText = new EditText(this);
+ editText.setText(String.valueOf(i));
+ editText.setId(i);
+ layout.addView(editText);
+ }
+
+ ((ScrollView) mRootView).addView(layout);
+ setContentView(mRootView);
+ this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
+ }
+
+ public View getRootView() {
+ return mRootView;
+ }
} \ No newline at end of file
diff --git a/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollResize.java b/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollResize.java
index eaaa98b..777fbae 100644
--- a/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollResize.java
+++ b/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollResize.java
@@ -2,6 +2,7 @@ package com.android.imftest.samples;
import android.app.Activity;
import android.os.Bundle;
+import android.view.View;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.EditText;
@@ -12,26 +13,33 @@ import android.widget.ScrollView;
*/
public class ManyEditTextActivityScrollResize extends Activity
{
- private ScrollView mScrollView;
+ public static final int NUM_EDIT_TEXTS = 12;
+
+ private View mRootView;
+
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
- mScrollView = new ScrollView(this);
+ mRootView = new ScrollView(this);
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
- String string = new String();
- for (int i=0; i<12; i++)
+ for (int i=0; i<NUM_EDIT_TEXTS; i++)
{
final EditText editText = new EditText(this);
- editText.setText(string.valueOf(i));
+ editText.setText(String.valueOf(i));
+ editText.setId(i);
layout.addView(editText);
}
- mScrollView.addView(layout);
- setContentView(mScrollView);
- this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
+ ((ScrollView) mRootView).addView(layout);
+ setContentView(mRootView);
+ this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
}
+
+ public View getRootView() {
+ return mRootView;
+ }
} \ No newline at end of file
diff --git a/tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivityNotSelected.java b/tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivityNotSelected.java
index 5fef884..88a3447 100644
--- a/tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivityNotSelected.java
+++ b/tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivityNotSelected.java
@@ -2,6 +2,7 @@ package com.android.imftest.samples;
import android.app.Activity;
import android.os.Bundle;
+import android.os.Debug;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
@@ -20,21 +21,36 @@ import com.android.internal.R;
*/
public class OneEditTextActivityNotSelected extends Activity
{
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
-
- LinearLayout layout = new LinearLayout(this);
- layout.setOrientation(LinearLayout.VERTICAL);
-
- final EditText editText = new EditText(this);
- final TextView textView = new TextView(this);
- textView.setText("The focus is here.");
- layout.addView(editText);
- layout.addView(textView);
-
- setContentView(layout);
- textView.requestFocus();
+ private View mRootView;
+ private View mDefaultFocusedView;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+
+ LinearLayout layout = new LinearLayout(this);
+ layout.setOrientation(LinearLayout.VERTICAL);
+ mRootView = new ScrollView(this);
+
+ EditText editText = new EditText(this);
+ Button button = new Button(this);
+ button.setText("The focus is here.");
+ button.setFocusableInTouchMode(true);
+ button.requestFocus();
+ mDefaultFocusedView = button;
+ layout.addView(button);
+ layout.addView(editText);
+
+ ((ScrollView) mRootView).addView(layout);
+ setContentView(mRootView);
}
+
+ public View getRootView() {
+ return mRootView;
+ }
+
+ public View getDefaultFocusedView() {
+ return mDefaultFocusedView;
+ }
}
diff --git a/tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivitySelected.java b/tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivitySelected.java
index 2fd19e8..1b80263 100644
--- a/tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivitySelected.java
+++ b/tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivitySelected.java
@@ -20,18 +20,32 @@ import com.android.internal.R;
*/
public class OneEditTextActivitySelected extends Activity
{
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
-
- LinearLayout layout = new LinearLayout(this);
- layout.setOrientation(LinearLayout.VERTICAL);
-
- final EditText editText = new EditText(this);
- layout.addView(editText);
-
- setContentView(layout);
- editText.requestFocus();
+ private View mRootView;
+ private View mDefaultFocusedView;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+
+ LinearLayout layout = new LinearLayout(this);
+ layout.setOrientation(LinearLayout.VERTICAL);
+ mRootView = new ScrollView(this);
+
+ EditText editText = new EditText(this);
+ editText.requestFocus();
+ mDefaultFocusedView = editText;
+ layout.addView(editText);
+
+ ((ScrollView) mRootView).addView(layout);
+ setContentView(mRootView);
}
+
+ public View getRootView() {
+ return mRootView;
+ }
+
+ public View getDefaultFocusedView() {
+ return mDefaultFocusedView;
+ }
}
diff --git a/tests/ImfTest/tests/Android.mk b/tests/ImfTest/tests/Android.mk
new file mode 100755
index 0000000..0f1924c
--- /dev/null
+++ b/tests/ImfTest/tests/Android.mk
@@ -0,0 +1,16 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+# We only want this apk build for tests.
+LOCAL_MODULE_TAGS := tests
+
+# Include all test java files.
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_JAVA_LIBRARIES := android.test.runner
+
+LOCAL_PACKAGE_NAME := ImfTestTests
+
+LOCAL_INSTRUMENTATION_FOR := ImfTest
+
+include $(BUILD_PACKAGE)
diff --git a/tests/ImfTest/tests/AndroidManifest.xml b/tests/ImfTest/tests/AndroidManifest.xml
new file mode 100755
index 0000000..122d202
--- /dev/null
+++ b/tests/ImfTest/tests/AndroidManifest.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.imftest.tests">
+
+ <application>
+ <uses-library android:name="android.test.runner" />
+ </application>
+
+ <!--
+ This declares that this app uses the instrumentation test runner targeting
+ the package of com.android.imftest. To run the tests use the command:
+ "adb shell am instrument -w com.android.imftest.tests/android.test.InstrumentationTestRunner"
+ -->
+ <instrumentation android:name="android.test.InstrumentationTestRunner"
+ android:targetPackage="com.android.imftest"
+ android:label="imf tests"/>
+
+</manifest>
diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityNonScrollablePanScanTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityNonScrollablePanScanTests.java
new file mode 100755
index 0000000..a1c5fd2
--- /dev/null
+++ b/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityNonScrollablePanScanTests.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.imftest.samples;
+
+import android.test.suitebuilder.annotation.LargeTest;
+import android.view.View;
+
+import com.android.imftest.R;
+
+
+public class BigEditTextActivityNonScrollablePanScanTests extends ImfBaseTestCase<BigEditTextActivityNonScrollablePanScan> {
+
+ public final String TAG = "BigEditTextActivityNonScrollablePanScanTests";
+
+ public BigEditTextActivityNonScrollablePanScanTests() {
+ super(BigEditTextActivityNonScrollablePanScan.class);
+ }
+
+ @LargeTest
+ public void testAppAdjustmentPanScan() {
+ // Give the IME 2 seconds to appear.
+ pause(2000);
+
+ View rootView = ((BigEditTextActivityNonScrollablePanScan) mTargetActivity).getRootView();
+ View servedView = ((BigEditTextActivityNonScrollablePanScan) mTargetActivity).getDefaultFocusedView();
+
+ assertNotNull(rootView);
+ assertNotNull(servedView);
+
+ destructiveCheckImeInitialState(rootView, servedView);
+
+ verifyEditTextAdjustment(servedView, rootView.getMeasuredHeight());
+ }
+
+}
diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityNonScrollableResizeTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityNonScrollableResizeTests.java
new file mode 100755
index 0000000..2e0b0eb
--- /dev/null
+++ b/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityNonScrollableResizeTests.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.imftest.samples;
+
+import android.test.suitebuilder.annotation.LargeTest;
+import android.view.View;
+
+import com.android.imftest.R;
+
+
+public class BigEditTextActivityNonScrollableResizeTests extends ImfBaseTestCase<BigEditTextActivityNonScrollableResize> {
+
+ public final String TAG = "BigEditTextActivityNonScrollableResizeTests";
+
+ public BigEditTextActivityNonScrollableResizeTests() {
+ super(BigEditTextActivityNonScrollableResize.class);
+ }
+
+ @LargeTest
+ public void testAppAdjustmentPanScan() { // Give the IME 2 seconds to appear.
+ pause(2000);
+
+ View rootView = ((BigEditTextActivityNonScrollableResize) mTargetActivity).getRootView();
+ View servedView = ((BigEditTextActivityNonScrollableResize) mTargetActivity).getDefaultFocusedView();
+
+ assertNotNull(rootView);
+ assertNotNull(servedView);
+
+ destructiveCheckImeInitialState(rootView, servedView);
+
+ verifyEditTextAdjustment(servedView, rootView.getMeasuredHeight());
+ }
+
+}
diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityScrollablePanScanTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityScrollablePanScanTests.java
new file mode 100755
index 0000000..d3eefb5
--- /dev/null
+++ b/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityScrollablePanScanTests.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.imftest.samples;
+
+import android.test.suitebuilder.annotation.LargeTest;
+import android.view.View;
+
+import com.android.imftest.R;
+
+
+public class BigEditTextActivityScrollablePanScanTests extends ImfBaseTestCase<BigEditTextActivityScrollablePanScan> {
+
+ public final String TAG = "BigEditTextActivityScrollablePanScanTests";
+
+ public BigEditTextActivityScrollablePanScanTests() {
+ super(BigEditTextActivityScrollablePanScan.class);
+ }
+
+ @LargeTest
+ public void testAppAdjustmentPanScan() { // Give the IME 2 seconds to appear.
+ pause(2000);
+
+ View rootView = ((BigEditTextActivityScrollablePanScan) mTargetActivity).getRootView();
+ View servedView = ((BigEditTextActivityScrollablePanScan) mTargetActivity).getDefaultFocusedView();
+
+ assertNotNull(rootView);
+ assertNotNull(servedView);
+
+ destructiveCheckImeInitialState(rootView, servedView);
+
+ verifyEditTextAdjustment(servedView, rootView.getMeasuredHeight());
+ }
+
+}
diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityScrollableResizeTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityScrollableResizeTests.java
new file mode 100755
index 0000000..5c40e6d
--- /dev/null
+++ b/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityScrollableResizeTests.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.imftest.samples;
+
+import android.test.suitebuilder.annotation.LargeTest;
+import android.view.View;
+
+import com.android.imftest.R;
+
+
+public class BigEditTextActivityScrollableResizeTests extends ImfBaseTestCase<BigEditTextActivityScrollableResize> {
+
+ public final String TAG = "BigEditTextActivityScrollableResizeTests";
+
+ public BigEditTextActivityScrollableResizeTests() {
+ super(BigEditTextActivityScrollableResize.class);
+ }
+
+ @LargeTest
+ public void testAppAdjustmentPanScan() {
+ // Give the IME 2 seconds to appear.
+ pause(2000);
+
+ View rootView = ((BigEditTextActivityScrollableResize) mTargetActivity).getRootView();
+ View servedView = ((BigEditTextActivityScrollableResize) mTargetActivity).getDefaultFocusedView();
+
+ assertNotNull(rootView);
+ assertNotNull(servedView);
+
+ destructiveCheckImeInitialState(rootView, servedView);
+
+ verifyEditTextAdjustment(servedView, rootView.getMeasuredHeight());
+ }
+
+}
diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/BottomEditTextActivityPanScanTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/BottomEditTextActivityPanScanTests.java
new file mode 100755
index 0000000..9a93133
--- /dev/null
+++ b/tests/ImfTest/tests/src/com/android/imftest/samples/BottomEditTextActivityPanScanTests.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.imftest.samples;
+
+import android.test.suitebuilder.annotation.LargeTest;
+import android.view.View;
+
+import com.android.imftest.R;
+
+
+public class BottomEditTextActivityPanScanTests extends ImfBaseTestCase<BottomEditTextActivityPanScan> {
+
+ public final String TAG = "BottomEditTextActivityPanScanTests";
+
+ public BottomEditTextActivityPanScanTests() {
+ super(BottomEditTextActivityPanScan.class);
+ }
+
+ @LargeTest
+ public void testAppAdjustmentPanScan() {
+ // Give the IME 2 seconds to appear.
+ pause(2000);
+
+ View rootView = ((BottomEditTextActivityPanScan) mTargetActivity).getRootView();
+ View servedView = ((BottomEditTextActivityPanScan) mTargetActivity).getDefaultFocusedView();
+
+ assertNotNull(rootView);
+ assertNotNull(servedView);
+
+ destructiveCheckImeInitialState(rootView, servedView);
+
+ verifyEditTextAdjustment(servedView, rootView.getMeasuredHeight());
+ }
+
+}
diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/BottomEditTextActivityResizeTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/BottomEditTextActivityResizeTests.java
new file mode 100755
index 0000000..9a69fd5
--- /dev/null
+++ b/tests/ImfTest/tests/src/com/android/imftest/samples/BottomEditTextActivityResizeTests.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.imftest.samples;
+
+import android.test.suitebuilder.annotation.LargeTest;
+import android.view.View;
+
+import com.android.imftest.R;
+
+
+public class BottomEditTextActivityResizeTests extends ImfBaseTestCase<BottomEditTextActivityResize> {
+
+ public final String TAG = "BottomEditTextActivityResizeTests";
+
+ public BottomEditTextActivityResizeTests() {
+ super(BottomEditTextActivityResize.class);
+ }
+
+ @LargeTest
+ public void testAppAdjustmentResize() {
+ // Give the IME 2 seconds to appear.
+ pause(2000);
+
+ View rootView = ((BottomEditTextActivityResize) mTargetActivity).getRootView();
+ View servedView = ((BottomEditTextActivityResize) mTargetActivity).getDefaultFocusedView();
+
+ assertNotNull(rootView);
+ assertNotNull(servedView);
+
+ destructiveCheckImeInitialState(rootView, servedView);
+
+ verifyEditTextAdjustment(servedView, rootView.getMeasuredHeight());
+ }
+
+}
diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/ButtonActivityTest.java b/tests/ImfTest/tests/src/com/android/imftest/samples/ButtonActivityTest.java
new file mode 100755
index 0000000..ae900c3
--- /dev/null
+++ b/tests/ImfTest/tests/src/com/android/imftest/samples/ButtonActivityTest.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.imftest.samples;
+
+import android.test.suitebuilder.annotation.LargeTest;
+import android.view.KeyEvent;
+import android.widget.Button;
+
+
+public class ButtonActivityTest extends ImfBaseTestCase<ButtonActivity> {
+
+ final public String TAG = "ButtonActivityTest";
+
+ public ButtonActivityTest() {
+ super(ButtonActivity.class);
+ }
+
+ @LargeTest
+ public void testButtonActivatesIme() {
+
+ final Button button = (Button) mTargetActivity.findViewById(ButtonActivity.BUTTON_ID);
+
+ // Push button
+ // Bring the target EditText into focus.
+ mTargetActivity.runOnUiThread(new Runnable() {
+ public void run() {
+ button.requestFocus();
+ }
+ });
+
+ sendKeys(KeyEvent.KEYCODE_DPAD_CENTER);
+
+ // Give it a couple seconds
+ pause(2000);
+
+ // We should have initialized imm.mServedView and imm.mCurrentTextBoxAttribute
+ assertTrue(mImm.isActive());
+ // imm.mServedInputConnection should be null since Button doesn't override onCreateInputConnection().
+ assertFalse(mImm.isAcceptingText());
+
+ destructiveCheckImeInitialState(mTargetActivity.getRootView(), button);
+
+ }
+}
diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/ImfBaseTestCase.java b/tests/ImfTest/tests/src/com/android/imftest/samples/ImfBaseTestCase.java
new file mode 100755
index 0000000..61dc611
--- /dev/null
+++ b/tests/ImfTest/tests/src/com/android/imftest/samples/ImfBaseTestCase.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.imftest.samples;
+
+import android.app.Activity;
+import android.os.SystemClock;
+import android.test.InstrumentationTestCase;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.WindowManager;
+import android.view.inputmethod.InputMethodManager;
+
+import com.android.imftest.R;
+
+public abstract class ImfBaseTestCase<T extends Activity> extends InstrumentationTestCase {
+
+ /*
+ * The amount of time we are willing to wait for the IME to appear after a user action
+ * before we give up and fail the test.
+ */
+ public final long WAIT_FOR_IME = 5000;
+
+ /*
+ * Unfortunately there is now way for us to know how tall the IME is,
+ * so we have to hard code a minimum and maximum value.
+ */
+ public final int IME_MIN_HEIGHT = 150;
+ public final int IME_MAX_HEIGHT = 300;
+
+ public final String TARGET_PACKAGE_NAME = "com.android.imftest";
+ protected InputMethodManager mImm;
+ protected T mTargetActivity;
+ protected boolean mExpectAutoPop;
+ private Class<T> mTargetActivityClass;
+
+ public ImfBaseTestCase(Class<T> activityClass) {
+ mTargetActivityClass = activityClass;
+ }
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+
+ mTargetActivity = launchActivity(TARGET_PACKAGE_NAME, mTargetActivityClass, null);
+ mExpectAutoPop = mTargetActivity.getResources().getBoolean(R.bool.def_expect_ime_autopop);
+ mImm = InputMethodManager.getInstance(mTargetActivity);
+ }
+
+ // Utility test methods
+ public void verifyEditTextAdjustment(final View editText, int rootViewHeight) {
+
+ int[] origLocation = new int[2];
+ int[] newLocation = new int[2];
+
+ // Tell the keyboard to go away.
+ mImm.hideSoftInputFromWindow(editText.getWindowToken(), 0);
+
+ // Bring the target EditText into focus.
+ mTargetActivity.runOnUiThread(new Runnable() {
+ public void run() {
+ editText.requestFocus();
+ }
+ });
+
+ // Get the original location of the EditText.
+ editText.getLocationOnScreen(origLocation);
+
+ // Tap the EditText to bring up the IME.
+ sendKeys(KeyEvent.KEYCODE_DPAD_CENTER);
+
+ // Wait until the EditText pops above the IME or until we hit the timeout.
+ editText.getLocationOnScreen(newLocation);
+ long timeoutTime = SystemClock.uptimeMillis() + WAIT_FOR_IME;
+ while (newLocation[1] > rootViewHeight - IME_MIN_HEIGHT && SystemClock.uptimeMillis() < timeoutTime) {
+ editText.getLocationOnScreen(newLocation);
+ pause(100);
+ }
+
+ assertTrue(newLocation[1] <= rootViewHeight - IME_MIN_HEIGHT);
+
+ // Tell the keyboard to go away.
+ mImm.hideSoftInputFromWindow(editText.getWindowToken(), 0);
+ }
+
+ public void destructiveCheckImeInitialState(View rootView, View servedView) {
+ if (mExpectAutoPop && (mTargetActivity.getWindow().getAttributes().
+ softInputMode&WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST)
+ == WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) {
+ assertTrue(destructiveCheckImeUp(rootView, servedView));
+ } else {
+ assertFalse(destructiveCheckImeUp(rootView, servedView));
+ }
+ }
+
+ public boolean destructiveCheckImeUp(View rootView, View servedView) {
+ int origHeight;
+ int newHeight;
+
+ origHeight = rootView.getHeight();
+
+ // Tell the keyboard to go away.
+ mImm.hideSoftInputFromWindow(servedView.getWindowToken(), 0);
+
+ // Give it five seconds to adjust
+ newHeight = rootView.getHeight();
+ long timeoutTime = SystemClock.uptimeMillis() + WAIT_FOR_IME;
+ while (Math.abs(newHeight - origHeight) < IME_MIN_HEIGHT && SystemClock.uptimeMillis() < timeoutTime) {
+ newHeight = rootView.getHeight();
+ }
+
+ return (Math.abs(origHeight - newHeight) >= IME_MIN_HEIGHT);
+ }
+
+ void pause(int millis) {
+ try {
+ Thread.sleep(millis);
+ } catch (InterruptedException e) {
+ }
+ }
+
+}
diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityBaseTestCase.java b/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityBaseTestCase.java
new file mode 100755
index 0000000..278efb1
--- /dev/null
+++ b/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityBaseTestCase.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.imftest.samples;
+
+import android.app.Activity;
+import android.widget.EditText;
+
+
+public abstract class ManyEditTextActivityBaseTestCase<T extends Activity> extends ImfBaseTestCase<T> {
+
+ public ManyEditTextActivityBaseTestCase(Class<T> activityClass){
+ super(activityClass);
+ }
+
+ public abstract void testAllEditTextsAdjust();
+
+ public void verifyAllEditTextAdjustment(int numEditTexts, int rootViewHeight) {
+
+ for (int i = 0; i < numEditTexts; i++) {
+ final EditText lastEditText = (EditText) mTargetActivity.findViewById(i);
+ verifyEditTextAdjustment(lastEditText, rootViewHeight);
+ }
+
+ }
+
+}
diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScanTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScanTests.java
new file mode 100755
index 0000000..4f8d14e
--- /dev/null
+++ b/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScanTests.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.imftest.samples;
+
+import android.test.suitebuilder.annotation.LargeTest;
+
+
+public class ManyEditTextActivityNoScrollPanScanTests extends ManyEditTextActivityBaseTestCase<ManyEditTextActivityNoScrollPanScan> {
+
+ public final String TAG = "ManyEditTextActivityNoScrollPanScanTests";
+
+ public ManyEditTextActivityNoScrollPanScanTests() {
+ super(ManyEditTextActivityNoScrollPanScan.class);
+ }
+
+
+ @LargeTest
+ public void testAllEditTextsAdjust() {
+ verifyAllEditTextAdjustment(mTargetActivity.NUM_EDIT_TEXTS,
+ mTargetActivity.getRootView().getMeasuredHeight());
+ }
+}
diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScanTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScanTests.java
new file mode 100755
index 0000000..7f98f7f
--- /dev/null
+++ b/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScanTests.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.imftest.samples;
+
+import android.test.suitebuilder.annotation.LargeTest;
+
+
+public class ManyEditTextActivityScrollPanScanTests extends ManyEditTextActivityBaseTestCase<ManyEditTextActivityScrollPanScan> {
+
+ public final String TAG = "ManyEditTextActivityScrollPanScanTests";
+
+
+ public ManyEditTextActivityScrollPanScanTests() {
+ super(ManyEditTextActivityScrollPanScan.class);
+ }
+
+ @LargeTest
+ public void testAllEditTextsAdjust() {
+ verifyAllEditTextAdjustment(mTargetActivity.NUM_EDIT_TEXTS,
+ mTargetActivity.getRootView().getMeasuredHeight());
+ }
+
+}
diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityScrollResizeTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityScrollResizeTests.java
new file mode 100755
index 0000000..68dae87
--- /dev/null
+++ b/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityScrollResizeTests.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.imftest.samples;
+
+import android.test.suitebuilder.annotation.LargeTest;
+
+
+public class ManyEditTextActivityScrollResizeTests extends ManyEditTextActivityBaseTestCase<ManyEditTextActivityScrollResize> {
+
+ public final String TAG = "ManyEditTextActivityScrollResizeTests";
+
+
+ public ManyEditTextActivityScrollResizeTests() {
+ super(ManyEditTextActivityScrollResize.class);
+ }
+
+ @LargeTest
+ public void testAllEditTextsAdjust() {
+ verifyAllEditTextAdjustment(mTargetActivity.NUM_EDIT_TEXTS,
+ mTargetActivity.getRootView().getMeasuredHeight());
+ }
+
+}
diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/OneEditTextActivityNotSelectedTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/OneEditTextActivityNotSelectedTests.java
new file mode 100755
index 0000000..ed5b0c9
--- /dev/null
+++ b/tests/ImfTest/tests/src/com/android/imftest/samples/OneEditTextActivityNotSelectedTests.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.imftest.samples;
+
+import android.test.suitebuilder.annotation.LargeTest;
+import android.view.View;
+
+
+public class OneEditTextActivityNotSelectedTests extends ImfBaseTestCase<OneEditTextActivityNotSelected> {
+
+ public final String TAG = "OneEditTextActivityNotSelectedTests";
+
+ public OneEditTextActivityNotSelectedTests() {
+ super(OneEditTextActivityNotSelected.class);
+ }
+
+ @LargeTest
+ public void testSoftKeyboardNoAutoPop() {
+
+ // Give the IME 2 seconds to appear.
+ pause(2000);
+
+ assertFalse(mImm.isAcceptingText());
+
+ View rootView = ((OneEditTextActivityNotSelected) mTargetActivity).getRootView();
+ View servedView = ((OneEditTextActivityNotSelected) mTargetActivity).getDefaultFocusedView();
+
+ assertNotNull(rootView);
+ assertNotNull(servedView);
+
+ destructiveCheckImeInitialState(rootView, servedView);
+
+ verifyEditTextAdjustment(servedView, rootView.getMeasuredHeight());
+ }
+
+}
diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/OneEditTextActivitySelectedTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/OneEditTextActivitySelectedTests.java
new file mode 100755
index 0000000..42fcd66
--- /dev/null
+++ b/tests/ImfTest/tests/src/com/android/imftest/samples/OneEditTextActivitySelectedTests.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.imftest.samples;
+
+import com.android.imftest.R;
+
+import android.test.suitebuilder.annotation.LargeTest;
+import android.view.KeyEvent;
+import android.view.View;
+
+
+public class OneEditTextActivitySelectedTests extends ImfBaseTestCase<OneEditTextActivitySelected> {
+
+ public final String TAG = "OneEditTextActivitySelectedTests";
+
+ public OneEditTextActivitySelectedTests() {
+ super(OneEditTextActivitySelected.class);
+ }
+
+ @LargeTest
+ public void testSoftKeyboardAutoPop() {
+
+ // Give the IME 2 seconds to appear.
+ pause(2000);
+
+ assertTrue(mImm.isAcceptingText());
+
+ View rootView = ((OneEditTextActivitySelected) mTargetActivity).getRootView();
+ View servedView = ((OneEditTextActivitySelected) mTargetActivity).getDefaultFocusedView();
+
+ assertNotNull(rootView);
+ assertNotNull(servedView);
+
+ destructiveCheckImeInitialState(rootView, servedView);
+
+ verifyEditTextAdjustment(servedView, rootView.getMeasuredHeight());
+ }
+
+}