Move android.view out of CtsTestStubs

bug: 17399678
Change-Id: I35904da733a45bd957f1932e2507b8bf8bab1a40
diff --git a/tests/tests/view/Android.mk b/tests/tests/view/Android.mk
index 2c07cc3..027e321 100644
--- a/tests/tests/view/Android.mk
+++ b/tests/tests/view/Android.mk
@@ -17,18 +17,16 @@
 include $(CLEAR_VARS)
 
 # don't include this package in any target
-LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_TAGS := tests
 # and when built explicitly put it in the data partition
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
 LOCAL_PACKAGE_NAME := CtsViewTestCases
 
-LOCAL_INSTRUMENTATION_FOR := CtsTestStubs
-
 include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/view/AndroidManifest.xml b/tests/tests/view/AndroidManifest.xml
index 4cdeab2..6806d29 100644
--- a/tests/tests/view/AndroidManifest.xml
+++ b/tests/tests/view/AndroidManifest.xml
@@ -19,12 +19,166 @@
     package="com.android.cts.view">
 
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
-    <application>
+    <application android:label="Android TestCase"
+                android:icon="@drawable/size_48x48"
+                android:maxRecents="1"
+                android:multiArch="true"
+                android:name="android.view.cts.MockApplication"
+                android:supportsRtl="true">
         <uses-library android:name="android.test.runner" />
+        
+        <activity android:name="android.view.cts.ViewStubCtsActivity"
+            android:label="ViewStubCtsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+        
+        <activity android:name="android.view.cts.UsingViewsCtsActivity"
+            android:label="Using Views Test">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+        
+        <activity android:name="android.view.cts.FocusHandlingCtsActivity"
+            android:label="Focus Handling Test">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+        
+        <activity android:name="android.view.cts.ViewGroupCtsActivity" android:label="ViewGroupCtsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+        
+        <activity android:name="android.view.cts.ViewTestCtsActivity"
+            android:label="ViewTestCtsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+        
+        <activity android:name="android.view.cts.ViewLayoutPositionTestCtsActivity"
+            android:label="ViewTestCtsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="android.view.cts.WindowCtsActivity"
+            android:theme="@android:style/Theme.Holo.NoActionBar"
+            android:label="WindowCtsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+        
+        <activity android:name="android.view.animation.cts.AnimationTestCtsActivity"
+            android:label="AnimationTestCtsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="android.view.animation.cts.GridLayoutAnimCtsActivity"
+            android:label="GridLayoutAnimCtsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="android.view.animation.cts.LayoutAnimCtsActivity"
+            android:label="LayoutAnimCtsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+        
+        <activity android:name="android.view.inputmethod.cts.InputMethodCtsActivity"
+            android:label="InputMethodCtsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+        <service android:name="android.view.inputmethod.cts.InputMethodInfoStub"
+            android:label="InputMethodInfoStub">
+            <intent-filter>
+                <action android:name="android.view.InputMethod" />
+            </intent-filter>
+            <meta-data android:name="android.view.im"
+                android:resource="@xml/method" />
+        </service>
+
+        <activity android:name="android.view.cts.MenuInflaterCtsActivity"
+            android:label="MenuInflaterCtsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="android.view.cts.SurfaceViewCtsActivity"
+            android:label="SurfaceViewCtsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="android.view.cts.FocusFinderCtsActivity"
+            android:label="FocusFinderCtsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="android.view.cts.GestureDetectorCtsActivity"
+            android:label="GestureDetectorCtsActivity"
+            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
+            
+        <activity android:name="android.view.cts.GLSurfaceViewCtsActivity"
+            android:label="GLSurfaceViewCts"/>
+
+        <activity android:name="android.view.cts.MockActivity" android:label="MockActivity">
+            <meta-data android:name="android.view.merge"
+                android:resource="@xml/merge" />
+        </activity>
+
+        <activity android:name="android.view.cts.ViewGroupCtsActivity"
+            android:label="WidgetViewGroupCtsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="android.view.cts.CtsActivity"
+            android:label="CtsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+            </intent-filter>
+        </activity>
+
     </application>
 
     <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
-                     android:targetPackage="com.android.cts.stub"
+                     android:targetPackage="com.android.cts.view"
                      android:label="CTS tests of android.view">
         <meta-data android:name="listener"
             android:value="com.android.cts.runner.CtsTestRunListener" />
diff --git a/tests/tests/view/res/anim/accelerate_alpha.xml b/tests/tests/view/res/anim/accelerate_alpha.xml
new file mode 100644
index 0000000..594652b
--- /dev/null
+++ b/tests/tests/view/res/anim/accelerate_alpha.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.
+-->
+
+<alpha xmlns:android="http://schemas.android.com/apk/res/android"
+    android:interpolator="@android:anim/accelerate_interpolator"
+    android:fromAlpha="0.1"
+    android:toAlpha="0.9"
+    android:duration="1000" />
diff --git a/tests/tests/view/res/anim/accelerate_decelerate_alpha.xml b/tests/tests/view/res/anim/accelerate_decelerate_alpha.xml
new file mode 100644
index 0000000..7c892b2
--- /dev/null
+++ b/tests/tests/view/res/anim/accelerate_decelerate_alpha.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.
+-->
+
+<alpha xmlns:android="http://schemas.android.com/apk/res/android"
+    android:interpolator="@android:anim/accelerate_decelerate_interpolator"
+    android:fromAlpha="0.0"
+    android:toAlpha="1.0"
+    android:duration="2000" />
diff --git a/tests/tests/view/res/anim/alpha.xml b/tests/tests/view/res/anim/alpha.xml
new file mode 100644
index 0000000..8893d66
--- /dev/null
+++ b/tests/tests/view/res/anim/alpha.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<alpha xmlns:android="http://schemas.android.com/apk/res/android"
+       android:fromAlpha="0.0"
+       android:toAlpha="1.0"
+       android:duration="500" />
diff --git a/tests/src/android/view/cts/MenuInflaterStubActivity.java b/tests/tests/view/res/anim/anim_alpha.xml
similarity index 68%
copy from tests/src/android/view/cts/MenuInflaterStubActivity.java
copy to tests/tests/view/res/anim/anim_alpha.xml
index 693fe13..b5794c3 100644
--- a/tests/src/android/view/cts/MenuInflaterStubActivity.java
+++ b/tests/tests/view/res/anim/anim_alpha.xml
@@ -1,4 +1,5 @@
-/*
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
  * Copyright (C) 2008 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,17 +13,11 @@
  * 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 android.view.cts;
+<alpha xmlns:android="http://schemas.android.com/apk/res/android"
+       android:interpolator="@android:anim/accelerate_interpolator"
+       android:fromAlpha="0.0"
+       android:toAlpha="1.0"
+       android:duration="500" />
 
-import android.app.Activity;
-import android.view.MenuInflater;
-
-/**
- * Stub activity for testing {@link MenuInflater}.
- *
- * @see MenuInflaterTest
- */
-public class MenuInflaterStubActivity extends Activity {
-}
diff --git a/tests/tests/view/res/anim/anim_gridlayout.xml b/tests/tests/view/res/anim/anim_gridlayout.xml
new file mode 100644
index 0000000..be42d76
--- /dev/null
+++ b/tests/tests/view/res/anim/anim_gridlayout.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<gridLayoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"
+        android:delay="10%"
+        android:rowDelay="50%"
+        android:directionPriority="column"
+        android:animation="@anim/anim_alpha" />
diff --git a/tests/src/android/view/cts/MenuInflaterStubActivity.java b/tests/tests/view/res/anim/anim_rotate.xml
similarity index 63%
copy from tests/src/android/view/cts/MenuInflaterStubActivity.java
copy to tests/tests/view/res/anim/anim_rotate.xml
index 693fe13..4fbadcf 100644
--- a/tests/src/android/view/cts/MenuInflaterStubActivity.java
+++ b/tests/tests/view/res/anim/anim_rotate.xml
@@ -1,4 +1,5 @@
-/*
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
  * Copyright (C) 2008 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,17 +13,13 @@
  * 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 android.view.cts;
-
-import android.app.Activity;
-import android.view.MenuInflater;
-
-/**
- * Stub activity for testing {@link MenuInflater}.
- *
- * @see MenuInflaterTest
- */
-public class MenuInflaterStubActivity extends Activity {
-}
+<rotate xmlns:android="http://schemas.android.com/apk/res/android"
+    android:interpolator="@android:anim/decelerate_interpolator"
+    android:fromDegrees="0"
+    android:toDegrees="-45"
+    android:toYScale="0.0"
+    android:pivotX="50%"
+    android:pivotY="50%"
+    android:duration="700" />
diff --git a/tests/tests/view/res/anim/anim_scale.xml b/tests/tests/view/res/anim/anim_scale.xml
new file mode 100644
index 0000000..96a3e28
--- /dev/null
+++ b/tests/tests/view/res/anim/anim_scale.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (C) 2008 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.
+ -->
+
+<scale xmlns:android="http://schemas.android.com/apk/res/android"
+    android:interpolator="@android:anim/accelerate_decelerate_interpolator"
+    android:fromXScale="1.0"
+    android:toXScale="1.4"
+    android:fromYScale="1.0"
+    android:toYScale="0.6"
+    android:pivotX="50%"
+    android:pivotY="50%"
+    android:fillAfter="false"
+    android:duration="600" />
diff --git a/tests/tests/view/res/anim/anim_set.xml b/tests/tests/view/res/anim/anim_set.xml
new file mode 100644
index 0000000..7d139a8
--- /dev/null
+++ b/tests/tests/view/res/anim/anim_set.xml
@@ -0,0 +1,53 @@
+<?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.
+ -->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false">
+
+    <scale
+        android:interpolator="@android:anim/accelerate_decelerate_interpolator"
+        android:fromXScale="1.0"
+        android:toXScale="1.4"
+        android:fromYScale="1.0"
+        android:toYScale="0.6"
+        android:pivotX="50%"
+        android:pivotY="50%"
+        android:fillAfter="false"
+        android:duration="900" />
+
+    <set
+        android:interpolator="@android:anim/accelerate_interpolator"
+                android:startOffset="700">
+
+        <scale
+            android:fromXScale="1.4"
+            android:toXScale="0.0"
+            android:fromYScale="0.6"
+            android:toYScale="0.0"
+            android:pivotX="50%"
+            android:pivotY="50%"
+            android:duration="400" />
+
+        <rotate
+            android:fromDegrees="0"
+            android:toDegrees="-45"
+            android:toYScale="0.0"
+            android:pivotX="50%"
+            android:pivotY="50%"
+            android:duration="400" />
+    </set>
+
+</set>
diff --git a/tests/src/android/view/cts/MenuInflaterStubActivity.java b/tests/tests/view/res/anim/anim_translate.xml
similarity index 64%
copy from tests/src/android/view/cts/MenuInflaterStubActivity.java
copy to tests/tests/view/res/anim/anim_translate.xml
index 693fe13..6659c2b 100644
--- a/tests/src/android/view/cts/MenuInflaterStubActivity.java
+++ b/tests/tests/view/res/anim/anim_translate.xml
@@ -1,4 +1,5 @@
-/*
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
  * Copyright (C) 2008 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,17 +13,12 @@
  * 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 android.view.cts;
-
-import android.app.Activity;
-import android.view.MenuInflater;
-
-/**
- * Stub activity for testing {@link MenuInflater}.
- *
- * @see MenuInflaterTest
- */
-public class MenuInflaterStubActivity extends Activity {
-}
+<translate xmlns:android="http://schemas.android.com/apk/res/android"
+    android:interpolator="@android:anim/accelerate_interpolator"
+    android:fromXDelta="100%p"
+    android:toXDelta="0"
+    android:fromYDelta="100%p"
+    android:toYDelta="0"
+    android:duration="800" />
diff --git a/tests/src/android/view/cts/MenuInflaterStubActivity.java b/tests/tests/view/res/anim/cycle_alpha.xml
similarity index 63%
copy from tests/src/android/view/cts/MenuInflaterStubActivity.java
copy to tests/tests/view/res/anim/cycle_alpha.xml
index 693fe13..0a3b53c 100644
--- a/tests/src/android/view/cts/MenuInflaterStubActivity.java
+++ b/tests/tests/view/res/anim/cycle_alpha.xml
@@ -1,5 +1,6 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
+<?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.
@@ -12,17 +13,10 @@
  * 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 android.view.cts;
-
-import android.app.Activity;
-import android.view.MenuInflater;
-
-/**
- * Stub activity for testing {@link MenuInflater}.
- *
- * @see MenuInflaterTest
- */
-public class MenuInflaterStubActivity extends Activity {
-}
+<alpha xmlns:android="http://schemas.android.com/apk/res/android"
+       android:interpolator="@anim/cycle_interpolator"
+       android:fromAlpha="0.0"
+       android:toAlpha="1.0"
+       android:duration="2000" />
diff --git a/tests/src/android/view/cts/MenuInflaterStubActivity.java b/tests/tests/view/res/anim/cycle_interpolator.xml
similarity index 64%
copy from tests/src/android/view/cts/MenuInflaterStubActivity.java
copy to tests/tests/view/res/anim/cycle_interpolator.xml
index 693fe13..d1586e5 100644
--- a/tests/src/android/view/cts/MenuInflaterStubActivity.java
+++ b/tests/tests/view/res/anim/cycle_interpolator.xml
@@ -1,5 +1,6 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
+<?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.
@@ -12,17 +13,6 @@
  * 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 android.view.cts;
-
-import android.app.Activity;
-import android.view.MenuInflater;
-
-/**
- * Stub activity for testing {@link MenuInflater}.
- *
- * @see MenuInflaterTest
- */
-public class MenuInflaterStubActivity extends Activity {
-}
+ <cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android" android:cycles="1" />
diff --git a/tests/tests/view/res/anim/decelerate_alpha.xml b/tests/tests/view/res/anim/decelerate_alpha.xml
new file mode 100644
index 0000000..793807e
--- /dev/null
+++ b/tests/tests/view/res/anim/decelerate_alpha.xml
@@ -0,0 +1,21 @@
+<?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.
+-->
+
+<alpha xmlns:android="http://schemas.android.com/apk/res/android"
+    android:interpolator="@android:anim/decelerate_interpolator"
+    android:fromAlpha="0.0"
+    android:toAlpha="1.0"
+    android:duration="2000" />
diff --git a/tests/src/android/view/cts/MenuInflaterStubActivity.java b/tests/tests/view/res/anim/layout_anim_controller_animation.xml
similarity index 60%
copy from tests/src/android/view/cts/MenuInflaterStubActivity.java
copy to tests/tests/view/res/anim/layout_anim_controller_animation.xml
index 693fe13..1e3608c 100644
--- a/tests/src/android/view/cts/MenuInflaterStubActivity.java
+++ b/tests/tests/view/res/anim/layout_anim_controller_animation.xml
@@ -1,5 +1,6 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
+<?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.
@@ -12,17 +13,11 @@
  * 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 android.view.cts;
-
-import android.app.Activity;
-import android.view.MenuInflater;
-
-/**
- * Stub activity for testing {@link MenuInflater}.
- *
- * @see MenuInflaterTest
- */
-public class MenuInflaterStubActivity extends Activity {
-}
+<alpha xmlns:android="http://schemas.android.com/apk/res/android"
+       android:interpolator="@android:anim/accelerate_interpolator"
+       android:fillAfter="true"
+       android:fromAlpha="0.0"
+       android:toAlpha="1.0"
+       android:duration="1000" />
diff --git a/tests/tests/view/res/drawable/faces.jpg b/tests/tests/view/res/drawable/faces.jpg
new file mode 100644
index 0000000..0672022
--- /dev/null
+++ b/tests/tests/view/res/drawable/faces.jpg
Binary files differ
diff --git a/tests/tests/view/res/drawable/failed.jpg b/tests/tests/view/res/drawable/failed.jpg
new file mode 100644
index 0000000..1bb9b52
--- /dev/null
+++ b/tests/tests/view/res/drawable/failed.jpg
Binary files differ
diff --git a/tests/tests/view/res/drawable/icon_black.jpg b/tests/tests/view/res/drawable/icon_black.jpg
new file mode 100644
index 0000000..4c9062a
--- /dev/null
+++ b/tests/tests/view/res/drawable/icon_black.jpg
Binary files differ
diff --git a/tests/tests/view/res/drawable/icon_blue.jpg b/tests/tests/view/res/drawable/icon_blue.jpg
new file mode 100644
index 0000000..9e6c1c8
--- /dev/null
+++ b/tests/tests/view/res/drawable/icon_blue.jpg
Binary files differ
diff --git a/tests/tests/view/res/drawable/icon_green.jpg b/tests/tests/view/res/drawable/icon_green.jpg
new file mode 100644
index 0000000..55a78f2
--- /dev/null
+++ b/tests/tests/view/res/drawable/icon_green.jpg
Binary files differ
diff --git a/tests/tests/view/res/drawable/icon_red.jpg b/tests/tests/view/res/drawable/icon_red.jpg
new file mode 100644
index 0000000..6bc9e1f
--- /dev/null
+++ b/tests/tests/view/res/drawable/icon_red.jpg
Binary files differ
diff --git a/tests/tests/view/res/drawable/icon_yellow.jpg b/tests/tests/view/res/drawable/icon_yellow.jpg
new file mode 100644
index 0000000..e748059
--- /dev/null
+++ b/tests/tests/view/res/drawable/icon_yellow.jpg
Binary files differ
diff --git a/tests/tests/view/res/drawable/ninepatch_0.9.png b/tests/tests/view/res/drawable/ninepatch_0.9.png
new file mode 100644
index 0000000..24019d8
--- /dev/null
+++ b/tests/tests/view/res/drawable/ninepatch_0.9.png
Binary files differ
diff --git a/tests/tests/view/res/drawable/ninepatch_1.9.png b/tests/tests/view/res/drawable/ninepatch_1.9.png
new file mode 100644
index 0000000..c56b1db
--- /dev/null
+++ b/tests/tests/view/res/drawable/ninepatch_1.9.png
Binary files differ
diff --git a/tests/tests/view/res/drawable/no_padding.png b/tests/tests/view/res/drawable/no_padding.png
new file mode 100644
index 0000000..7d4c27c
--- /dev/null
+++ b/tests/tests/view/res/drawable/no_padding.png
Binary files differ
diff --git a/tests/tests/view/res/drawable/padding_0.9.png b/tests/tests/view/res/drawable/padding_0.9.png
new file mode 100644
index 0000000..0127bf4
--- /dev/null
+++ b/tests/tests/view/res/drawable/padding_0.9.png
Binary files differ
diff --git a/tests/tests/view/res/drawable/pass.jpg b/tests/tests/view/res/drawable/pass.jpg
new file mode 100644
index 0000000..2f4b083
--- /dev/null
+++ b/tests/tests/view/res/drawable/pass.jpg
Binary files differ
diff --git a/tests/tests/view/res/drawable/scenery.jpg b/tests/tests/view/res/drawable/scenery.jpg
new file mode 100644
index 0000000..7a6145b
--- /dev/null
+++ b/tests/tests/view/res/drawable/scenery.jpg
Binary files differ
diff --git a/tests/tests/view/res/drawable/size_48x48.jpg b/tests/tests/view/res/drawable/size_48x48.jpg
new file mode 100644
index 0000000..5c2291e
--- /dev/null
+++ b/tests/tests/view/res/drawable/size_48x48.jpg
Binary files differ
diff --git a/tests/tests/view/res/drawable/start.jpg b/tests/tests/view/res/drawable/start.jpg
new file mode 100644
index 0000000..54e05e0
--- /dev/null
+++ b/tests/tests/view/res/drawable/start.jpg
Binary files differ
diff --git a/tests/tests/view/res/layout/abslistview_layout.xml b/tests/tests/view/res/layout/abslistview_layout.xml
new file mode 100644
index 0000000..a090ce3
--- /dev/null
+++ b/tests/tests/view/res/layout/abslistview_layout.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<ViewGroup_Layout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/abslistview_root"
+    android:layout_width="25px"
+    android:layout_height="25px" >
+
+   <GridView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" />
+
+   <ListView>
+        <TextView
+            android:text="@string/table_layout_first"
+            android:padding="3dip" />
+        <TextView
+            android:text="@string/table_layout_second"
+            android:padding="3dip" />
+        <TextView
+            android:text="@string/table_layout_third"
+            android:padding="3dip" />
+    </ListView>
+</ViewGroup_Layout>
+
diff --git a/tests/tests/view/res/layout/anim_layout.xml b/tests/tests/view/res/layout/anim_layout.xml
new file mode 100644
index 0000000..b6aa906
--- /dev/null
+++ b/tests/tests/view/res/layout/anim_layout.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2008 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.
+ -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:id="@+id/anim_window_parent">
+
+    <TextView android:id="@+id/anim_window"
+        android:layout_width="100dip"
+        android:layout_height="20dip"
+        android:text="@string/text_view_hello"/>
+
+</LinearLayout>
diff --git a/tests/tests/view/res/layout/focus_finder_layout.xml b/tests/tests/view/res/layout/focus_finder_layout.xml
new file mode 100644
index 0000000..0502fd8
--- /dev/null
+++ b/tests/tests/view/res/layout/focus_finder_layout.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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.
+-->
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+    <TableLayout android:id="@+id/layout"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true">
+        <TableRow>
+            <android.view.cts.TestButton android:id="@+id/top_left_button"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:text="TL" />
+            <android.view.cts.TestButton android:id="@+id/top_right_button"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:text="TR" />
+        </TableRow>
+        <TableRow>
+            <android.view.cts.TestButton android:id="@+id/bottom_left_button"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:text="BL" />
+            <android.view.cts.TestButton android:id="@+id/bottom_right_button"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:text="BR" />
+        </TableRow>  
+    </TableLayout>
+</RelativeLayout>
+
diff --git a/tests/tests/view/res/layout/focus_handling_layout.xml b/tests/tests/view/res/layout/focus_handling_layout.xml
new file mode 100644
index 0000000..84c8e6a
--- /dev/null
+++ b/tests/tests/view/res/layout/focus_handling_layout.xml
@@ -0,0 +1,57 @@
+<?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.
+-->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <View
+        android:id="@+id/view1"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/id_ok"/>
+
+    <View
+        android:id="@+id/view2"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_toRightOf="@id/view1"
+        android:layout_alignTop="@id/view1"
+        android:nextFocusLeft="@id/view1"
+        android:text="@string/id_ok"/>
+
+    <View
+        android:id="@+id/view3"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/view1"
+        android:layout_alignLeft="@id/view1"
+        android:nextFocusUp="@id/view1"
+        android:text="@string/id_ok"/>
+
+    <View
+        android:id="@+id/view4"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_toRightOf="@id/view3"
+        android:layout_alignTop="@id/view3"
+        android:layout_alignRight="@id/view2"
+        android:nextFocusUp="@id/view2"
+        android:nextFocusLeft="@id/view3"
+        android:text="@string/id_ok"/>
+</RelativeLayout>
+
diff --git a/tests/tests/view/res/layout/gridlayout_anim_controller_layout.xml b/tests/tests/view/res/layout/gridlayout_anim_controller_layout.xml
new file mode 100644
index 0000000..0ff2d46
--- /dev/null
+++ b/tests/tests/view/res/layout/gridlayout_anim_controller_layout.xml
@@ -0,0 +1,28 @@
+<?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.
+-->
+
+<GridView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/gridlayout_anim_gridview"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:padding="10dp"
+    android:verticalSpacing="20dp"
+    android:horizontalSpacing="20dp"
+    android:numColumns="3"
+    android:columnWidth="60dp"
+    android:stretchMode="columnWidth"
+    android:gravity="center"
+/>
diff --git a/tests/tests/view/res/layout/inflater_layout.xml b/tests/tests/view/res/layout/inflater_layout.xml
new file mode 100644
index 0000000..cff224e
--- /dev/null
+++ b/tests/tests/view/res/layout/inflater_layout.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+
+    <TextView android:id="@+id/numeric_default"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:editable="true"/>
+
+    <TextView android:id="@+id/numeric_integer"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:numeric="integer"/>
+
+    <TextView android:id="@+id/numeric_signed"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:numeric="signed"/>
+
+    <TextView android:id="@+id/numeric_decimal"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:numeric="decimal"/>
+
+    <TextView android:id="@+id/numeric_signed_integer"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:numeric="signed|integer"/>
+
+    <TextView android:id="@+id/numeric_integer_decimal"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:numeric="integer|decimal"/>
+
+    <TextView android:id="@+id/numeric_signed_decimal"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:numeric="signed|decimal"/>
+
+    <TextView android:id="@+id/numeric_signed_decimal_integer"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:numeric="signed|integer|decimal"/>
+
+     <android.view.cts.MockViewStub class="android.view.cts.MockViewStub"
+        android:id="@+id/autotext_default"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"/>
+
+</LinearLayout>
diff --git a/tests/tests/view/res/layout/inflater_layout_tags.xml b/tests/tests/view/res/layout/inflater_layout_tags.xml
new file mode 100644
index 0000000..dc3eb29
--- /dev/null
+++ b/tests/tests/view/res/layout/inflater_layout_tags.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+ * Copyright (C) 2014 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.
+ */
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/viewlayout_root"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical" >
+
+    <tag
+        android:id="@+id/tag_viewlayout_root"
+        android:value="@string/tag1" />
+
+    <View
+        android:id="@+id/mock_view"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content" >
+
+        <tag
+            android:id="@+id/tag_mock_view"
+            android:value="@string/tag2" />
+    </View>
+
+</LinearLayout>
\ No newline at end of file
diff --git a/tests/tests/view/res/layout/inflater_override_theme_layout.xml b/tests/tests/view/res/layout/inflater_override_theme_layout.xml
new file mode 100644
index 0000000..2d2a578
--- /dev/null
+++ b/tests/tests/view/res/layout/inflater_override_theme_layout.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2013 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+    android:theme="@style/Theme_OverrideOuter" >
+
+    <View
+        android:id="@+id/view_outer"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:theme="@style/Theme_OverrideInner" >
+
+        <View
+            android:id="@+id/view_inner"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content" />
+        <View
+            android:id="@+id/view_attr"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:theme="?attr/themeOverrideAttr" />
+    </LinearLayout>
+
+</LinearLayout>
diff --git a/tests/tests/view/res/layout/inputmethod_edittext.xml b/tests/tests/view/res/layout/inputmethod_edittext.xml
new file mode 100755
index 0000000..849b411
--- /dev/null
+++ b/tests/tests/view/res/layout/inputmethod_edittext.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                  android:layout_width="fill_parent"
+                  android:layout_height="wrap_content"
+                  android:background="@drawable/blue"
+                android:padding="10px">
+
+    <EditText android:id="@+id/entry"
+              android:layout_width="fill_parent"
+              android:layout_height="wrap_content"
+              android:background="@android:drawable/editbox_background"/>
+
+</RelativeLayout>
diff --git a/tests/tests/view/res/layout/scrollview_layout.xml b/tests/tests/view/res/layout/scrollview_layout.xml
new file mode 100644
index 0000000..c5b7b43
--- /dev/null
+++ b/tests/tests/view/res/layout/scrollview_layout.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<android.view.cts.MyScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/scroll_view"
+    android:layout_width="100dip"
+    android:layout_height="100dip">
+
+    <LinearLayout
+        android:orientation="vertical"
+        android:layout_width="250dip"
+        android:layout_height="wrap_content">
+
+        <Button
+            android:id="@+id/first_child"
+            android:layout_width="250dip"
+            android:layout_height="100dip"
+            android:text="@string/vertical_text_1"/>
+
+        <Button
+            android:layout_width="250dip"
+            android:layout_height="100dip"
+            android:text="@string/vertical_text_2"/>
+
+        <Button
+            android:layout_width="250dip"
+            android:layout_height="100dip"
+            android:text="@string/vertical_text_3"/>
+
+        <Button
+            android:layout_width="250dip"
+            android:layout_height="100dip"
+            android:text="@string/vertical_text_1"/>
+
+        <Button
+            android:layout_width="250dip"
+            android:layout_height="100dip"
+            android:text="@string/vertical_text_2"/>
+
+        <Button
+            android:layout_width="250dip"
+            android:layout_height="100dip"
+            android:text="@string/vertical_text_3"/>
+
+        <Button
+            android:layout_width="250dip"
+            android:layout_height="100dip"
+            android:text="@string/vertical_text_1"/>
+
+        <Button
+            android:layout_width="250dip"
+            android:layout_height="100dip"
+            android:text="@string/vertical_text_2"/>
+
+        <Button
+            android:layout_width="250dip"
+            android:layout_height="100dip"
+            android:text="@string/vertical_text_3"/>
+
+        <Button
+            android:layout_width="250dip"
+            android:layout_height="100dip"
+            android:text="@string/vertical_text_1"/>
+
+        <Button
+            android:layout_width="250dip"
+            android:layout_height="100dip"
+            android:text="@string/vertical_text_2"/>
+
+        <Button
+            android:layout_width="250dip"
+            android:layout_height="100dip"
+            android:text="@string/vertical_text_3"/>
+
+        <Button
+            android:layout_width="250dip"
+            android:layout_height="100dip"
+            android:text="@string/vertical_text_1"/>
+
+        <Button
+            android:layout_width="250dip"
+            android:layout_height="100dip"
+            android:text="@string/vertical_text_2"/>
+
+        <Button
+            android:id="@+id/last_child"
+            android:layout_width="250dip"
+            android:layout_height="100dip"
+            android:text="@string/vertical_text_3"/>
+    </LinearLayout>
+
+</android.view.cts.MyScrollView>
diff --git a/tests/tests/view/res/layout/searchview.xml b/tests/tests/view/res/layout/searchview.xml
new file mode 100644
index 0000000..dba105a
--- /dev/null
+++ b/tests/tests/view/res/layout/searchview.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 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.
+-->
+    <SearchView android:id="@+id/searchView1"
+                android:layout_width="fill_parent"
+                android:layout_height="fill_parent"
+                xmlns:android="http://schemas.android.com/apk/res/android">
+    </SearchView>
diff --git a/tests/tests/view/res/layout/textview_layout.xml b/tests/tests/view/res/layout/textview_layout.xml
new file mode 100644
index 0000000..cb3a85e
--- /dev/null
+++ b/tests/tests/view/res/layout/textview_layout.xml
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:id="@+id/layout_textviewtest">
+
+    <ScrollView android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+        <LinearLayout android:orientation="vertical"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent">
+
+            <TextView android:id="@+id/textview_textAttr"
+                    android:text="@string/text_view_hello"
+                    android:textColor="@drawable/black"
+                    android:textColorHighlight="@drawable/yellow"
+                    android:textColorHint="@drawable/red"
+                    android:textColorLink="@drawable/blue"
+                    android:textScaleX="1.2"
+                    android:typeface="normal"
+                    android:textSize="20px"
+                    android:textStyle="normal"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"/>
+        
+            <TextView android:id="@+id/textview_password"
+                    android:password="true"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"/>
+        
+            <TextView android:id="@+id/textview_singleLine"
+                    android:singleLine="true"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"/>
+        
+            <TextView android:id="@+id/textview_text"
+                    android:text="@string/text_view_hello"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"/>
+
+            <TextView android:id="@+id/textview_text_two_lines"
+                    android:text="@string/text_view_hello_two_lines"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"/>
+
+            <android.view.cts.MockTextView
+                    android:id="@+id/mock_textview_left"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:requiresFadingEdge="horizontal"
+                    android:singleLine="true"
+                    android:text="@string/long_text"
+                    android:gravity="left"
+                    />
+
+            <android.view.cts.MockTextView
+                    android:id="@+id/mock_textview_right"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:requiresFadingEdge="horizontal"
+                    android:singleLine="true"
+                    android:text="@string/long_text"
+                    android:gravity="right"
+                    />
+
+            <android.view.cts.MockTextView
+                    android:id="@+id/mock_textview_center"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:requiresFadingEdge="horizontal"
+                    android:singleLine="true"
+                    android:text="@string/long_text"
+                    android:gravity="center"
+                    />
+        </LinearLayout>
+
+    </ScrollView>
+
+    <TextView android:id="@+id/textview_ltr"
+              android:layout_height="wrap_content"
+              android:layout_width="wrap_content"/>
+
+    <TextView android:id="@+id/textview_rtl"
+              android:layout_height="wrap_content"
+              android:layout_width="wrap_content"/>
+
+    <TextView android:id="@+id/textview_drawable_1_1"
+              android:layout_height="wrap_content"
+              android:layout_width="wrap_content"
+              android:drawableLeft="@drawable/icon_blue"
+              android:drawableRight="@drawable/icon_red"
+              android:drawableTop="@drawable/icon_green"
+              android:drawableBottom="@drawable/icon_yellow"
+            />
+
+    <TextView android:id="@+id/textview_drawable_1_2"
+              android:layout_height="wrap_content"
+              android:layout_width="wrap_content"
+              android:drawableLeft="@drawable/icon_blue"
+              android:drawableRight="@drawable/icon_red"
+              android:drawableTop="@drawable/icon_green"
+              android:drawableBottom="@drawable/icon_yellow"
+              android:layoutDirection="rtl"
+            />
+
+    <TextView android:id="@+id/textview_drawable_2_1"
+              android:layout_height="wrap_content"
+              android:layout_width="wrap_content"
+              android:drawableStart="@drawable/icon_blue"
+              android:drawableEnd="@drawable/icon_red"
+              android:drawableTop="@drawable/icon_green"
+              android:drawableBottom="@drawable/icon_yellow"
+            />
+
+    <TextView android:id="@+id/textview_drawable_2_2"
+              android:layout_height="wrap_content"
+              android:layout_width="wrap_content"
+              android:drawableStart="@drawable/icon_blue"
+              android:drawableEnd="@drawable/icon_red"
+              android:drawableTop="@drawable/icon_green"
+              android:drawableBottom="@drawable/icon_yellow"
+              android:layoutDirection="rtl"
+            />
+
+    <TextView android:id="@+id/textview_drawable_3_1"
+              android:layout_height="wrap_content"
+              android:layout_width="wrap_content"
+              android:drawableLeft="@drawable/icon_black"
+              android:drawableRight="@drawable/icon_black"
+              android:drawableStart="@drawable/icon_blue"
+              android:drawableEnd="@drawable/icon_red"
+              android:drawableTop="@drawable/icon_green"
+              android:drawableBottom="@drawable/icon_yellow"
+            />
+
+    <TextView android:id="@+id/textview_drawable_3_2"
+              android:layout_height="wrap_content"
+              android:layout_width="wrap_content"
+              android:drawableLeft="@drawable/icon_black"
+              android:drawableRight="@drawable/icon_black"
+              android:drawableStart="@drawable/icon_blue"
+              android:drawableEnd="@drawable/icon_red"
+              android:drawableTop="@drawable/icon_green"
+              android:drawableBottom="@drawable/icon_yellow"
+              android:layoutDirection="rtl"
+            />
+
+
+    <LinearLayout android:orientation="vertical"
+                  android:layout_width="match_parent"
+                  android:layout_height="match_parent"
+                  android:layoutDirection="ltr">
+
+        <TextView android:id="@+id/textview_drawable_4_1"
+                  android:layout_height="wrap_content"
+                  android:layout_width="wrap_content"
+                  android:drawableStart="@drawable/icon_blue"
+                  android:drawableEnd="@drawable/icon_red"
+                  android:drawableTop="@drawable/icon_green"
+                  android:drawableBottom="@drawable/icon_yellow"
+                />
+
+        <TextView android:id="@+id/textview_drawable_5_1"
+                  android:layout_height="wrap_content"
+                  android:layout_width="wrap_content"
+                  android:drawableLeft="@drawable/icon_black"
+                  android:drawableRight="@drawable/icon_black"
+                  android:drawableStart="@drawable/icon_blue"
+                  android:drawableEnd="@drawable/icon_red"
+                  android:drawableTop="@drawable/icon_green"
+                  android:drawableBottom="@drawable/icon_yellow"
+                />
+
+    </LinearLayout>
+
+    <LinearLayout android:orientation="vertical"
+                  android:layout_width="match_parent"
+                  android:layout_height="match_parent"
+                  android:layoutDirection="rtl">
+
+        <TextView android:id="@+id/textview_drawable_4_2"
+                  android:layout_height="wrap_content"
+                  android:layout_width="wrap_content"
+                  android:drawableStart="@drawable/icon_blue"
+                  android:drawableEnd="@drawable/icon_red"
+                  android:drawableTop="@drawable/icon_green"
+                  android:drawableBottom="@drawable/icon_yellow"
+                />
+
+        <TextView android:id="@+id/textview_drawable_5_2"
+                  android:layout_height="wrap_content"
+                  android:layout_width="wrap_content"
+                  android:drawableLeft="@drawable/icon_black"
+                  android:drawableRight="@drawable/icon_black"
+                  android:drawableStart="@drawable/icon_blue"
+                  android:drawableEnd="@drawable/icon_red"
+                  android:drawableTop="@drawable/icon_green"
+                  android:drawableBottom="@drawable/icon_yellow"
+                />
+
+    </LinearLayout>
+
+</LinearLayout>
diff --git a/tests/tests/view/res/layout/using_views_layout.xml b/tests/tests/view/res/layout/using_views_layout.xml
new file mode 100644
index 0000000..b35aa08
--- /dev/null
+++ b/tests/tests/view/res/layout/using_views_layout.xml
@@ -0,0 +1,77 @@
+<?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.
+-->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <TextView
+        android:id="@+id/country"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/country"/>
+
+    <EditText
+        android:id="@+id/entry"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@android:drawable/editbox_background"
+        android:layout_below="@id/country"/>
+
+    <Button
+        android:id="@+id/cancel"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/entry"
+        android:layout_alignParentRight="true"
+        android:layout_marginLeft="10dip"
+        android:text="@string/id_cancel"/>
+
+    <Button
+        android:id="@+id/ok"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_toLeftOf="@id/cancel"
+        android:layout_alignTop="@id/cancel"
+        android:text="@string/id_ok"/>
+
+    <TextView
+        android:id="@+id/symbol"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/ok"
+        android:text="@string/symbol"/>
+
+    <TextView
+        android:id="@+id/symbolball"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/symbol"
+        android:layout_marginLeft="20dip"/>
+
+    <TextView
+        android:id="@+id/warning"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="#aa0000"
+        android:layout_below="@id/symbolball"
+        android:text="@string/country_warning"
+        android:visibility="invisible"
+        android:layout_weight="2"/>
+
+</RelativeLayout>
+
diff --git a/tests/tests/view/res/layout/view_layout.xml b/tests/tests/view/res/layout/view_layout.xml
new file mode 100644
index 0000000..fa817dc
--- /dev/null
+++ b/tests/tests/view/res/layout/view_layout.xml
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+ * Copyright (C) 2008 Esmertec AG.
+ * Copyright (C) 2008 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.
+ */
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/viewlayout_root"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <android.view.cts.MockView
+        android:id="@+id/mock_view"
+        android:layout_width="100px"
+        android:layout_height="200px"/>
+
+    <android.view.cts.MockView
+        android:id="@+id/scroll_view"
+        android:layout_width="100px"
+        android:layout_height="200px"
+        android:scrollbars="horizontal|vertical"
+        android:fadingEdge="horizontal|vertical"
+        android:fadingEdgeLength="20px"/>
+
+    <android.view.cts.MockView
+        android:id="@+id/scroll_view_2"
+        android:layout_width="100px"
+        android:layout_height="200px"
+        android:scrollbars="horizontal|vertical"
+        android:requiresFadingEdge="horizontal|vertical"
+        android:fadingEdgeLength="20px"/>
+
+    <View
+        android:id="@+id/fit_windows"
+        android:fitsSystemWindows="true"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"/>
+
+    <android.view.cts.MockView
+            android:id="@+id/mock_view_padding_full"
+            android:layout_width="200px"
+            android:layout_height="200px"
+            android:padding="0px"
+            android:background="@drawable/padding_0" />
+
+    <android.view.cts.MockView
+            android:id="@+id/mock_view_padding_left"
+            android:layout_width="200px"
+            android:layout_height="200px"
+            android:paddingLeft="0px"
+            android:background="@drawable/padding_0" />
+
+    <android.view.cts.MockView
+            android:id="@+id/mock_view_padding_right"
+            android:layout_width="200px"
+            android:layout_height="200px"
+            android:paddingRight="0px"
+            android:background="@drawable/padding_0" />
+
+    <android.view.cts.MockView
+            android:id="@+id/mock_view_padding_top"
+            android:layout_width="200px"
+            android:layout_height="200px"
+            android:paddingTop="0px"
+            android:background="@drawable/padding_0" />
+
+    <android.view.cts.MockView
+            android:id="@+id/mock_view_padding_bottom"
+            android:layout_width="200px"
+            android:layout_height="200px"
+            android:paddingBottom="0dp"
+            android:background="@drawable/padding_0" />
+
+    <android.view.cts.MockView
+            android:id="@+id/mock_view_padding_runtime_updated"
+            android:layout_width="200px"
+            android:layout_height="200px"
+            android:paddingStart="8px"
+            android:paddingEnd="8px"
+            android:background="@drawable/no_padding" />
+
+    <View
+        android:id="@+id/background_tint"
+        android:backgroundTint="@android:color/white"
+        android:backgroundTintMode="src_over"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content" />
+
+</LinearLayout>
diff --git a/tests/tests/view/res/layout/view_layout_position.xml b/tests/tests/view/res/layout/view_layout_position.xml
new file mode 100644
index 0000000..7d28186
--- /dev/null
+++ b/tests/tests/view/res/layout/view_layout_position.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+ * Copyright (C) 2008 Esmertec AG.
+ * Copyright (C) 2008 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.
+ */
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <LinearLayout
+            android:id="@+id/testparent"
+            android:layout_marginLeft = "1dip"
+            android:layout_marginTop = "2dip"
+            android:layout_marginRight = "3dip"
+            android:layout_marginBottom = "4dip"
+            android:orientation="vertical"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+        <View
+            android:id="@+id/testview"
+            android:layout_marginLeft = "5dip"
+            android:layout_marginTop = "6dip"
+            android:layout_marginRight = "7dip"
+            android:layout_marginBottom = "8dip"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"/>
+
+    </LinearLayout>
+</LinearLayout>
diff --git a/tests/tests/view/res/layout/view_visibility_layout.xml b/tests/tests/view/res/layout/view_visibility_layout.xml
new file mode 100644
index 0000000..92d22ed
--- /dev/null
+++ b/tests/tests/view/res/layout/view_visibility_layout.xml
@@ -0,0 +1,41 @@
+<?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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <View
+        android:id="@+id/textview1"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:visibility="visible"/>
+
+    <View
+        android:id="@+id/textview2"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:visibility="invisible"/>
+
+    <View
+        android:id="@+id/textview3"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:visibility="gone"/>
+</LinearLayout>
+
diff --git a/tests/src/android/view/cts/MenuInflaterStubActivity.java b/tests/tests/view/res/layout/viewgroup_margin_layout.xml
similarity index 68%
copy from tests/src/android/view/cts/MenuInflaterStubActivity.java
copy to tests/tests/view/res/layout/viewgroup_margin_layout.xml
index 693fe13..8e750c9 100644
--- a/tests/src/android/view/cts/MenuInflaterStubActivity.java
+++ b/tests/tests/view/res/layout/viewgroup_margin_layout.xml
@@ -1,4 +1,5 @@
-/*
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
  * Copyright (C) 2008 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,17 +13,12 @@
  * 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 android.view.cts;
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:padding="10dip"
+    android:layout_width="200dip"
+    android:layout_height="300dip">
+</LinearLayout>
 
-import android.app.Activity;
-import android.view.MenuInflater;
-
-/**
- * Stub activity for testing {@link MenuInflater}.
- *
- * @see MenuInflaterTest
- */
-public class MenuInflaterStubActivity extends Activity {
-}
diff --git a/tests/tests/view/res/layout/viewgrouptest_stub.xml b/tests/tests/view/res/layout/viewgrouptest_stub.xml
new file mode 100644
index 0000000..1160d0e
--- /dev/null
+++ b/tests/tests/view/res/layout/viewgrouptest_stub.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (C) 2008 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.
+ -->
+
+<android.view.cts.MockLinearLayout
+        xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:id="@+id/mocklinearlayout">
+
+    <!-- view1 goes on top -->
+    <TextView
+        android:id="@+id/viewgrouptest_stub"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+    />
+
+</android.view.cts.MockLinearLayout>
+
diff --git a/tests/tests/view/res/layout/viewstub_layout.xml b/tests/tests/view/res/layout/viewstub_layout.xml
new file mode 100644
index 0000000..5c7ff22
--- /dev/null
+++ b/tests/tests/view/res/layout/viewstub_layout.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2008 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.
+ -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <ViewStub android:id="@+id/viewstub"
+        android:inflatedId="@+id/inflated_id"
+        android:layout="@layout/textview_layout"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content" />
+
+</LinearLayout>
diff --git a/tests/tests/view/res/layout/viewtreeobserver_layout.xml b/tests/tests/view/res/layout/viewtreeobserver_layout.xml
new file mode 100644
index 0000000..66e98b2
--- /dev/null
+++ b/tests/tests/view/res/layout/viewtreeobserver_layout.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                android:id="@+id/linearlayout"
+                android:orientation="vertical"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+
+    <View android:id="@+id/view1"
+        android:layout_width="match_parent"
+        android:layout_height="10dip"
+        android:focusable="true"/>
+
+    <View android:id="@+id/view2"
+        android:layout_width="match_parent"
+        android:layout_height="10dip"
+        android:focusable="true"/>
+
+    <Button android:id="@+id/button1"
+        android:layout_width="wrap_content"
+        android:layout_height="10dip" />
+
+</LinearLayout>
+
diff --git a/tests/src/android/view/cts/UsingViewsStubActivity.java b/tests/tests/view/res/layout/windowstub_addlayout.xml
similarity index 60%
copy from tests/src/android/view/cts/UsingViewsStubActivity.java
copy to tests/tests/view/res/layout/windowstub_addlayout.xml
index eb3aba7..0d6399e 100644
--- a/tests/src/android/view/cts/UsingViewsStubActivity.java
+++ b/tests/tests/view/res/layout/windowstub_addlayout.xml
@@ -1,4 +1,5 @@
-/*
+<?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");
@@ -12,21 +13,15 @@
  * 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 android.view.cts;
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
 
-import android.app.Activity;
-import android.os.Bundle;
-import com.android.cts.stub.R;
+    <TextView android:id="@+id/listview_addwindow"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content" />
 
-/**
- * A simple activity to test "Using Views"
- */
-public class UsingViewsStubActivity extends Activity {
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.using_views_layout);
-    }
-}
+</ScrollView>
diff --git a/tests/src/android/view/cts/MenuInflaterStubActivity.java b/tests/tests/view/res/layout/windowstub_layout.xml
similarity index 68%
copy from tests/src/android/view/cts/MenuInflaterStubActivity.java
copy to tests/tests/view/res/layout/windowstub_layout.xml
index 693fe13..0cf7d6d 100644
--- a/tests/src/android/view/cts/MenuInflaterStubActivity.java
+++ b/tests/tests/view/res/layout/windowstub_layout.xml
@@ -1,4 +1,5 @@
-/*
+<?xml version="1.0" encoding="utf-8"?>
+<!--
  * Copyright (C) 2008 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,17 +13,10 @@
  * 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 android.view.cts;
-
-import android.app.Activity;
-import android.view.MenuInflater;
-
-/**
- * Stub activity for testing {@link MenuInflater}.
- *
- * @see MenuInflaterTest
- */
-public class MenuInflaterStubActivity extends Activity {
-}
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+        android:id="@+id/listview_window"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" >
+     </TextView>
diff --git a/tests/tests/view/res/layout/windowstub_presentation.xml b/tests/tests/view/res/layout/windowstub_presentation.xml
new file mode 100644
index 0000000..80490c4
--- /dev/null
+++ b/tests/tests/view/res/layout/windowstub_presentation.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2013 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.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent">
+    <Button
+        android:id="@+id/presentation_button1"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:layout_weight="1"
+        android:text="@string/vertical_text_1" />
+    <Button
+        android:id="@+id/presentation_button2"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:layout_weight="1"
+        android:text="@string/vertical_text_2" />
+    <Button
+        android:id="@+id/presentation_button3"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:layout_weight="1"
+        android:text="@string/vertical_text_3" />
+</LinearLayout>
diff --git a/tests/tests/view/res/menu/browser.xml b/tests/tests/view/res/menu/browser.xml
new file mode 100644
index 0000000..29e5149
--- /dev/null
+++ b/tests/tests/view/res/menu/browser.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <group android:id="@+id/MAIN_MENU">
+        <item android:id="@+id/goto_menu_id"
+            android:title="@string/hello_world"
+            android:alphabeticShortcut="l"/>
+    </group>
+
+</menu>
diff --git a/tests/tests/view/res/menu/category_order.xml b/tests/tests/view/res/menu/category_order.xml
new file mode 100644
index 0000000..06a6993
--- /dev/null
+++ b/tests/tests/view/res/menu/category_order.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <!-- This group uses the default category. -->
+    <group android:id="@+id/most_used_items">
+
+        <item android:id="@+id/last_most_item"
+            android:orderInCategory="5"
+            android:title="Last most often" />
+
+        <item android:id="@+id/middle_most_item"
+            android:orderInCategory="3"
+            android:title="Middle most often" />
+
+        <item android:id="@+id/first_most_item"
+            android:orderInCategory="1"
+            android:title="First most often" />
+
+    </group>
+
+    <!-- This group uses the secondary category, which is used for less oftenly used items.
+         Notice these items will show up after the above items.
+         (Furthermore, notice how the orders in each category are independent from the other
+         category.) -->
+    <group android:id="@+id/least_used_items"
+        android:menuCategory="secondary">
+
+        <item android:id="@+id/last_least_item"
+            android:orderInCategory="4"
+            android:title="Last least often" />
+
+        <item android:id="@+id/middle_least_item"
+            android:orderInCategory="2"
+            android:title="Middle least often" />
+
+        <item android:id="@+id/first_least_item"
+            android:orderInCategory="0"
+            android:title="First least often" />
+
+    </group>
+
+</menu>
diff --git a/tests/tests/view/res/menu/checkable.xml b/tests/tests/view/res/menu/checkable.xml
new file mode 100644
index 0000000..339d9c9
--- /dev/null
+++ b/tests/tests/view/res/menu/checkable.xml
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <!-- Checkable items appear only in submenus or context menus. -->
+
+    <!-- Carefully look at the attribute name checkableBehavior on groups, but
+         the attribute name checkable on items. The checkableBehavior encompasses
+         the number of items that will be checkable within that group. -->
+
+    <item android:title="None">
+        <menu>
+            <!-- The none checkableBehavior is default, but we explicitly show it here. -->
+            <group android:id="@+id/noncheckable_group"
+                    android:checkableBehavior="none">
+                <!-- Notice how these items inherit from the group. -->
+                <item android:id="@+id/noncheckable_item_1"
+                        android:title="Item 1" />
+                <item android:id="@+id/noncheckable_item_2"
+                        android:title="Item 2" />
+                <item android:id="@+id/noncheckable_item_3"
+                        android:title="Item 3" />
+            </group>
+        </menu>
+    </item>
+
+    <item android:title="All">
+        <menu>
+            <group android:id="@+id/checkable_group"
+                    android:checkableBehavior="all">
+                <!-- Notice how these items inherit from the group. -->
+                <item android:id="@+id/checkable_item_1"
+                        android:title="Item 1" />
+                <item android:id="@+id/checkable_item_2"
+                        android:title="Item 2"
+                        android:checked="true" />
+                <item android:id="@+id/checkable_item_3"
+                        android:title="Item 3"
+                        android:checked="true" />
+            </group>
+        </menu>
+    </item>
+
+    <item android:title="Single">
+        <menu>
+            <group android:id="@+id/exclusive_checkable_group"
+                    android:checkableBehavior="single">
+                <!-- Notice how these items inherit from the group. -->
+                <item android:id="@+id/exclusive_checkable_item_1"
+                        android:title="Item 1" />
+                <item android:id="@+id/exclusive_checkable_item_2"
+                        android:title="Item 2" />
+                <item android:id="@+id/exclusive_checkable_item_3"
+                        android:title="Item 3"
+                        android:checked="true" />
+            </group>
+        </menu>
+    </item>
+
+    <item android:title="All without group"
+            android:id="@+id/submenu">
+        <menu>
+            <!-- Notice how these items have each set. -->
+            <item android:id="@+id/nongroup_checkable_item_1"
+                    android:title="Item 1"
+                    android:checkable="true" />
+            <item android:id="@+id/nongroup_checkable_item_2"
+                    android:title="Item 2"
+                    android:checkable="true"
+                    android:checked="true" />
+            <item android:id="@+id/nongroup_checkable_item_3"
+                    android:title="Item 3"
+                    android:checkable="true"
+                    android:checked="true" />
+        </menu>
+    </item>
+
+</menu>
diff --git a/tests/tests/view/res/menu/menu_searchview.xml b/tests/tests/view/res/menu/menu_searchview.xml
new file mode 100644
index 0000000..d9f6475
--- /dev/null
+++ b/tests/tests/view/res/menu/menu_searchview.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2011 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.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:id="@+id/menu_search"
+        android:title="Search"
+        android:icon="@android:drawable/ic_menu_search"
+        android:showAsAction="ifRoom"
+        android:actionLayout="@layout/searchview" />
+</menu>
\ No newline at end of file
diff --git a/tests/tests/view/res/menu/title_icon.xml b/tests/tests/view/res/menu/title_icon.xml
new file mode 100644
index 0000000..d8cdc52
--- /dev/null
+++ b/tests/tests/view/res/menu/title_icon.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:id="@+id/start"
+        android:title="Start"
+        android:icon="@drawable/start" />
+
+    <item android:id="@+id/pass"
+        android:title="Pass"
+        android:icon="@drawable/pass" />
+
+    <item android:id="@+id/failed"
+        android:title="Failed"
+        android:icon="@drawable/failed" />
+
+</menu>
diff --git a/tests/tests/view/res/menu/visible_shortcut.xml b/tests/tests/view/res/menu/visible_shortcut.xml
new file mode 100644
index 0000000..4d6f362
--- /dev/null
+++ b/tests/tests/view/res/menu/visible_shortcut.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:id="@+id/visible_item"
+        android:title="Visible"
+        android:alphabeticShortcut="a" />
+
+    <item android:id="@+id/hidden_item"
+        android:title="Hidden"
+        android:visible="false"
+        android:alphabeticShortcut="b" />
+
+    <group android:id="@+id/hidden_group"
+        android:visible="false">
+
+        <item android:id="@+id/hidden_by_group"
+            android:title="Hidden by group"
+            android:alphabeticShortcut="c" />
+
+    </group>
+
+</menu>
diff --git a/tests/tests/view/res/values/arrays.xml b/tests/tests/view/res/values/arrays.xml
new file mode 100644
index 0000000..71e0133
--- /dev/null
+++ b/tests/tests/view/res/values/arrays.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2008 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>
+    <item type="integer" name="reference" format="integer">101</item>
+
+      <string-array name="strings">
+        <item>zero</item>
+        <item>1</item>
+        <item>@string/reference</item>
+    </string-array>
+
+    <integer-array name="integers">
+        <item>0</item>
+        <item>1</item>
+        <item>@integer/reference</item>
+    </integer-array>
+
+    <array name="difficultyLevel">
+        <item>Easy</item>
+        <item>Medium</item>
+        <item>Hard</item>
+    </array>
+
+    <string-array name="string">
+        <item>Test String 1</item>
+        <item>Test String 2</item>
+        <item>Test String 3</item>
+    </string-array>
+
+    <integer-array name="table_row_layout">
+        <item>1</item>
+        <item>2</item>
+        <item>3</item>
+        <item>4</item>
+        <item>5</item>
+        <item>6</item>
+        <item>7</item>
+        <item>8</item>
+        <item>9</item>
+        <item>10</item>
+    </integer-array>
+</resources>
diff --git a/tests/tests/view/res/values/attrs.xml b/tests/tests/view/res/values/attrs.xml
new file mode 100644
index 0000000..4c3d9db
--- /dev/null
+++ b/tests/tests/view/res/values/attrs.xml
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2008 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>
+    <declare-styleable name="Style1">
+        <attr name="Type1" format="integer">
+            <enum name="type" value="28" />
+            <enum name="data" value="0xff00ff00" />
+            <enum name="asset_cookie" value="0" />
+            <enum name="resource_id" value="0" />
+            <enum name="changing_config" value="0" />
+        </attr>
+        <attr name="Type2" format="integer">
+            <enum name="type" value="28" />
+            <enum name="data" value="0xff0000ff" />
+            <enum name="asset_cookie" value="0" />
+            <enum name="resource_id" value="0" />
+            <enum name="changing_config" value="0" />
+        </attr>
+    </declare-styleable>
+    <attr name="type1" format="boolean"/>
+    <attr name="type2" format="boolean"/>
+    <attr name="type3" format="color"/>
+    <attr name="type4" format="reference|color"/>
+    <attr name="type5" format="dimension"/>
+    <attr name="type6" format="dimension"/>
+    <attr name="type7" format="dimension"/>
+    <attr name="type8" format="reference"/>
+    <attr name="type9" format="float"/>
+    <attr name="type10" format="fraction"/>
+    <attr name="type11" format="integer"/>
+    <attr name="type12" format="integer"/>
+    <attr name="type13" format="reference|string"/>
+    <attr name="type14" format="string"/>
+    <attr name="type15" format="reference"/>
+    <attr name="type16" format="string"/>
+    <declare-styleable name="style1">
+        <attr name="type1"/>
+        <attr name="type2"/>
+        <attr name="type3"/>
+        <attr name="type4"/>
+        <attr name="type5"/>
+        <attr name="type6"/>
+        <attr name="type7"/>
+        <attr name="type8"/>
+        <attr name="type9"/>
+        <attr name="type10"/>
+        <attr name="type11"/>
+        <attr name="type12"/>
+        <attr name="type13"/>
+        <attr name="type14"/>
+        <attr name="type15"/>
+        <attr name="type16"/>
+    </declare-styleable>
+    <attr name="testEnum">
+        <enum name="val1" value="1" />
+        <enum name="val2" value="2" />
+        <enum name="val10" value="10" />
+    </attr>
+    <attr name="testFlags">
+        <flag name="bit1" value="0x1" />
+        <flag name="bit2" value="0x2" />
+        <flag name="bit31" value="0x40000000" />
+    </attr>
+    <attr name="testString" format="string" />
+    <declare-styleable name="EnumStyle">
+        <attr name="testEnum" />
+    </declare-styleable>
+    <declare-styleable name="FlagStyle">
+        <attr name="testFlags" />
+    </declare-styleable>
+    <declare-styleable name="TestConfig">
+        <attr name="testString" />
+    </declare-styleable>
+    <!-- Size of text. Recommended dimension type for text is "sp" for scaled-pixels (example: 15sp).
+         Supported values include the following:<p/>
+    <ul>
+        <li><b>px</b> Pixels</li>
+        <li><b>sp</b> Scaled pixels (scaled to relative pixel size on screen). See {@link android.util.DisplayMetrics} for more information.</li>
+        <li><b>pt</b> Points</li>
+        <li><b>dip</b> Device independent pixels. See {@link android.util.DisplayMetrics} for more information.</li>
+    </ul>
+    -->
+    <attr name="textSize" format="dimension" />
+    <attr name="typeface">
+        <enum name="normal" value="0" />
+        <enum name="sans" value="1" />
+        <enum name="serif" value="2" />
+        <enum name="monospace" value="3" />
+    </attr>
+    <!-- Default text typeface style. -->
+    <attr name="textStyle">
+        <flag name="normal" value="0" />
+        <flag name="bold" value="1" />
+        <flag name="italic" value="2" />
+    </attr>
+    <!-- Color of text (usually same as colorForeground). -->
+    <attr name="textColor" format="reference|color" />
+    <!-- Color of highlighted text. -->
+    <attr name="textColorHighlight" format="reference|color" />
+    <!-- Color of hint text (displayed when the field is empty). -->
+    <attr name="textColorHint" format="reference|color" />
+    <!-- Color of link text (URLs). -->
+    <attr name="textColorLink" format="reference|color" />
+    <declare-styleable name="TextAppearance">
+        <attr name="textColor"/>
+        <attr name="textSize"/>
+        <attr name="textStyle"/>
+        <attr name="typeface"/>
+        <attr name="textColorHighlight"/>
+        <attr name="textColorHint"/>
+        <attr name="textColorLink"/>
+    </declare-styleable>
+    <!-- Integer used to uniquely identify theme overrides. -->
+    <attr name="themeType" format="integer"/>
+    <!-- Theme reference used to override parent theme. -->
+    <attr name="themeOverrideAttr" format="reference"/>
+
+    <!-- Drawable theming attributes -->
+    <attr name="themeBoolean" />
+    <attr name="themeColor" />
+    <attr name="themeFloat" />
+    <attr name="themeInteger" />
+    <attr name="themeDimension" />
+    <attr name="themeDrawable" />
+    <attr name="themeBitmap" />
+    <attr name="themeNinePatch" />
+    <attr name="themeGravity" />
+    <attr name="themeTileMode" />
+    <attr name="themeAngle" />
+</resources>
diff --git a/tests/src/android/view/cts/MenuInflaterStubActivity.java b/tests/tests/view/res/values/colors.xml
similarity index 60%
copy from tests/src/android/view/cts/MenuInflaterStubActivity.java
copy to tests/tests/view/res/values/colors.xml
index 693fe13..f3cc325 100644
--- a/tests/src/android/view/cts/MenuInflaterStubActivity.java
+++ b/tests/tests/view/res/values/colors.xml
@@ -1,4 +1,5 @@
-/*
+<?xml version="1.0" encoding="utf-8"?>
+<!--
  * Copyright (C) 2008 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,17 +13,14 @@
  * 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 android.view.cts;
-
-import android.app.Activity;
-import android.view.MenuInflater;
-
-/**
- * Stub activity for testing {@link MenuInflater}.
- *
- * @see MenuInflaterTest
- */
-public class MenuInflaterStubActivity extends Activity {
-}
+<resources>
+    <drawable name="red">#7f00</drawable>
+    <drawable name="blue">#770000ff</drawable>
+    <drawable name="black">#77ffffff</drawable>
+    <drawable name="yellow">#77ffff00</drawable>
+    <color name="testcolor1">#ff00ff00</color>
+    <color name="testcolor2">#ffff0000</color>
+    <color name="failColor">#ff0000ff</color>
+</resources>
diff --git a/tests/tests/view/res/values/strings.xml b/tests/tests/view/res/values/strings.xml
new file mode 100644
index 0000000..c167278
--- /dev/null
+++ b/tests/tests/view/res/values/strings.xml
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="permlab_testGranted">Test Granted</string>
+    <string name="permdesc_testGranted">Used for running CTS tests, for testing operations
+        where we have the permission.</string>
+    <string name="permlab_testDynamic">Test Dynamic</string>
+    <string name="permdesc_testDynamic">Used for running CTS tests, for testing adding
+        dynamic permissions.</string>
+    <string name="permlab_testDenied">Test Denied</string>
+    <string name="permdesc_testDenied">Used for running CTS tests, for testing operations
+        where we do not have the permission.</string>
+    <string name="explain">1. click start. \n2. if above image shaked, then press pass button,
+         else press failed button.</string>
+    <string name="text_view_hello">Hello! Text view!</string>
+    <string name="text_view_hello_two_lines">Hello! \nText view!</string>
+    <string name="text_view_simple_hint">This is a hint.</string>
+    <string name="text_view_hint">This is a string for testing hint of textview.</string>
+    <string name="activity_forwarding">App/Forwarding</string>
+    <string name="forwarding">$$$</string>
+    <string name="go">Go</string>
+    <string name="back">Back</string>
+    <string name="forward_target">
+        Press back button and notice we don\'t see the previous activity.
+    </string>
+    <string name="edit_text">testing</string>
+    <string name="text">DialogTest</string>
+    <string name="text_country">Country</string>
+    <string name="text_name">Name</string>
+    <string name="hello_world">Hello, World!</string>
+    <string name="hello_android">Hello, Android!</string>
+    <string name="alert_dialog_username">Name:</string>
+    <string name="alert_dialog_password">Password:</string>
+    <string name="alert_dialog_positive">Positive</string>
+    <string name="alert_dialog_negative">Negative</string>
+    <string name="alert_dialog_neutral">Neutral</string>
+    <string name="notify">Notify </string>
+    <string name="tabs_1">testing</string>
+    <string name="table_layout_first">first</string>
+    <string name="table_layout_second">second</string>
+    <string name="table_layout_third">third</string>
+    <string name="table_layout_long">Very long to make the string out of the screen</string>
+    <string name="chronometer_text">Test Chronometer</string>
+    <string name="am">AM</string>
+    <string name="pm">PM</string>
+    <string name="viewgroup_test">ViewGroup test</string>
+    <string name="viewanimator_test">ViewAnimator test</string>
+    <string name="id_ok">OK</string>
+    <string name="id_cancel">Cancel</string>
+    <string name="context_test_string1">This is %s string.</string>
+    <string name="context_test_string2">This is test string.</string>
+    <string name="animationutils_test_instructions">Choose different animations</string>
+    <string name="animationutils_test_alpha">Alpha animation</string>
+    <string name="animationutils_test_scale">Scale animation</string>
+    <string name="animationutils_test_rotate">Rotate animation</string>
+    <string name="animationutils_test_translate">Translate animation</string>
+    <string name="animationutils_test_set">Animation set</string>
+    <string name="animationutils_test_layout">Layout animation</string>
+    <string name="animationutils_test_gridlayout">Grid layout animation</string>
+    <string name="twolinelistitem_test_text1">text1</string>
+    <string name="twolinelistitem_test_text2">text2</string>
+    <string name="metadata_text">metadata text</string>
+    <string name="horizontal_text_1">horizontal 1</string>
+    <string name="horizontal_text_2">horizontal 2</string>
+    <string name="horizontal_text_3">horizontal 3</string>
+    <string name="vertical_text_1">vertical 1</string>
+    <string name="vertical_text_2">vertical 2</string>
+    <string name="vertical_text_3">vertical 3</string>
+    <string name="reference">here</string>
+    <string name="coerceIntegerToString">100</string>
+    <string name="coerceBooleanToString">true</string>
+    <string name="coerceColorToString">#fff</string>
+    <string name="coerceFloatToString">100.0</string>
+    <string name="coerceDimensionToString">100px</string>
+    <string name="coerceFractionToString">100<xliff:g id="percent">%</xliff:g></string>
+    <string name="formattedStringNone">Format[]</string>
+    <string name="formattedStringOne">Format[<xliff:g id="format">%d</xliff:g>]</string>
+    <string name="formattedStringTwo">Format[<xliff:g id="format">%3$d,%2$s</xliff:g>]</string>
+    <string name="checkboxpref_key">checkboxpref_key</string>
+   <string name="checkboxpref_title">title of preference</string>
+   <string name="checkboxpref_summary">summary of preference</string>
+   <string name="checkboxpref_summary_on">summary on of preference</string>
+   <string name="checkboxpref_summary_off">summary off of preference</string>
+   <string name="checkboxpref_depend">checkboxpref_depend</string>
+   <string name="checkboxpref_depend_title"> depend title of preference</string>
+   <string name="checkboxpref_depend_summary"> depend summary of preference</string>
+   <string name="edittextpref_key">edittextpref_key</string>
+   <string name="edittextpref_default_value">default value of preference</string>
+   <string name="edittextpref_title">title of edit text preference</string>
+   <string name="edittextpref_summary">summary of edit text preference</string>
+   <string name="edittextpref_dialog_title">dialog title of edit text preference</string>
+   <string name="edittextpref_text">text of  edit text preference</string>
+   <string name="listpref_key">listpref_key</string>
+   <string name="listpref_title">title of list preference</string>
+   <string name="listpref_summary">summary of list preference</string>
+   <string name="listpref_dialogtitle">dialog title of list preference</string>
+   <string name="easy">Easy</string>
+   <string name="medium">Medium</string>
+   <string name="hard">Hard</string>
+   <string name="footer_view">Footer view</string>
+   <string name="header_view">Header view</string>
+   <string name="dialogpref_title">title of dialog preference </string>
+   <string name="dialogpref_dialog_title">dialog title of dialog preference </string>
+   <string name="dialogpref_key">dialogpref_key</string>
+   <string name="dialogpref_default_value">default value of dialog preference</string>
+   <string name="dialogpref_summary">summary of dialog preference</string>
+   <string name="dialogpref_message">message of dialog preference</string>
+   <string name="dialogpref_sure">Sure</string>
+   <string name="dialogpref_cancel">Cancel</string>
+   <string name="pref_key">pref_key</string>
+   <string name="pref_title">title of preference</string>
+   <string name="pref_summary">summary of preference</string>
+   <string name="pref_depend_key">pref_depend_key</string>
+   <string name="pref_depend_title"> depend title of preference</string>
+   <string name="pref_depend_summary"> depend summary of preference</string>
+   <string name="android_intent_action_preference">android.intent.action.PREFERENCE</string>
+   <string name="def_pref_key">def_pref_key</string>
+   <string name="def_pref_title">default preference</string>
+   <string name="def_pref_summary">This is default preference of cts</string>
+   <string name="relative_view1">view 1</string>
+   <string name="relative_view2">view 2</string>
+   <string name="relative_view3">view 3</string>
+   <string name="relative_view4">view 4</string>
+   <string name="relative_view5">view 5</string>
+   <string name="relative_view6">view 6</string>
+   <string name="relative_view7">view 7</string>
+   <string name="relative_view8">view 8</string>
+   <string name="relative_view9">view 9</string>
+   <string name="relative_view10">view 10</string>
+   <string name="relative_view11">view 11</string>
+   <string name="relative_view12">view 12</string>
+   <string name="relative_view13">view 13</string>
+   <string name="country">Country:</string>
+   <string name="symbol">Symbol:</string>
+   <string name="country_warning">No such country registered</string>
+   <string name="version_cur">base</string>
+   <string name="version_old">base</string>
+   <string name="version_v3">base</string>
+   <string name="authenticator_label">Android CTS</string>
+   <string name="search_label">Android CTS</string>
+   <string name="tag1">tag 1</string>
+   <string name="tag2">tag 2</string>
+
+   <string name="button">Button</string>
+   <string name="holo_test">Holo Test</string>
+   <string name="holo_generator">Holo Generator</string>
+   <string name="holo_light_test">Holo Light Test</string>
+   <string name="holo_light_generator">Holo Light Generator</string>
+   <string name="reference_image">Reference Image: </string>
+   <string name="generated_image">Generated Image: </string>
+   <string name="themes_prompt">Select a Theme:</string>
+   <string name="sample_text">Sample text goes here. I wanted something creative and whimsical
+but then I just got bored...</string>
+    <string name="long_text">This is a really long string which exceeds the width of the view.
+New devices have a much larger screen which actually enables long strings to be displayed
+with no fading. I have made this string longer to fix this case. If you are correcting this
+text, I would love to see the kind of devices you guys now use! Guys, maybe some devices need longer string!
+I think so, so how about double this string, like copy and paste!
+This is a really long string which exceeds the width of the view.
+New devices have a much larger screen which actually enables long strings to be displayed
+with no fading. I have made this string longer to fix this case. If you are correcting this
+text, I would love to see the kind of devices you guys now use! Guys, maybe some devices need longer string!
+I think so, so how about double this string, like copy and paste! </string>
+    <string name="rectangle200">"M 0,0 l 200,0 l 0, 200 l -200, 0 z"</string>
+</resources>
diff --git a/tests/tests/view/res/values/styles.xml b/tests/tests/view/res/values/styles.xml
new file mode 100644
index 0000000..20c80f8
--- /dev/null
+++ b/tests/tests/view/res/values/styles.xml
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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 xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <style name="Whatever">
+        <item name="type1">true</item>
+        <item name="type2">false</item>
+        <item name="type3">#ff0000ff</item>
+        <item name="type4">#ff00ff00</item>
+        <item name="type5">0.75px</item>
+        <item name="type6">10px</item>
+        <item name="type7">18px</item>
+        <item name="type8">@drawable/pass</item>
+        <item name="type9">3.14</item>
+        <item name="type10">100%</item>
+        <item name="type11">365</item>
+        <item name="type12">86400</item>
+        <item name="type13">@string/hello_android</item>
+        <item name="type14">TypedArray Test!</item>
+        <item name="type15">@array/difficultyLevel</item>
+        <item name="type16">Typed Value!</item>
+    </style>
+
+    <style name="TextViewWithoutColorAndAppearance">
+        <item name="android:textSize">18sp</item>
+    </style>
+
+    <style name="TextViewWithColorButWithOutAppearance">
+        <item name="android:textColor">#ff0000ff</item>
+    </style>
+
+    <style name="TextViewWithColorAndAppearance">
+        <item name="android:textColor">#ff0000ff</item>
+        <item name="android:textAppearance">@style/TextAppearance.WithColor</item>
+    </style>
+
+    <style name="TextViewWithoutColorButWithAppearance">
+        <item name="android:textAppearance">@style/TextAppearance.WithColor</item>
+    </style>
+
+    <style name="TextAppearance" parent="android:TextAppearance">
+    </style>
+
+    <style name="TextAppearance.WithColor">
+        <item name="android:textColor">#ffff0000</item>
+    </style>
+
+    <style name="TextAppearance.All">
+        <item name="android:textColor">@drawable/black</item>
+        <item name="android:textSize">20px</item>
+        <item name="android:textStyle">bold</item>
+        <item name="android:textColorHint">@drawable/red</item>
+        <item name="android:textColorLink">@drawable/blue</item>
+        <item name="android:textColorHighlight">@drawable/yellow</item>
+    </style>
+
+    <style name="TextAppearance.Colors">
+        <item name="android:textColor">@drawable/black</item>
+        <item name="android:textColorHint">@drawable/blue</item>
+        <item name="android:textColorLink">@drawable/yellow</item>
+        <item name="android:textColorHighlight">@drawable/red</item>
+    </style>
+
+    <style name="TextAppearance.NotColors">
+        <item name="android:textSize">17px</item>
+        <item name="android:typeface">sans</item>
+        <item name="android:textStyle">normal</item>
+    </style>
+
+    <style name="TextAppearance.Style">
+        <item name="android:textStyle">normal</item>
+    </style>
+
+    <style name="TestEnum1">
+        <item name="testEnum">val1</item>
+    </style>
+
+    <style name="TestEnum2">
+        <item name="testEnum">val2</item>
+    </style>
+
+    <style name="TestEnum10">
+        <item name="testEnum">val10</item>
+    </style>
+
+    <style name="TestFlag1">
+        <item name="testFlags">bit1</item>
+    </style>
+
+    <style name="TestFlag2">
+        <item name="testFlags">bit2</item>
+    </style>
+
+    <style name="TestFlag31">
+        <item name="testFlags">bit31</item>
+    </style>
+
+    <style name="TestFlag1And2">
+        <item name="testFlags">bit1|bit2</item>
+    </style>
+
+    <style name="TestFlag1And2And31">
+        <item name="testFlags">bit1|bit2|bit31</item>
+    </style>
+
+    <style name="TestEnum1.EmptyInherit" />
+
+    <style name="Theme_AlertDialog">
+        <item name="android:textSize">18sp</item>
+    </style>
+
+    <style name="TestProgressBar">
+        <item name="android:indeterminateOnly">false</item>
+        <item name="android:progressDrawable">?android:drawable/progress_horizontal</item>
+        <item name="android:indeterminateDrawable">?android:drawable/progress_horizontal</item>
+        <item name="android:minHeight">20dip</item>
+        <item name="android:maxHeight">20dip</item>
+        <item name="android:focusable">true</item>
+    </style>
+
+    <style name="Test_Theme">
+        <item name="android:windowNoTitle">true</item>
+        <item name="android:panelColorForeground">#ff000000</item>
+        <item name="android:panelColorBackground">#ffffffff</item>
+    </style>
+
+    <style name="Theme_OverrideOuter">
+        <item name="themeType">1</item>
+    </style>
+
+    <style name="Theme_OverrideInner">
+        <item name="themeType">2</item>
+        <item name="themeOverrideAttr">@style/Theme_OverrideAttr</item>
+    </style>
+
+    <style name="Theme_OverrideAttr">
+        <item name="themeType">3</item>
+    </style>
+    
+    <style name="Theme_ThemedDrawableTest">
+        <item name="themeBoolean">true</item>
+        <item name="themeColor">@android:color/black</item>
+        <item name="themeFloat">1.0</item>
+        <item name="themeAngle">45.0</item>
+        <item name="themeInteger">1</item>
+        <item name="themeDimension">1px</item>
+        <item name="themeDrawable">@drawable/icon_black</item>
+        <item name="themeBitmap">@drawable/icon_black</item>
+        <item name="themeNinePatch">@drawable/ninepatch_0</item>
+        <item name="themeGravity">48</item>
+        <item name="themeTileMode">2</item>
+    </style>
+
+    <style name="Theme_NoSwipeDismiss">
+        <item name="android:windowSwipeToDismiss">false</item>
+    </style>
+
+</resources>
diff --git a/tests/tests/view/res/xml/merge.xml b/tests/tests/view/res/xml/merge.xml
new file mode 100644
index 0000000..710e904
--- /dev/null
+++ b/tests/tests/view/res/xml/merge.xml
@@ -0,0 +1,39 @@
+<?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.
+-->
+
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+   <AbsoluteLayout    android:layout_width="20dip"
+               android:layout_height="30dip"
+               android:layout_x="10dip"
+               android:layout_y="20dip">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_x="0dip"
+                android:layout_y="0dip"
+                android:text="@string/notify"/>
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_x="0dip"
+                android:layout_y="0dip"
+                android:text="@string/notify"/>
+
+    </AbsoluteLayout>
+
+</merge>
diff --git a/tests/tests/view/res/xml/method.xml b/tests/tests/view/res/xml/method.xml
new file mode 100644
index 0000000..763faa5
--- /dev/null
+++ b/tests/tests/view/res/xml/method.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<input-method xmlns:android="http://schemas.android.com/apk/res/android"
+        android:settingsActivity="android.view.inputmethod.cts.InputMethodInfoStub"
+/>
diff --git a/tests/tests/view/src/android/view/animation/cts/AccelerateDecelerateInterpolatorTest.java b/tests/tests/view/src/android/view/animation/cts/AccelerateDecelerateInterpolatorTest.java
index 20ddb83..6e80d00 100644
--- a/tests/tests/view/src/android/view/animation/cts/AccelerateDecelerateInterpolatorTest.java
+++ b/tests/tests/view/src/android/view/animation/cts/AccelerateDecelerateInterpolatorTest.java
@@ -16,7 +16,7 @@
 
 package android.view.animation.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 import android.app.Activity;
@@ -33,7 +33,7 @@
 import android.view.animation.Transformation;
 
 public class AccelerateDecelerateInterpolatorTest
-        extends ActivityInstrumentationTestCase2<AnimationTestStubActivity> {
+        extends ActivityInstrumentationTestCase2<AnimationTestCtsActivity> {
 
     private Activity mActivity;
     private static final float ALPHA_DELTA = 0.001f;
@@ -41,7 +41,7 @@
     private static final long ALPHA_DURATION = 2000;
 
     public AccelerateDecelerateInterpolatorTest() {
-        super("com.android.cts.stub", AnimationTestStubActivity.class);
+        super("com.android.cts.view", AnimationTestCtsActivity.class);
     }
 
     @Override
diff --git a/tests/tests/view/src/android/view/animation/cts/AccelerateInterpolatorTest.java b/tests/tests/view/src/android/view/animation/cts/AccelerateInterpolatorTest.java
index c009533..51b2b09 100644
--- a/tests/tests/view/src/android/view/animation/cts/AccelerateInterpolatorTest.java
+++ b/tests/tests/view/src/android/view/animation/cts/AccelerateInterpolatorTest.java
@@ -16,7 +16,7 @@
 
 package android.view.animation.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 import android.app.Activity;
@@ -33,10 +33,10 @@
 import android.view.animation.Transformation;
 
 public class AccelerateInterpolatorTest
-        extends ActivityInstrumentationTestCase2<AnimationTestStubActivity> {
+        extends ActivityInstrumentationTestCase2<AnimationTestCtsActivity> {
 
     public AccelerateInterpolatorTest() {
-        super("com.android.cts.stub", AnimationTestStubActivity.class);
+        super("com.android.cts.view", AnimationTestCtsActivity.class);
     }
 
     private Activity mActivity;
diff --git a/tests/tests/view/src/android/view/animation/cts/AlphaAnimationTest.java b/tests/tests/view/src/android/view/animation/cts/AlphaAnimationTest.java
index bcd4ccd3..acfe1a6 100644
--- a/tests/tests/view/src/android/view/animation/cts/AlphaAnimationTest.java
+++ b/tests/tests/view/src/android/view/animation/cts/AlphaAnimationTest.java
@@ -23,7 +23,7 @@
 import android.view.animation.AlphaAnimation;
 import android.view.animation.Transformation;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 /**
  * Test {@link AlphaAnimation}.
diff --git a/tests/tests/view/src/android/view/animation/cts/AnimationSetTest.java b/tests/tests/view/src/android/view/animation/cts/AnimationSetTest.java
index b42c239..0b3bf49 100644
--- a/tests/tests/view/src/android/view/animation/cts/AnimationSetTest.java
+++ b/tests/tests/view/src/android/view/animation/cts/AnimationSetTest.java
@@ -33,11 +33,11 @@
 import android.view.animation.Transformation;
 import android.view.animation.TranslateAnimation;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 public class AnimationSetTest
-        extends ActivityInstrumentationTestCase2<AnimationTestStubActivity> {
+        extends ActivityInstrumentationTestCase2<AnimationTestCtsActivity> {
 
     private static final float DELTA = 0.001f;
     private static final long SHORT_CHILD_DURATION = 400;
@@ -51,7 +51,7 @@
     private Activity mActivity;
 
     public AnimationSetTest() {
-        super("com.android.cts.stub", AnimationTestStubActivity.class);
+        super("com.android.cts.view", AnimationTestCtsActivity.class);
     }
 
     @Override
diff --git a/tests/tests/view/src/android/view/animation/cts/AnimationTest.java b/tests/tests/view/src/android/view/animation/cts/AnimationTest.java
index 2d88dc4..31440df 100644
--- a/tests/tests/view/src/android/view/animation/cts/AnimationTest.java
+++ b/tests/tests/view/src/android/view/animation/cts/AnimationTest.java
@@ -16,7 +16,7 @@
 
 package android.view.animation.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 import android.app.Activity;
@@ -38,7 +38,7 @@
 /**
  * Test {@link Animation}.
  */
-public class AnimationTest extends ActivityInstrumentationTestCase2<AnimationTestStubActivity> {
+public class AnimationTest extends ActivityInstrumentationTestCase2<AnimationTestCtsActivity> {
     private static final float ALPHA_DELTA = 0.001f;
 
     /** It is defined in R.anim.accelerate_alpha */
@@ -51,7 +51,7 @@
     private Object mLockObject = new Object();
 
     public AnimationTest() {
-        super("com.android.cts.stub", AnimationTestStubActivity.class);
+        super("com.android.cts.view", AnimationTestCtsActivity.class);
     }
 
     @Override
diff --git a/tests/src/android/view/animation/cts/AnimationTestStubActivity.java b/tests/tests/view/src/android/view/animation/cts/AnimationTestCtsActivity.java
similarity index 90%
rename from tests/src/android/view/animation/cts/AnimationTestStubActivity.java
rename to tests/tests/view/src/android/view/animation/cts/AnimationTestCtsActivity.java
index 68d0da3..48692f1 100644
--- a/tests/src/android/view/animation/cts/AnimationTestStubActivity.java
+++ b/tests/tests/view/src/android/view/animation/cts/AnimationTestCtsActivity.java
@@ -16,12 +16,12 @@
 
 package android.view.animation.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 import android.app.Activity;
 import android.os.Bundle;
 
-public class AnimationTestStubActivity extends Activity {
+public class AnimationTestCtsActivity extends Activity {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
diff --git a/tests/src/android/view/animation/cts/AnimationTestUtils.java b/tests/tests/view/src/android/view/animation/cts/AnimationTestUtils.java
similarity index 100%
rename from tests/src/android/view/animation/cts/AnimationTestUtils.java
rename to tests/tests/view/src/android/view/animation/cts/AnimationTestUtils.java
diff --git a/tests/tests/view/src/android/view/animation/cts/AnimationUtilsTest.java b/tests/tests/view/src/android/view/animation/cts/AnimationUtilsTest.java
index cddbfdf..9de0d87 100644
--- a/tests/tests/view/src/android/view/animation/cts/AnimationUtilsTest.java
+++ b/tests/tests/view/src/android/view/animation/cts/AnimationUtilsTest.java
@@ -16,7 +16,7 @@
 
 package android.view.animation.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 import android.content.Context;
@@ -30,22 +30,22 @@
 import android.view.animation.LayoutAnimationController;
 
 public class AnimationUtilsTest extends
-        ActivityInstrumentationTestCase2<AnimationTestStubActivity> {
+        ActivityInstrumentationTestCase2<AnimationTestCtsActivity> {
 
-    private AnimationTestStubActivity mActivity;
+    private AnimationTestCtsActivity mActivity;
 
     public AnimationUtilsTest() {
-        super("com.android.cts.stub", AnimationTestStubActivity.class);
+        super("com.android.cts.view", AnimationTestCtsActivity.class);
     }
 
     @Override
     protected void setUp() throws Exception {
         super.setUp();
-        mActivity = (AnimationTestStubActivity) getActivity();
+        mActivity = (AnimationTestCtsActivity) getActivity();
     }
 
     public void testLoad() {
-        // XML file of com.android.cts.stub.R.anim.anim_alpha
+        // XML file of com.android.cts.view.R.anim.anim_alpha
         // <alpha xmlns:android="http://schemas.android.com/apk/res/android"
         //      android:interpolator="@android:anim/accelerate_interpolator"
         //      android:fromAlpha="0.0"
@@ -61,7 +61,7 @@
                 android.R.anim.accelerate_interpolator);
         assertTrue(interpolator instanceof AccelerateInterpolator);
 
-        // Load LayoutAnimationController from com.android.cts.stub.R.anim.anim_gridlayout
+        // Load LayoutAnimationController from com.android.cts.view.R.anim.anim_gridlayout
         // <gridLayoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"
         //      android:delay="10%"
         //      android:rowDelay="50%"
diff --git a/tests/tests/view/src/android/view/animation/cts/CycleInterpolatorTest.java b/tests/tests/view/src/android/view/animation/cts/CycleInterpolatorTest.java
index 56cb32c..3297377 100644
--- a/tests/tests/view/src/android/view/animation/cts/CycleInterpolatorTest.java
+++ b/tests/tests/view/src/android/view/animation/cts/CycleInterpolatorTest.java
@@ -29,14 +29,14 @@
 import android.view.animation.Interpolator;
 import android.view.animation.Transformation;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 /**
  * Test {@link CycleInterpolator}.
  */
 public class CycleInterpolatorTest
-        extends ActivityInstrumentationTestCase2<AnimationTestStubActivity> {
+        extends ActivityInstrumentationTestCase2<AnimationTestCtsActivity> {
 
     private Activity mActivity;
 
@@ -45,7 +45,7 @@
     private static final float ALPHA_DELTA = 0.001f;
 
     public CycleInterpolatorTest() {
-        super("com.android.cts.stub", AnimationTestStubActivity.class);
+        super("com.android.cts.view", AnimationTestCtsActivity.class);
     }
 
     @Override
diff --git a/tests/tests/view/src/android/view/animation/cts/DecelerateInterpolatorTest.java b/tests/tests/view/src/android/view/animation/cts/DecelerateInterpolatorTest.java
index 5bae1f7..deb52dd 100644
--- a/tests/tests/view/src/android/view/animation/cts/DecelerateInterpolatorTest.java
+++ b/tests/tests/view/src/android/view/animation/cts/DecelerateInterpolatorTest.java
@@ -16,7 +16,7 @@
 
 package android.view.animation.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 import android.app.Activity;
@@ -36,7 +36,7 @@
  * Test {@link DecelerateInterpolator}.
  */
 public class DecelerateInterpolatorTest
-        extends ActivityInstrumentationTestCase2<AnimationTestStubActivity> {
+        extends ActivityInstrumentationTestCase2<AnimationTestCtsActivity> {
 
     private Activity mActivity;
     private static final float ALPHA_DELTA = 0.001f;
@@ -45,7 +45,7 @@
     private static final long DECELERATE_ALPHA_DURATION = 2000;
 
     public DecelerateInterpolatorTest() {
-        super("com.android.cts.stub", AnimationTestStubActivity.class);
+        super("com.android.cts.view", AnimationTestCtsActivity.class);
     }
 
     @Override
diff --git a/tests/src/android/view/animation/cts/GridLayoutAnimStubActivity.java b/tests/tests/view/src/android/view/animation/cts/GridLayoutAnimCtsActivity.java
similarity index 94%
rename from tests/src/android/view/animation/cts/GridLayoutAnimStubActivity.java
rename to tests/tests/view/src/android/view/animation/cts/GridLayoutAnimCtsActivity.java
index 7fb79c3..bf95077 100644
--- a/tests/src/android/view/animation/cts/GridLayoutAnimStubActivity.java
+++ b/tests/tests/view/src/android/view/animation/cts/GridLayoutAnimCtsActivity.java
@@ -16,7 +16,7 @@
 
 package android.view.animation.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 import android.app.Activity;
 import android.database.DataSetObserver;
@@ -28,7 +28,7 @@
 import android.widget.ImageView;
 import android.widget.ListAdapter;
 
-public class GridLayoutAnimStubActivity extends Activity {
+public class GridLayoutAnimCtsActivity extends Activity {
 
     private GridView mGridView;
     private static final int GRID_NUM = 9;
@@ -92,7 +92,7 @@
                 return convertView;
             }
 
-            ImageView newView = new ImageView(GridLayoutAnimStubActivity.this);
+            ImageView newView = new ImageView(GridLayoutAnimCtsActivity.this);
             AbsListView.LayoutParams params = new AbsListView.LayoutParams(
                     AbsListView.LayoutParams.WRAP_CONTENT, AbsListView.LayoutParams.WRAP_CONTENT);
             newView.setLayoutParams(params);
diff --git a/tests/tests/view/src/android/view/animation/cts/GridLayoutAnimationControllerTest.java b/tests/tests/view/src/android/view/animation/cts/GridLayoutAnimationControllerTest.java
index 80c40fa..54898b4 100644
--- a/tests/tests/view/src/android/view/animation/cts/GridLayoutAnimationControllerTest.java
+++ b/tests/tests/view/src/android/view/animation/cts/GridLayoutAnimationControllerTest.java
@@ -16,7 +16,7 @@
 
 package android.view.animation.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 import android.content.Context;
@@ -35,9 +35,9 @@
 import android.widget.GridView;
 
 public class GridLayoutAnimationControllerTest
-    extends ActivityInstrumentationTestCase2<GridLayoutAnimStubActivity> {
+    extends ActivityInstrumentationTestCase2<GridLayoutAnimCtsActivity> {
 
-    private GridLayoutAnimStubActivity mActivity;
+    private GridLayoutAnimCtsActivity mActivity;
     private Animation mDefaultAnimation;
     private GridLayoutAnimationController mController;
     /** The GridView will be 3*3 */
@@ -58,7 +58,7 @@
     private static final int INDEX_OF_CHILD9 = 8;
 
     public GridLayoutAnimationControllerTest() {
-        super("com.android.cts.stub", GridLayoutAnimStubActivity.class);
+        super("com.android.cts.view", GridLayoutAnimCtsActivity.class);
     }
 
     @Override
diff --git a/tests/src/android/view/animation/cts/LayoutAnimStubActivity.java b/tests/tests/view/src/android/view/animation/cts/LayoutAnimCtsActivity.java
similarity index 94%
rename from tests/src/android/view/animation/cts/LayoutAnimStubActivity.java
rename to tests/tests/view/src/android/view/animation/cts/LayoutAnimCtsActivity.java
index e647820..0b9203f 100644
--- a/tests/src/android/view/animation/cts/LayoutAnimStubActivity.java
+++ b/tests/tests/view/src/android/view/animation/cts/LayoutAnimCtsActivity.java
@@ -21,7 +21,7 @@
 import android.widget.ArrayAdapter;
 
 
-public class LayoutAnimStubActivity extends ListActivity {
+public class LayoutAnimCtsActivity extends ListActivity {
 
     private String[] mStrings = {
             "Android",
diff --git a/tests/tests/view/src/android/view/animation/cts/LayoutAnimationControllerTest.java b/tests/tests/view/src/android/view/animation/cts/LayoutAnimationControllerTest.java
index cccf0a6..2f8f36d 100644
--- a/tests/tests/view/src/android/view/animation/cts/LayoutAnimationControllerTest.java
+++ b/tests/tests/view/src/android/view/animation/cts/LayoutAnimationControllerTest.java
@@ -16,7 +16,7 @@
 
 package android.view.animation.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 import android.app.ListActivity;
@@ -40,7 +40,7 @@
 import android.widget.ListView;
 
 public class LayoutAnimationControllerTest
-        extends ActivityInstrumentationTestCase2<LayoutAnimStubActivity> {
+        extends ActivityInstrumentationTestCase2<LayoutAnimCtsActivity> {
 
     private ListActivity mActivity;
     private Animation mDefaultAnimation;
@@ -58,7 +58,7 @@
     private static final long DEFAULT_MAX_DURATION = 2000;
 
     public LayoutAnimationControllerTest() {
-        super("com.android.cts.stub", LayoutAnimStubActivity.class);
+        super("com.android.cts.view", LayoutAnimCtsActivity.class);
     }
 
     @Override
diff --git a/tests/tests/view/src/android/view/animation/cts/LinearInterpolatorTest.java b/tests/tests/view/src/android/view/animation/cts/LinearInterpolatorTest.java
index ff9e734..28407f9 100644
--- a/tests/tests/view/src/android/view/animation/cts/LinearInterpolatorTest.java
+++ b/tests/tests/view/src/android/view/animation/cts/LinearInterpolatorTest.java
@@ -26,13 +26,13 @@
 import android.view.animation.LinearInterpolator;
 import android.view.animation.Transformation;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 /**
  * Test {@link LinearInterpolator}.
  */
-public class LinearInterpolatorTest extends ActivityInstrumentationTestCase2<AnimationTestStubActivity> {
+public class LinearInterpolatorTest extends ActivityInstrumentationTestCase2<AnimationTestCtsActivity> {
 
     private Activity mActivity;
     private static final float ALPHA_DELTA = 0.001f;
@@ -42,7 +42,7 @@
     private static final long LINEAR_ALPHA_TIME_STEP = LINEAR_ALPHA_DURATION / 5;
 
     public LinearInterpolatorTest() {
-        super("com.android.cts.stub", AnimationTestStubActivity.class);
+        super("com.android.cts.view", AnimationTestCtsActivity.class);
     }
 
     @Override
diff --git a/tests/tests/view/src/android/view/animation/cts/RotateAnimationTest.java b/tests/tests/view/src/android/view/animation/cts/RotateAnimationTest.java
index 0bc7ab0..958133a 100644
--- a/tests/tests/view/src/android/view/animation/cts/RotateAnimationTest.java
+++ b/tests/tests/view/src/android/view/animation/cts/RotateAnimationTest.java
@@ -28,11 +28,11 @@
 import android.view.animation.RotateAnimation;
 import android.view.animation.Transformation;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 public class RotateAnimationTest
-        extends ActivityInstrumentationTestCase2<AnimationTestStubActivity> {
+        extends ActivityInstrumentationTestCase2<AnimationTestCtsActivity> {
 
     private Activity mActivity;
 
@@ -42,7 +42,7 @@
     private static final float TO_DEGREE = 90.0f;
 
     public RotateAnimationTest() {
-        super("com.android.cts.stub", AnimationTestStubActivity.class);
+        super("com.android.cts.view", AnimationTestCtsActivity.class);
     }
 
     @Override
diff --git a/tests/tests/view/src/android/view/animation/cts/ScaleAnimationTest.java b/tests/tests/view/src/android/view/animation/cts/ScaleAnimationTest.java
index 243dace..e17435e 100644
--- a/tests/tests/view/src/android/view/animation/cts/ScaleAnimationTest.java
+++ b/tests/tests/view/src/android/view/animation/cts/ScaleAnimationTest.java
@@ -16,7 +16,7 @@
 
 package android.view.animation.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 import android.content.res.XmlResourceParser;
@@ -30,7 +30,7 @@
 import android.view.animation.Transformation;
 
 public class ScaleAnimationTest
-        extends ActivityInstrumentationTestCase2<AnimationTestStubActivity> {
+        extends ActivityInstrumentationTestCase2<AnimationTestCtsActivity> {
     private static long DURATION = 1000;
     private static float DELTA = 0.001f;
     private static float FROM_X = 1.0f;
@@ -41,10 +41,10 @@
     private static float PIVOT_Y = 0.6f;
     private static float MID_X = 0.8f;
     private static float MID_Y = 3.3f;
-    private AnimationTestStubActivity mActivity;
+    private AnimationTestCtsActivity mActivity;
 
     public ScaleAnimationTest() {
-        super("com.android.cts.stub", AnimationTestStubActivity.class);
+        super("com.android.cts.view", AnimationTestCtsActivity.class);
     }
 
     @Override
diff --git a/tests/tests/view/src/android/view/animation/cts/TranslateAnimationTest.java b/tests/tests/view/src/android/view/animation/cts/TranslateAnimationTest.java
index 959e506..94ab558 100644
--- a/tests/tests/view/src/android/view/animation/cts/TranslateAnimationTest.java
+++ b/tests/tests/view/src/android/view/animation/cts/TranslateAnimationTest.java
@@ -28,11 +28,11 @@
 import android.view.animation.Transformation;
 import android.view.animation.TranslateAnimation;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 public class TranslateAnimationTest
-        extends ActivityInstrumentationTestCase2<AnimationTestStubActivity> {
+        extends ActivityInstrumentationTestCase2<AnimationTestCtsActivity> {
 
     private Activity mActivity;
 
@@ -48,7 +48,7 @@
     private static final float RELATIVE_TO_Y_DELTA = 0.4f;
 
     public TranslateAnimationTest() {
-        super("com.android.cts.stub", AnimationTestStubActivity.class);
+        super("com.android.cts.view", AnimationTestCtsActivity.class);
     }
 
     @Override
diff --git a/tests/tests/view/src/android/view/cts/ContextThemeWrapperTest.java b/tests/tests/view/src/android/view/cts/ContextThemeWrapperTest.java
index 33d1682..c40f095 100644
--- a/tests/tests/view/src/android/view/cts/ContextThemeWrapperTest.java
+++ b/tests/tests/view/src/android/view/cts/ContextThemeWrapperTest.java
@@ -23,7 +23,7 @@
 import android.test.AndroidTestCase;
 import android.view.ContextThemeWrapper;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 public class ContextThemeWrapperTest extends AndroidTestCase {
diff --git a/tests/src/android/view/cts/MenuInflaterStubActivity.java b/tests/tests/view/src/android/view/cts/CtsActivity.java
similarity index 73%
copy from tests/src/android/view/cts/MenuInflaterStubActivity.java
copy to tests/tests/view/src/android/view/cts/CtsActivity.java
index 693fe13..08607d2 100644
--- a/tests/src/android/view/cts/MenuInflaterStubActivity.java
+++ b/tests/tests/view/src/android/view/cts/CtsActivity.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -17,12 +17,10 @@
 package android.view.cts;
 
 import android.app.Activity;
-import android.view.MenuInflater;
 
 /**
- * Stub activity for testing {@link MenuInflater}.
- *
- * @see MenuInflaterTest
+ * Stub activity for helping test. It's an empty activity.
  */
-public class MenuInflaterStubActivity extends Activity {
+public class CtsActivity extends Activity {
+
 }
diff --git a/tests/tests/view/src/android/view/cts/DisplayRefreshRateTest.java b/tests/tests/view/src/android/view/cts/DisplayRefreshRateTest.java
index cc2517d..5120604 100644
--- a/tests/tests/view/src/android/view/cts/DisplayRefreshRateTest.java
+++ b/tests/tests/view/src/android/view/cts/DisplayRefreshRateTest.java
@@ -18,7 +18,6 @@
 
 import android.content.Context;
 import android.opengl.GLSurfaceView;
-import android.opengl.cts.GLSurfaceViewStubActivity;
 import android.test.ActivityInstrumentationTestCase2;
 import android.test.UiThreadTest;
 import android.view.Display;
@@ -39,7 +38,7 @@
  * way of measuring the actual refresh rate.
  */
 public class DisplayRefreshRateTest extends
-        ActivityInstrumentationTestCase2<GLSurfaceViewStubActivity> {
+        ActivityInstrumentationTestCase2<GLSurfaceViewCtsActivity> {
 
     // The test passes if
     //   abs(measured_fps - Display.getRefreshRate()) <= FPS_TOLERANCE.
@@ -157,21 +156,21 @@
     private FpsResult mResult;
 
     public DisplayRefreshRateTest() {
-        super(GLSurfaceViewStubActivity.class);
+        super(GLSurfaceViewCtsActivity.class);
         mResult = new FpsResult();
     }
 
     @Override
     protected void setUp() throws Exception {
         super.setUp();
-        GLSurfaceViewStubActivity.setRenderer(new Renderer(mResult));
-        GLSurfaceViewStubActivity.setRenderMode(
+        GLSurfaceViewCtsActivity.setRenderer(new Renderer(mResult));
+        GLSurfaceViewCtsActivity.setRenderMode(
                 GLSurfaceView.RENDERMODE_CONTINUOUSLY);
     }
 
     public void testRefreshRate() throws java.lang.InterruptedException {
         boolean fpsOk = false;
-        GLSurfaceViewStubActivity activity = getActivity();
+        GLSurfaceViewCtsActivity activity = getActivity();
 
         WindowManager wm = (WindowManager)activity
                 .getView()
diff --git a/tests/src/android/view/cts/FocusFinderStubActivity.java b/tests/tests/view/src/android/view/cts/FocusFinderCtsActivity.java
similarity index 94%
rename from tests/src/android/view/cts/FocusFinderStubActivity.java
rename to tests/tests/view/src/android/view/cts/FocusFinderCtsActivity.java
index c5b215f..14ab577 100644
--- a/tests/src/android/view/cts/FocusFinderStubActivity.java
+++ b/tests/tests/view/src/android/view/cts/FocusFinderCtsActivity.java
@@ -16,7 +16,7 @@
 
 package android.view.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 import android.app.Activity;
 import android.content.Context;
@@ -25,7 +25,7 @@
 import android.view.ViewGroup;
 import android.widget.Button;
 
-public class FocusFinderStubActivity extends Activity {
+public class FocusFinderCtsActivity extends Activity {
 
     public ViewGroup layout;
 
diff --git a/tests/tests/view/src/android/view/cts/FocusFinderTest.java b/tests/tests/view/src/android/view/cts/FocusFinderTest.java
index 6e54603..55c288e 100644
--- a/tests/tests/view/src/android/view/cts/FocusFinderTest.java
+++ b/tests/tests/view/src/android/view/cts/FocusFinderTest.java
@@ -24,7 +24,7 @@
 import android.view.ViewGroup;
 import android.widget.Button;
 
-public class FocusFinderTest extends ActivityInstrumentationTestCase2<FocusFinderStubActivity> {
+public class FocusFinderTest extends ActivityInstrumentationTestCase2<FocusFinderCtsActivity> {
 
     private FocusFinder mFocusFinder;
     private ViewGroup mLayout;
@@ -34,7 +34,7 @@
     private Button mBottomRight;
 
     public FocusFinderTest() {
-        super("com.android.cts.stub", FocusFinderStubActivity.class);
+        super("com.android.cts.view", FocusFinderCtsActivity.class);
     }
 
     @Override
diff --git a/tests/src/android/view/cts/FocusHandlingStubActivity.java b/tests/tests/view/src/android/view/cts/FocusHandlingCtsActivity.java
similarity index 91%
rename from tests/src/android/view/cts/FocusHandlingStubActivity.java
rename to tests/tests/view/src/android/view/cts/FocusHandlingCtsActivity.java
index 9faa609..5489e2a 100644
--- a/tests/src/android/view/cts/FocusHandlingStubActivity.java
+++ b/tests/tests/view/src/android/view/cts/FocusHandlingCtsActivity.java
@@ -16,7 +16,7 @@
 
 package android.view.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 import android.app.Activity;
 import android.os.Bundle;
@@ -24,7 +24,7 @@
 /**
  * A simple activity to test "Focus Handling"
  */
-public class FocusHandlingStubActivity extends Activity {
+public class FocusHandlingCtsActivity extends Activity {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
diff --git a/tests/tests/view/src/android/view/cts/GLSurfaceViewCtsActivity.java b/tests/tests/view/src/android/view/cts/GLSurfaceViewCtsActivity.java
new file mode 100644
index 0000000..bc916a7
--- /dev/null
+++ b/tests/tests/view/src/android/view/cts/GLSurfaceViewCtsActivity.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2010 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 android.view.cts;
+
+import android.app.Activity;
+import android.opengl.GLSurfaceView;
+import android.os.Bundle;
+import android.view.Window;
+
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.opengles.GL10;
+
+/**
+ * A minimal activity for testing {@link android.opengl.GLSurfaceView}.
+ * Also accepts non-blank renderers to allow its use for more complex tests.
+ */
+public class GLSurfaceViewCtsActivity extends Activity {
+
+    private static class Renderer implements GLSurfaceView.Renderer {
+
+        public void onDrawFrame(GL10 gl) {
+            // Do nothing.
+        }
+
+        public void onSurfaceChanged(GL10 gl, int width, int height) {
+            // Do nothing.
+        }
+
+        public void onSurfaceCreated(GL10 gl, EGLConfig config) {
+            // Do nothing.
+        }
+    }
+
+    private GLSurfaceView mView;
+
+    /** To override the blank renderer, or other settings, these
+     * static set* methods must be called before onCreate() is called.
+     * If using ActivityInstrumentationTestCase2, that means the set
+     * methods need to be called before calling getActivity in the
+     * test setUp().
+     */
+    private static GLSurfaceView.Renderer mRenderer = null;
+    public static void setRenderer(GLSurfaceView.Renderer renderer) {
+        mRenderer = renderer;
+    }
+    public static void resetRenderer() {
+        mRenderer = null;
+    }
+
+    private static int mRenderMode = 0;
+    private static boolean mRenderModeSet = false;
+    public static void setRenderMode(int renderMode) {
+        mRenderModeSet = true;
+        mRenderMode = renderMode;
+    }
+    public static void resetRenderMode() {
+        mRenderModeSet = false;
+        mRenderMode = 0;
+    }
+
+    private static int mGlVersion = 0;
+    private static boolean mGlVersionSet = false;
+    public static void setGlVersion(int glVersion) {
+        mGlVersionSet = true;
+        mGlVersion = glVersion;
+    }
+    public static void resetGlVersion() {
+        mGlVersionSet = false;
+        mGlVersion = 0;
+    }
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        mView = new GLSurfaceView(this);
+        // Only set this if explicitly asked for
+        if (mGlVersionSet) {
+            mView.setEGLContextClientVersion(mGlVersion);
+        }
+        // Use no-op renderer by default
+        if (mRenderer == null) {
+            mView.setRenderer(new Renderer());
+        } else {
+            mView.setRenderer(mRenderer);
+        }
+        // Only set this if explicitly asked for
+        if (mRenderModeSet) {
+            mView.setRenderMode(mRenderMode);
+        }
+        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
+        setContentView(mView);
+    }
+
+    public GLSurfaceView getView() {
+        return mView;
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        mView.onResume();
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+        mView.onPause();
+    }
+}
diff --git a/tests/src/android/view/cts/GestureDetectorStubActivity.java b/tests/tests/view/src/android/view/cts/GestureDetectorCtsActivity.java
similarity index 97%
rename from tests/src/android/view/cts/GestureDetectorStubActivity.java
rename to tests/tests/view/src/android/view/cts/GestureDetectorCtsActivity.java
index e82b787..f02a0d6 100644
--- a/tests/src/android/view/cts/GestureDetectorStubActivity.java
+++ b/tests/tests/view/src/android/view/cts/GestureDetectorCtsActivity.java
@@ -27,7 +27,7 @@
 import android.view.View.OnTouchListener;
 import android.widget.Button;
 
-public class GestureDetectorStubActivity extends Activity {
+public class GestureDetectorCtsActivity extends Activity {
 
     public boolean isDown;
     public boolean isScroll;
diff --git a/tests/tests/view/src/android/view/cts/GestureDetectorTest.java b/tests/tests/view/src/android/view/cts/GestureDetectorTest.java
index e2e5465..3d8ba05 100644
--- a/tests/tests/view/src/android/view/cts/GestureDetectorTest.java
+++ b/tests/tests/view/src/android/view/cts/GestureDetectorTest.java
@@ -23,14 +23,14 @@
 import android.view.GestureDetector.SimpleOnGestureListener;
 
 public class GestureDetectorTest extends
-        ActivityInstrumentationTestCase2<GestureDetectorStubActivity> {
+        ActivityInstrumentationTestCase2<GestureDetectorCtsActivity> {
 
     private GestureDetector mGestureDetector;
-    private GestureDetectorStubActivity mActivity;
+    private GestureDetectorCtsActivity mActivity;
     private Context mContext;
 
     public GestureDetectorTest() {
-        super("com.android.cts.stub", GestureDetectorStubActivity.class);
+        super("com.android.cts.view", GestureDetectorCtsActivity.class);
     }
 
     @Override
diff --git a/tests/tests/view/src/android/view/cts/LayoutInflaterTest.java b/tests/tests/view/src/android/view/cts/LayoutInflaterTest.java
index 07c6e8c..bf83086 100644
--- a/tests/tests/view/src/android/view/cts/LayoutInflaterTest.java
+++ b/tests/tests/view/src/android/view/cts/LayoutInflaterTest.java
@@ -16,12 +16,11 @@
 
 package android.view.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 import com.android.internal.util.XmlUtils;
 
 import org.xmlpull.v1.XmlPullParser;
 
-import android.app.cts.MockActivity;
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.pm.ActivityInfo;
@@ -212,7 +211,7 @@
 
     public void testInflate() {
         View view = mLayoutInflater.inflate(
-                com.android.cts.stub.R.layout.inflater_layout, null);
+                com.android.cts.view.R.layout.inflater_layout, null);
         assertNotNull(view);
         view = null;
         try {
@@ -385,7 +384,7 @@
 
     public void testInflateTags() {
         final View view = mLayoutInflater.inflate(
-                com.android.cts.stub.R.layout.inflater_layout_tags, null);
+                com.android.cts.view.R.layout.inflater_layout_tags, null);
         assertNotNull(view);
 
         checkViewTag(view, R.id.viewlayout_root, R.id.tag_viewlayout_root, R.string.tag1);
diff --git a/tests/src/android/view/cts/MenuInflaterStubActivity.java b/tests/tests/view/src/android/view/cts/MenuInflaterCtsActivity.java
similarity index 92%
rename from tests/src/android/view/cts/MenuInflaterStubActivity.java
rename to tests/tests/view/src/android/view/cts/MenuInflaterCtsActivity.java
index 693fe13..75adede 100644
--- a/tests/src/android/view/cts/MenuInflaterStubActivity.java
+++ b/tests/tests/view/src/android/view/cts/MenuInflaterCtsActivity.java
@@ -24,5 +24,5 @@
  *
  * @see MenuInflaterTest
  */
-public class MenuInflaterStubActivity extends Activity {
+public class MenuInflaterCtsActivity extends Activity {
 }
diff --git a/tests/tests/view/src/android/view/cts/MenuInflaterTest.java b/tests/tests/view/src/android/view/cts/MenuInflaterTest.java
index cf1047e..bd483f9 100644
--- a/tests/tests/view/src/android/view/cts/MenuInflaterTest.java
+++ b/tests/tests/view/src/android/view/cts/MenuInflaterTest.java
@@ -16,7 +16,7 @@
 
 package android.view.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 import com.android.internal.view.menu.MenuBuilder;
 
 
@@ -30,18 +30,17 @@
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.SubMenu;
-import android.widget.cts.WidgetTestUtils;
 
 /**
  * Test {@link MenuInflater}.
  */
-public class MenuInflaterTest extends ActivityInstrumentationTestCase2<MenuInflaterStubActivity> {
+public class MenuInflaterTest extends ActivityInstrumentationTestCase2<MenuInflaterCtsActivity> {
     private MenuInflater mMenuInflater;
 
     private Activity mActivity;
 
     public MenuInflaterTest() {
-        super("com.android.cts.stub", MenuInflaterStubActivity.class);
+        super("com.android.cts.view", MenuInflaterCtsActivity.class);
     }
 
     @Override
@@ -59,7 +58,7 @@
         Menu menu = new MenuBuilder(mActivity);
         assertEquals(0, menu.size());
 
-        mMenuInflater.inflate(com.android.cts.stub.R.menu.browser, menu);
+        mMenuInflater.inflate(com.android.cts.view.R.menu.browser, menu);
         assertNotNull(menu);
         assertEquals(1, menu.size());
 
@@ -70,7 +69,7 @@
         }
 
         try {
-            mMenuInflater.inflate(com.android.cts.stub.R.menu.browser, null);
+            mMenuInflater.inflate(com.android.cts.view.R.menu.browser, null);
             fail("should throw NullPointerException");
         } catch (NullPointerException e) {
         }
@@ -94,7 +93,7 @@
 
         // the titles and icons
         menu = new MenuBuilder(mActivity);
-        mMenuInflater.inflate(com.android.cts.stub.R.menu.title_icon, menu);
+        mMenuInflater.inflate(com.android.cts.view.R.menu.title_icon, menu);
 
         assertEquals("Start", menu.findItem(R.id.start).getTitle());
         assertIconUsingDrawableRes((BitmapDrawable) menu.findItem(R.id.start).getIcon(),
@@ -110,7 +109,7 @@
 
         // the orders and categories
         menu = new MenuBuilder(mActivity);
-        mMenuInflater.inflate(com.android.cts.stub.R.menu.category_order, menu);
+        mMenuInflater.inflate(com.android.cts.view.R.menu.category_order, menu);
         // default category
         assertEquals(R.id.most_used_items, menu.findItem(R.id.first_most_item).getGroupId());
         assertEquals(1, menu.findItem(R.id.first_most_item).getOrder());
@@ -134,7 +133,7 @@
 
         // the checkables
         menu = new MenuBuilder(mActivity);
-        mMenuInflater.inflate(com.android.cts.stub.R.menu.checkable, menu);
+        mMenuInflater.inflate(com.android.cts.view.R.menu.checkable, menu);
         // noncheckables
         assertEquals(R.id.noncheckable_group,
                 menu.findItem(R.id.noncheckable_item_1).getGroupId());
diff --git a/tests/src/android/view/cts/MenuInflaterStubActivity.java b/tests/tests/view/src/android/view/cts/MockActivity.java
similarity index 78%
copy from tests/src/android/view/cts/MenuInflaterStubActivity.java
copy to tests/tests/view/src/android/view/cts/MockActivity.java
index 693fe13..6e12901 100644
--- a/tests/src/android/view/cts/MenuInflaterStubActivity.java
+++ b/tests/tests/view/src/android/view/cts/MockActivity.java
@@ -17,12 +17,7 @@
 package android.view.cts;
 
 import android.app.Activity;
-import android.view.MenuInflater;
 
-/**
- * Stub activity for testing {@link MenuInflater}.
- *
- * @see MenuInflaterTest
- */
-public class MenuInflaterStubActivity extends Activity {
+public class MockActivity extends Activity {
+
 }
diff --git a/tests/tests/view/src/android/view/cts/MockApplication.java b/tests/tests/view/src/android/view/cts/MockApplication.java
new file mode 100644
index 0000000..e99e6b8
--- /dev/null
+++ b/tests/tests/view/src/android/view/cts/MockApplication.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2008 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 android.view.cts;
+
+import android.app.Application;
+import android.content.res.Configuration;
+
+
+public class MockApplication extends Application {
+
+    public boolean isOnCreateCalled;
+    public boolean isConstructorCalled;
+    public boolean isOnConfigurationChangedCalled;
+    public boolean isOnLowMemoryCalled;
+
+    public MockApplication() {
+        super();
+        isConstructorCalled = true;
+    }
+
+    @Override
+    public void onCreate() {
+        super.onCreate();
+        isOnCreateCalled = true;
+    }
+
+    @Override
+    public void onTerminate() {
+        super.onTerminate();
+        // The documentation states that one cannot rely on this method being called. No need to
+        // test it here.
+    }
+
+    @Override
+    public void onConfigurationChanged(Configuration newConfig) {
+        super.onConfigurationChanged(newConfig);
+        isOnConfigurationChangedCalled = true;
+    }
+
+    @Override
+    public void onLowMemory() {
+        super.onLowMemory();
+        isOnLowMemoryCalled = true;
+    }
+}
diff --git a/tests/tests/view/src/android/view/cts/MockLinearLayout.java b/tests/tests/view/src/android/view/cts/MockLinearLayout.java
new file mode 100644
index 0000000..9fe425b
--- /dev/null
+++ b/tests/tests/view/src/android/view/cts/MockLinearLayout.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2008 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 android.view.cts;
+
+import android.content.Context;
+import android.graphics.Rect;
+import android.util.AttributeSet;
+import android.view.ViewParent;
+import android.widget.LinearLayout;
+
+public class MockLinearLayout extends LinearLayout {
+
+    public boolean mIsInvalidateChildInParentCalled;
+
+    public MockLinearLayout(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public MockLinearLayout(Context context) {
+        super(context);
+    }
+
+    @Override
+    public ViewParent invalidateChildInParent(int[] location, Rect dirty) {
+        mIsInvalidateChildInParentCalled = true;
+        return super.invalidateChildInParent(location, dirty);
+    }
+
+}
+
diff --git a/tests/tests/view/src/android/view/cts/MockTextView.java b/tests/tests/view/src/android/view/cts/MockTextView.java
new file mode 100644
index 0000000..dc9420d
--- /dev/null
+++ b/tests/tests/view/src/android/view/cts/MockTextView.java
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2011 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 android.view.cts;
+
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.text.method.MovementMethod;
+import android.util.AttributeSet;
+import android.view.ContextMenu;
+import android.view.KeyEvent;
+import android.widget.TextView;
+
+public class MockTextView extends TextView {
+    private boolean mHasCalledOnCreateContextMenu;
+    private boolean mHasCalledOnFocusChanged;
+    private boolean mHasCalledOnMeasure;
+    private boolean mHasCalledOnTextChanged;
+    private boolean mHasCalledDrawableStateChanged;
+    private boolean mHasCalledOnWindowFocusChanged;
+    private boolean mHasCalledOnPrivateIMECommand;
+    private boolean mHasCalledOnKeyMultiple;
+
+    public MockTextView(Context context) {
+        super(context);
+    }
+
+    public MockTextView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public MockTextView(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+    }
+
+    public boolean hasCalledOnWindowFocusChanged() {
+        return mHasCalledOnWindowFocusChanged;
+    }
+
+    public boolean hasCalledOnCreateContextMenu() {
+        return mHasCalledOnCreateContextMenu;
+    }
+
+    public boolean hasCalledDrawableStateChanged() {
+        return mHasCalledDrawableStateChanged;
+    }
+
+    public boolean hasCalledOnFocusChanged() {
+        return mHasCalledOnFocusChanged;
+    }
+
+    public boolean hasCalledOnMeasure() {
+        return mHasCalledOnMeasure;
+    }
+
+    public boolean hasCalledOnTextChanged() {
+        return mHasCalledOnTextChanged;
+    }
+
+    public boolean hasCalledOnPrivateIMECommand() {
+        return mHasCalledOnPrivateIMECommand;
+    }
+
+    public boolean hasCalledOnKeyMultiple(){
+        return mHasCalledOnKeyMultiple;
+    }
+
+    public void reset() {
+        mHasCalledOnWindowFocusChanged = false;
+        mHasCalledDrawableStateChanged = false;
+        mHasCalledOnCreateContextMenu = false;
+        mHasCalledOnFocusChanged = false;
+        mHasCalledOnMeasure = false;
+        mHasCalledOnTextChanged = false;
+        mHasCalledOnPrivateIMECommand = false;
+        mHasCalledOnKeyMultiple = false;
+    }
+
+    public int computeHorizontalScrollRange() {
+        return super.computeHorizontalScrollRange();
+    }
+
+    public int computeVerticalScrollRange() {
+        return super.computeVerticalScrollRange();
+    }
+
+    @Override
+    protected void drawableStateChanged() {
+        super.drawableStateChanged();
+        mHasCalledDrawableStateChanged = true;
+    }
+
+    public boolean getDefaultEditable() {
+        return super.getDefaultEditable();
+    }
+
+    public MovementMethod getDefaultMovementMethod() {
+        return super.getDefaultMovementMethod();
+    }
+
+    @Override
+    protected void onCreateContextMenu(ContextMenu menu) {
+        super.onCreateContextMenu(menu);
+        mHasCalledOnCreateContextMenu = true;
+    }
+
+    @Override
+    protected void onDetachedFromWindow() {
+        super.onDetachedFromWindow();
+    }
+
+    @Override
+    protected void onDraw(Canvas canvas) {
+        super.onDraw(canvas);
+    }
+
+    @Override
+    protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
+        super.onFocusChanged(focused, direction, previouslyFocusedRect);
+        mHasCalledOnFocusChanged = true;
+    }
+
+    @Override
+    public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event) {
+        mHasCalledOnKeyMultiple = true;
+        return super.onKeyMultiple(keyCode, repeatCount, event);
+    }
+
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+        mHasCalledOnMeasure = true;
+    }
+
+    @Override
+    protected void onTextChanged(CharSequence text, int start, int before, int after) {
+        super.onTextChanged(text, start, before, after);
+        mHasCalledOnTextChanged = true;
+    }
+
+    public boolean setFrame(int l, int t, int r, int b) {
+        return super.setFrame(l, t, r, b);
+    }
+
+    @Override
+    public void onWindowFocusChanged(boolean hasWindowFocus) {
+        super.onWindowFocusChanged(hasWindowFocus);
+        mHasCalledOnWindowFocusChanged = true;
+    }
+
+    public float getLeftFadingEdgeStrength() {
+        return super.getLeftFadingEdgeStrength();
+    }
+
+    public float getRightFadingEdgeStrength() {
+        return super.getRightFadingEdgeStrength();
+    }
+
+    @Override
+    public boolean onPrivateIMECommand(String action, Bundle data) {
+        mHasCalledOnPrivateIMECommand = true;
+        return super.onPrivateIMECommand(action, data);
+    }
+
+    public int getFrameLeft() {
+        return mLeft;
+    }
+
+    public int getFrameTop() {
+        return mTop;
+    }
+
+    public int getFrameRight() {
+        return mRight;
+    }
+
+    public int getFrameBottom() {
+        return mBottom;
+    }
+
+    public int getBottomPaddingOffset() {
+        return super.getBottomPaddingOffset();
+    }
+
+    public int getLeftPaddingOffset() {
+        return super.getLeftPaddingOffset();
+    }
+
+    public int getRightPaddingOffset() {
+        return super.getRightPaddingOffset();
+    }
+
+    public int getTopPaddingOffset() {
+        return super.getTopPaddingOffset();
+    }
+
+    public boolean isPaddingOffsetRequired() {
+        return super.isPaddingOffsetRequired();
+    }
+
+    public boolean verifyDrawable(Drawable who) {
+        return super.verifyDrawable(who);
+    }
+
+    public int computeVerticalScrollExtent() {
+        return super.computeVerticalScrollExtent();
+    }
+}
diff --git a/tests/src/android/view/cts/MockView.java b/tests/tests/view/src/android/view/cts/MockView.java
similarity index 100%
rename from tests/src/android/view/cts/MockView.java
rename to tests/tests/view/src/android/view/cts/MockView.java
diff --git a/tests/src/android/view/cts/MockViewStub.java b/tests/tests/view/src/android/view/cts/MockViewStub.java
similarity index 100%
rename from tests/src/android/view/cts/MockViewStub.java
rename to tests/tests/view/src/android/view/cts/MockViewStub.java
diff --git a/tests/tests/view/src/android/view/cts/MyScrollView.java b/tests/tests/view/src/android/view/cts/MyScrollView.java
new file mode 100644
index 0000000..3701ab0
--- /dev/null
+++ b/tests/tests/view/src/android/view/cts/MyScrollView.java
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+
+package android.view.cts;
+
+import android.content.Context;
+import android.graphics.Rect;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.ScrollView;
+
+public class MyScrollView extends ScrollView {
+    public MyScrollView(Context context) {
+        super(context);
+    }
+
+    public MyScrollView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public MyScrollView(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+    }
+
+    @Override
+    protected int computeScrollDeltaToGetChildRectOnScreen(Rect rect) {
+        return super.computeScrollDeltaToGetChildRectOnScreen(rect);
+    }
+
+    @Override
+    protected int computeVerticalScrollRange() {
+        return super.computeVerticalScrollRange();
+    }
+
+    @Override
+    protected float getBottomFadingEdgeStrength() {
+        return super.getBottomFadingEdgeStrength();
+    }
+
+    @Override
+    protected float getTopFadingEdgeStrength() {
+        return super.getTopFadingEdgeStrength();
+    }
+
+    @Override
+    protected void measureChild(View c, int pWidthMeasureSpec, int pHeightMeasureSpec) {
+        super.measureChild(c, pWidthMeasureSpec, pHeightMeasureSpec);
+    }
+
+    @Override
+    protected void measureChildWithMargins(View child, int parentWidthMeasureSpec, int widthUsed,
+            int parentHeightMeasureSpec, int heightUsed) {
+        super.measureChildWithMargins(child, parentWidthMeasureSpec, widthUsed,
+                parentHeightMeasureSpec, heightUsed);
+    }
+}
diff --git a/tests/src/android/view/cts/SurfaceViewStubActivity.java b/tests/tests/view/src/android/view/cts/SurfaceViewCtsActivity.java
similarity index 98%
rename from tests/src/android/view/cts/SurfaceViewStubActivity.java
rename to tests/tests/view/src/android/view/cts/SurfaceViewCtsActivity.java
index 75d5ff6..a6bc5fb 100644
--- a/tests/src/android/view/cts/SurfaceViewStubActivity.java
+++ b/tests/tests/view/src/android/view/cts/SurfaceViewCtsActivity.java
@@ -26,7 +26,7 @@
 import android.view.SurfaceHolder;
 import android.view.SurfaceView;
 
-public class SurfaceViewStubActivity extends Activity {
+public class SurfaceViewCtsActivity extends Activity {
     private MockSurfaceView mSurfaceView;
 
     @Override
diff --git a/tests/tests/view/src/android/view/cts/SurfaceViewTest.java b/tests/tests/view/src/android/view/cts/SurfaceViewTest.java
index 65f05b8..d3902bb 100644
--- a/tests/tests/view/src/android/view/cts/SurfaceViewTest.java
+++ b/tests/tests/view/src/android/view/cts/SurfaceViewTest.java
@@ -28,16 +28,16 @@
 import android.view.KeyEvent;
 import android.view.SurfaceHolder;
 import android.view.SurfaceView;
-import android.view.cts.SurfaceViewStubActivity.MockSurfaceView;
+import android.view.cts.SurfaceViewCtsActivity.MockSurfaceView;
 
-public class SurfaceViewTest extends ActivityInstrumentationTestCase2<SurfaceViewStubActivity> {
+public class SurfaceViewTest extends ActivityInstrumentationTestCase2<SurfaceViewCtsActivity> {
 
     private Context mContext;
     private Instrumentation mInstrumentation;
     private MockSurfaceView mMockSurfaceView;
 
     public SurfaceViewTest() {
-        super("com.android.cts.stub", SurfaceViewStubActivity.class);
+        super("com.android.cts.view", SurfaceViewCtsActivity.class);
     }
 
     @Override
@@ -45,7 +45,7 @@
         super.setUp();
         mInstrumentation = getInstrumentation();
         mContext = mInstrumentation.getContext();
-        final SurfaceViewStubActivity activity = getActivity();
+        final SurfaceViewCtsActivity activity = getActivity();
         new PollingCheck() {
             @Override
                 protected boolean check() {
diff --git a/tests/src/android/view/cts/TestButton.java b/tests/tests/view/src/android/view/cts/TestButton.java
similarity index 100%
rename from tests/src/android/view/cts/TestButton.java
rename to tests/tests/view/src/android/view/cts/TestButton.java
diff --git a/tests/tests/view/src/android/view/cts/TouchDelegateTest.java b/tests/tests/view/src/android/view/cts/TouchDelegateTest.java
index 4e582a1..34d96bc 100644
--- a/tests/tests/view/src/android/view/cts/TouchDelegateTest.java
+++ b/tests/tests/view/src/android/view/cts/TouchDelegateTest.java
@@ -19,7 +19,6 @@
 
 import android.app.Activity;
 import android.app.Instrumentation;
-import android.app.cts.MockActivity;
 import android.graphics.Rect;
 import android.test.ActivityInstrumentationTestCase2;
 import android.test.UiThreadTest;
@@ -45,7 +44,7 @@
     private Exception mException;
 
     public TouchDelegateTest() {
-        super("com.android.cts.stub", MockActivity.class);
+        super("com.android.cts.view", MockActivity.class);
     }
 
     @Override
diff --git a/tests/src/android/view/cts/UsingViewsStubActivity.java b/tests/tests/view/src/android/view/cts/UsingViewsCtsActivity.java
similarity index 91%
rename from tests/src/android/view/cts/UsingViewsStubActivity.java
rename to tests/tests/view/src/android/view/cts/UsingViewsCtsActivity.java
index eb3aba7..a5ccbcd 100644
--- a/tests/src/android/view/cts/UsingViewsStubActivity.java
+++ b/tests/tests/view/src/android/view/cts/UsingViewsCtsActivity.java
@@ -18,12 +18,12 @@
 
 import android.app.Activity;
 import android.os.Bundle;
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 /**
  * A simple activity to test "Using Views"
  */
-public class UsingViewsStubActivity extends Activity {
+public class UsingViewsCtsActivity extends Activity {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
diff --git a/tests/tests/view/src/android/view/cts/ViewGroupCtsActivity.java b/tests/tests/view/src/android/view/cts/ViewGroupCtsActivity.java
new file mode 100644
index 0000000..71bb28c
--- /dev/null
+++ b/tests/tests/view/src/android/view/cts/ViewGroupCtsActivity.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2008 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 android.view.cts;
+
+import android.app.Activity;
+import android.app.cts.CTSResult;
+import android.os.Bundle;
+import android.os.Handler;
+import android.widget.TextView;
+
+public class ViewGroupCtsActivity extends Activity {
+
+    public static final String ACTION_INVALIDATE_CHILD = "invalidateChild";
+
+    private final Handler mHandler = new Handler();
+    private static CTSResult sResult;
+    public static void setResult(CTSResult result) {
+        sResult = result;
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(com.android.cts.view.R.layout.viewgrouptest_stub);
+        TextView textView = (TextView)findViewById(com.android.cts.view.R.id.viewgrouptest_stub);
+        textView.setText("test");
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+
+        String action = getIntent().getAction();
+        if (action.equals(ACTION_INVALIDATE_CHILD)) {
+            mHandler.postDelayed(new Runnable() {
+                public void run() {
+                    MockLinearLayout mll =
+                        (MockLinearLayout) findViewById(com.android.cts.view.R.id.
+                                                                        mocklinearlayout);
+                    if (!mll.mIsInvalidateChildInParentCalled) {
+                        fail();
+                        return;
+                    }
+                    sResult.setResult(CTSResult.RESULT_OK);
+                    finish();
+                }
+            }, 2000);
+        }
+    }
+
+    private void fail() {
+        sResult.setResult(CTSResult.RESULT_FAIL);
+        finish();
+    }
+}
+
diff --git a/tests/tests/view/src/android/view/cts/ViewGroupTest.java b/tests/tests/view/src/android/view/cts/ViewGroupTest.java
index b46c031..55428de 100644
--- a/tests/tests/view/src/android/view/cts/ViewGroupTest.java
+++ b/tests/tests/view/src/android/view/cts/ViewGroupTest.java
@@ -54,7 +54,6 @@
 import android.view.animation.Transformation;
 import android.view.animation.Animation.AnimationListener;
 import android.widget.TextView;
-import android.widget.cts.ViewGroupStubActivity;
 
 import java.util.ArrayList;
 
@@ -723,7 +722,7 @@
     public void testGenerateLayoutParamsWithParaAttributeSet() throws Exception{
         MockViewGroup vg = new MockViewGroup(mContext);
         XmlResourceParser set = mContext.getResources().getLayout(
-                com.android.cts.stub.R.layout.abslistview_layout);
+                com.android.cts.view.R.layout.abslistview_layout);
         XmlUtils.beginDocument(set, "ViewGroup_Layout");
         LayoutParams lp = vg.generateLayoutParams(set);
         assertNotNull(lp);
@@ -862,15 +861,15 @@
     private void setupActivity(String action) {
 
         Intent intent = new Intent(getInstrumentation().getTargetContext(),
-                ViewGroupStubActivity.class);
+                ViewGroupCtsActivity.class);
         intent.setAction(action);
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         getInstrumentation().getTargetContext().startActivity(intent);
     }
 
     public void testInvalidateChild() {
-        ViewGroupStubActivity.setResult(this);
-        setupActivity(ViewGroupStubActivity.ACTION_INVALIDATE_CHILD);
+        ViewGroupCtsActivity.setResult(this);
+        setupActivity(ViewGroupCtsActivity.ACTION_INVALIDATE_CHILD);
         waitForResult();
         assertEquals(CTSResult.RESULT_OK, mResultCode);
     }
diff --git a/tests/tests/view/src/android/view/cts/ViewGroup_LayoutParamsTest.java b/tests/tests/view/src/android/view/cts/ViewGroup_LayoutParamsTest.java
index 37bac7c..ded715a 100644
--- a/tests/tests/view/src/android/view/cts/ViewGroup_LayoutParamsTest.java
+++ b/tests/tests/view/src/android/view/cts/ViewGroup_LayoutParamsTest.java
@@ -28,7 +28,7 @@
 import android.view.ViewGroup;
 import android.view.ViewGroup.LayoutParams;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 import com.android.internal.util.XmlUtils;
 
 
diff --git a/tests/tests/view/src/android/view/cts/ViewGroup_MarginLayoutParamsTest.java b/tests/tests/view/src/android/view/cts/ViewGroup_MarginLayoutParamsTest.java
index fe364bc..d3fed0d 100644
--- a/tests/tests/view/src/android/view/cts/ViewGroup_MarginLayoutParamsTest.java
+++ b/tests/tests/view/src/android/view/cts/ViewGroup_MarginLayoutParamsTest.java
@@ -25,7 +25,7 @@
 
 import android.widget.LinearLayout;
 import com.android.internal.util.XmlUtils;
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 public class ViewGroup_MarginLayoutParamsTest extends InstrumentationTestCase {
diff --git a/tests/src/android/view/cts/ViewLayoutPositionTestStubActivity.java b/tests/tests/view/src/android/view/cts/ViewLayoutPositionTestCtsActivity.java
similarity index 89%
rename from tests/src/android/view/cts/ViewLayoutPositionTestStubActivity.java
rename to tests/tests/view/src/android/view/cts/ViewLayoutPositionTestCtsActivity.java
index d7ce635..69dc70f 100644
--- a/tests/src/android/view/cts/ViewLayoutPositionTestStubActivity.java
+++ b/tests/tests/view/src/android/view/cts/ViewLayoutPositionTestCtsActivity.java
@@ -18,9 +18,9 @@
 
 import android.app.Activity;
 import android.os.Bundle;
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
-public class ViewLayoutPositionTestStubActivity extends Activity {
+public class ViewLayoutPositionTestCtsActivity extends Activity {
     @Override
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
diff --git a/tests/src/android/view/cts/ViewStubStubActivity.java b/tests/tests/view/src/android/view/cts/ViewStubCtsActivity.java
similarity index 90%
rename from tests/src/android/view/cts/ViewStubStubActivity.java
rename to tests/tests/view/src/android/view/cts/ViewStubCtsActivity.java
index 2a05f8e..d2f2a4f 100644
--- a/tests/src/android/view/cts/ViewStubStubActivity.java
+++ b/tests/tests/view/src/android/view/cts/ViewStubCtsActivity.java
@@ -18,9 +18,9 @@
 
 import android.app.Activity;
 import android.os.Bundle;
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
-public class ViewStubStubActivity extends Activity {
+public class ViewStubCtsActivity extends Activity {
     @Override
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
diff --git a/tests/tests/view/src/android/view/cts/ViewStubTest.java b/tests/tests/view/src/android/view/cts/ViewStubTest.java
index 07834d2..53e251a 100644
--- a/tests/tests/view/src/android/view/cts/ViewStubTest.java
+++ b/tests/tests/view/src/android/view/cts/ViewStubTest.java
@@ -16,7 +16,7 @@
 
 package android.view.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 import dalvik.annotation.KnownFailure;
 
@@ -37,12 +37,12 @@
 /**
  * Test {@link ViewStub}.
  */
-public class ViewStubTest extends ActivityInstrumentationTestCase<ViewStubStubActivity> {
+public class ViewStubTest extends ActivityInstrumentationTestCase<ViewStubCtsActivity> {
     private Context mContext;
     private Activity mActivity;
 
     public ViewStubTest() {
-        super("com.android.cts.stub", ViewStubStubActivity.class);
+        super("com.android.cts.view", ViewStubCtsActivity.class);
     }
 
     @Override
diff --git a/tests/tests/view/src/android/view/cts/ViewTest.java b/tests/tests/view/src/android/view/cts/ViewTest.java
index 1c579ab..e8da40e 100644
--- a/tests/tests/view/src/android/view/cts/ViewTest.java
+++ b/tests/tests/view/src/android/view/cts/ViewTest.java
@@ -22,7 +22,7 @@
 import android.graphics.ColorFilter;
 import android.graphics.PorterDuff;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 import com.android.internal.view.menu.ContextMenuBuilder;
 import com.google.android.collect.Lists;
 
@@ -81,7 +81,6 @@
 import android.widget.EditText;
 import android.widget.LinearLayout;
 import android.widget.ListView;
-import android.widget.cts.StubActivity;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -90,14 +89,14 @@
 /**
  * Test {@link View}.
  */
-public class ViewTest extends ActivityInstrumentationTestCase2<ViewTestStubActivity> {
+public class ViewTest extends ActivityInstrumentationTestCase2<ViewTestCtsActivity> {
     public ViewTest() {
-        super(ViewTestStubActivity.class);
+        super(ViewTestCtsActivity.class);
     }
 
     private Resources mResources;
     private MockViewParent mMockParent;
-    private ViewTestStubActivity mActivity;
+    private ViewTestCtsActivity mActivity;
 
     /** timeout delta when wait in case the system is sluggish */
     private static final long TIMEOUT_DELTA = 10000;
@@ -2474,7 +2473,7 @@
         assertFalse(view.hasCalledOnWindowFocusChanged());
         assertFalse(view.hasCalledDispatchWindowFocusChanged());
 
-        StubActivity activity = launchActivity("com.android.cts.stub", StubActivity.class, null);
+        CtsActivity activity = launchActivity("com.android.cts.view", CtsActivity.class, null);
 
         // Wait until the window lost focus.
         new PollingCheck(TIMEOUT_DELTA) {
diff --git a/tests/src/android/view/cts/ViewTestStubActivity.java b/tests/tests/view/src/android/view/cts/ViewTestCtsActivity.java
similarity index 88%
rename from tests/src/android/view/cts/ViewTestStubActivity.java
rename to tests/tests/view/src/android/view/cts/ViewTestCtsActivity.java
index 69676cb..01215bc 100644
--- a/tests/src/android/view/cts/ViewTestStubActivity.java
+++ b/tests/tests/view/src/android/view/cts/ViewTestCtsActivity.java
@@ -20,9 +20,9 @@
 import android.os.Bundle;
 import android.os.SystemClock;
 import android.util.Log;
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
-public class ViewTestStubActivity extends Activity {
+public class ViewTestCtsActivity extends Activity {
     private boolean mHasWindowFocus = false;
     private Object mHasWindowFocusLock = new Object();
 
@@ -36,7 +36,7 @@
     public void onWindowFocusChanged(boolean hasFocus) {
         super.onWindowFocusChanged(hasFocus);
         if (!hasFocus) {
-            Log.w("ViewTestStubActivity", "ViewTestStubActivity lost window focus");
+            Log.w("ViewTestCtsActivity", "ViewTestCtsActivity lost window focus");
         }
         synchronized(mHasWindowFocusLock) {
             mHasWindowFocus = hasFocus;
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Blocks the calling thread until the {@link ViewTestStubActivity} has window focus or the
+     * Blocks the calling thread until the {@link ViewTestCtsActivity} has window focus or the
      * specified duration (in milliseconds) has passed.
      */
     public boolean waitForWindowFocus(long durationMillis) {
diff --git a/tests/tests/view/src/android/view/cts/ViewTreeObserverTest.java b/tests/tests/view/src/android/view/cts/ViewTreeObserverTest.java
index cc05853..1b21dac 100644
--- a/tests/tests/view/src/android/view/cts/ViewTreeObserverTest.java
+++ b/tests/tests/view/src/android/view/cts/ViewTreeObserverTest.java
@@ -16,11 +16,10 @@
 
 package android.view.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 import android.app.Activity;
 import android.app.Instrumentation;
-import android.app.cts.MockActivity;
 import android.cts.util.PollingCheck;
 import android.test.ActivityInstrumentationTestCase2;
 import android.test.TouchUtils;
diff --git a/tests/tests/view/src/android/view/cts/View_AnimationTest.java b/tests/tests/view/src/android/view/cts/View_AnimationTest.java
index bd86ed9..64bb2f7 100644
--- a/tests/tests/view/src/android/view/cts/View_AnimationTest.java
+++ b/tests/tests/view/src/android/view/cts/View_AnimationTest.java
@@ -24,13 +24,13 @@
 import android.view.animation.TranslateAnimation;
 import android.view.animation.cts.AnimationTestUtils;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 /**
  * Test {@link View}.
  */
-public class View_AnimationTest extends ActivityInstrumentationTestCase2<ViewTestStubActivity> {
+public class View_AnimationTest extends ActivityInstrumentationTestCase2<ViewTestCtsActivity> {
 
     private static final int TIME_OUT = 5000;
     private static final int DURATION = 2000;
@@ -40,7 +40,7 @@
     private TranslateAnimation mAnimation;
 
     public View_AnimationTest() {
-        super("com.android.cts.stub", ViewTestStubActivity.class);
+        super("com.android.cts.view", ViewTestCtsActivity.class);
     }
 
     @Override
diff --git a/tests/tests/view/src/android/view/cts/View_FocusHandlingTest.java b/tests/tests/view/src/android/view/cts/View_FocusHandlingTest.java
index 929ac7f..97992ee 100644
--- a/tests/tests/view/src/android/view/cts/View_FocusHandlingTest.java
+++ b/tests/tests/view/src/android/view/cts/View_FocusHandlingTest.java
@@ -16,7 +16,7 @@
 
 package android.view.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 import android.app.Activity;
@@ -26,9 +26,9 @@
 import android.view.View;
 
 public class View_FocusHandlingTest
-        extends ActivityInstrumentationTestCase2<FocusHandlingStubActivity> {
+        extends ActivityInstrumentationTestCase2<FocusHandlingCtsActivity> {
     public View_FocusHandlingTest() {
-        super("com.android.cts.stub", FocusHandlingStubActivity.class);
+        super("com.android.cts.view", FocusHandlingCtsActivity.class);
     }
 
     @UiThreadTest
diff --git a/tests/tests/view/src/android/view/cts/View_IdsTest.java b/tests/tests/view/src/android/view/cts/View_IdsTest.java
index ce94771..e65ccf5 100644
--- a/tests/tests/view/src/android/view/cts/View_IdsTest.java
+++ b/tests/tests/view/src/android/view/cts/View_IdsTest.java
@@ -16,7 +16,7 @@
 
 package android.view.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 import android.app.Activity;
@@ -27,9 +27,9 @@
 import android.widget.EditText;
 import android.widget.TextView;
 
-public class View_IdsTest extends ActivityInstrumentationTestCase2<UsingViewsStubActivity> {
+public class View_IdsTest extends ActivityInstrumentationTestCase2<UsingViewsCtsActivity> {
     public View_IdsTest() {
-        super("com.android.cts.stub", UsingViewsStubActivity.class);
+        super("com.android.cts.view", UsingViewsCtsActivity.class);
     }
 
     @UiThreadTest
diff --git a/tests/tests/view/src/android/view/cts/View_LayoutPositionTest.java b/tests/tests/view/src/android/view/cts/View_LayoutPositionTest.java
index db21be1..3938607 100644
--- a/tests/tests/view/src/android/view/cts/View_LayoutPositionTest.java
+++ b/tests/tests/view/src/android/view/cts/View_LayoutPositionTest.java
@@ -16,7 +16,7 @@
 
 package android.view.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 import android.app.Activity;
@@ -31,12 +31,12 @@
  * This part contains size, padding, margin, layout and drawing
  */
 public class View_LayoutPositionTest
-        extends ActivityInstrumentationTestCase2<ViewLayoutPositionTestStubActivity> {
+        extends ActivityInstrumentationTestCase2<ViewLayoutPositionTestCtsActivity> {
 
     private Activity mActivity;
 
     public View_LayoutPositionTest() {
-        super("com.android.cts.stub", ViewLayoutPositionTestStubActivity.class);
+        super("com.android.cts.view", ViewLayoutPositionTestCtsActivity.class);
     }
 
     @Override
diff --git a/tests/tests/view/src/android/view/cts/View_UsingViewsTest.java b/tests/tests/view/src/android/view/cts/View_UsingViewsTest.java
index 74f3c13..f6d067d 100644
--- a/tests/tests/view/src/android/view/cts/View_UsingViewsTest.java
+++ b/tests/tests/view/src/android/view/cts/View_UsingViewsTest.java
@@ -16,7 +16,7 @@
 
 package android.view.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 import android.app.Activity;
@@ -37,7 +37,7 @@
 import android.widget.TextView;
 
 
-public class View_UsingViewsTest extends ActivityInstrumentationTestCase2<UsingViewsStubActivity> {
+public class View_UsingViewsTest extends ActivityInstrumentationTestCase2<UsingViewsCtsActivity> {
     /**
      * country of Argentina
      */
@@ -78,7 +78,7 @@
     private TextView mWarningTextView;
 
     public View_UsingViewsTest() {
-        super("com.android.cts.stub", UsingViewsStubActivity.class);
+        super("com.android.cts.view", UsingViewsCtsActivity.class);
     }
 
     @Override
diff --git a/tests/tests/view/src/android/view/cts/WidgetTestUtils.java b/tests/tests/view/src/android/view/cts/WidgetTestUtils.java
new file mode 100644
index 0000000..e82e9df4
--- /dev/null
+++ b/tests/tests/view/src/android/view/cts/WidgetTestUtils.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2008 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 android.view.cts;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+
+import java.io.IOException;
+
+import junit.framework.Assert;
+
+/**
+ * The useful methods for widget test.
+ */
+public class WidgetTestUtils {
+    /**
+     * Assert that two bitmaps are equal.
+     *
+     * @param Bitmap b1 the first bitmap which needs to compare.
+     * @param Bitmap b2 the second bitmap which needs to compare.
+     */
+    public static void assertEquals(Bitmap b1, Bitmap b2) {
+        if (b1 == b2) {
+            return;
+        }
+
+        if (b1 == null || b2 == null) {
+            Assert.fail("the bitmaps are not equal");
+        }
+
+        // b1 and b2 are all not null.
+        if (b1.getWidth() != b2.getWidth() || b1.getHeight() != b2.getHeight()
+            || b1.getConfig() != b2.getConfig()) {
+            Assert.fail("the bitmaps are not equal");
+        }
+
+        int w = b1.getWidth();
+        int h = b1.getHeight();
+        int s = w * h;
+        int[] pixels1 = new int[s];
+        int[] pixels2 = new int[s];
+
+        b1.getPixels(pixels1, 0, w, 0, 0, w, h);
+        b2.getPixels(pixels2, 0, w, 0, 0, w, h);
+
+        for (int i = 0; i < s; i++) {
+            if (pixels1[i] != pixels2[i]) {
+                Assert.fail("the bitmaps are not equal");
+            }
+        }
+    }
+
+    /**
+     * Find beginning of the special element.
+     * @param parser XmlPullParser will be parsed.
+     * @param firstElementName the target element name.
+     *
+     * @throws XmlPullParserException if XML Pull Parser related faults occur.
+     * @throws IOException if I/O-related error occur when parsing.
+     */
+    public static final void beginDocument(XmlPullParser parser, String firstElementName)
+            throws XmlPullParserException, IOException {
+        Assert.assertNotNull(parser);
+        Assert.assertNotNull(firstElementName);
+
+        int type;
+        while ((type = parser.next()) != XmlPullParser.START_TAG
+                && type != XmlPullParser.END_DOCUMENT) {
+            ;
+        }
+
+        if (!parser.getName().equals(firstElementName)) {
+            throw new XmlPullParserException("Unexpected start tag: found " + parser.getName()
+                    + ", expected " + firstElementName);
+        }
+    }
+
+    /**
+     * Compare the expected pixels with actual, scaling for the target context density
+     *
+     * @throws AssertionFailedError
+     */
+    public static void assertScaledPixels(int expected, int actual, Context context) {
+        Assert.assertEquals(expected * context.getResources().getDisplayMetrics().density,
+                actual, 3);
+    }
+
+    /** Converts dips into pixels using the {@link Context}'s density. */
+    public static int convertDipToPixels(Context context, int dip) {
+      float density = context.getResources().getDisplayMetrics().density;
+      return Math.round(density * dip);
+    }
+
+    /**
+     * Retrieve a bitmap that can be used for comparison on any density
+     * @param resources
+     * @return the {@link Bitmap} or <code>null</code>
+     */
+    public static Bitmap getUnscaledBitmap(Resources resources, int resId) {
+        BitmapFactory.Options options = new BitmapFactory.Options();
+        options.inScaled = false;
+        return BitmapFactory.decodeResource(resources, resId, options);
+    }
+
+    /**
+     * Retrieve a dithered bitmap that can be used for comparison on any density
+     * @param resources
+     * @param config the preferred config for the returning bitmap
+     * @return the {@link Bitmap} or <code>null</code>
+     */
+    public static Bitmap getUnscaledAndDitheredBitmap(Resources resources,
+            int resId, Bitmap.Config config) {
+        BitmapFactory.Options options = new BitmapFactory.Options();
+        options.inDither = true;
+        options.inScaled = false;
+        options.inPreferredConfig = config;
+        return BitmapFactory.decodeResource(resources, resId, options);
+    }
+}
diff --git a/tests/src/android/view/cts/WindowStubActivity.java b/tests/tests/view/src/android/view/cts/WindowCtsActivity.java
similarity index 95%
rename from tests/src/android/view/cts/WindowStubActivity.java
rename to tests/tests/view/src/android/view/cts/WindowCtsActivity.java
index 502c947..8af808c 100644
--- a/tests/src/android/view/cts/WindowStubActivity.java
+++ b/tests/tests/view/src/android/view/cts/WindowCtsActivity.java
@@ -16,7 +16,7 @@
 
 package android.view.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 import android.app.Activity;
 import android.os.Bundle;
@@ -24,7 +24,7 @@
 import android.view.Menu;
 import android.view.Window;
 
-public class WindowStubActivity extends Activity {
+public class WindowCtsActivity extends Activity {
 
     private static boolean mIsOnCreateOptionsMenuCalled;
     private static boolean mIsOnOptionsMenuClosedCalled;
diff --git a/tests/tests/view/src/android/view/cts/WindowTest.java b/tests/tests/view/src/android/view/cts/WindowTest.java
index 5593795..9df13dc 100644
--- a/tests/tests/view/src/android/view/cts/WindowTest.java
+++ b/tests/tests/view/src/android/view/cts/WindowTest.java
@@ -16,7 +16,7 @@
 
 package android.view.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 import android.app.Instrumentation;
 import android.app.Presentation;
@@ -62,12 +62,12 @@
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 
-public class WindowTest extends ActivityInstrumentationTestCase2<WindowStubActivity> {
+public class WindowTest extends ActivityInstrumentationTestCase2<WindowCtsActivity> {
     static final String TAG = "WindowTest";
     private Window mWindow;
     private Context mContext;
     private Instrumentation mInstrumentation;
-    private WindowStubActivity mActivity;
+    private WindowCtsActivity mActivity;
 
     private static final int VIEWGROUP_LAYOUT_HEIGHT = 100;
     private static final int VIEWGROUP_LAYOUT_WIDTH = 200;
@@ -77,7 +77,7 @@
     private VirtualDisplay mVirtualDisplay;
 
     public WindowTest() {
-        super("com.android.cts.stub", WindowStubActivity.class);
+        super("com.android.cts.view", WindowCtsActivity.class);
     }
 
     @Override
diff --git a/tests/tests/view/src/android/view/inputmethod/cts/BaseInputConnectionTest.java b/tests/tests/view/src/android/view/inputmethod/cts/BaseInputConnectionTest.java
index 247578b..30edecb 100644
--- a/tests/tests/view/src/android/view/inputmethod/cts/BaseInputConnectionTest.java
+++ b/tests/tests/view/src/android/view/inputmethod/cts/BaseInputConnectionTest.java
@@ -16,7 +16,7 @@
 
 package android.view.inputmethod.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 
 import android.app.Instrumentation;
@@ -39,16 +39,16 @@
 import android.widget.EditText;
 
 public class BaseInputConnectionTest extends
-        ActivityInstrumentationTestCase2<InputMethodStubActivity> {
+        ActivityInstrumentationTestCase2<InputMethodCtsActivity> {
 
-    private InputMethodStubActivity mActivity;
+    private InputMethodCtsActivity mActivity;
     private Window mWindow;
     private EditText mView;
     private BaseInputConnection mConnection;
     private Instrumentation mInstrumentation;
 
     public BaseInputConnectionTest() {
-        super("com.android.cts.stub", InputMethodStubActivity.class);
+        super("com.android.cts.view", InputMethodCtsActivity.class);
     }
 
     @Override
diff --git a/tests/tests/view/src/android/view/inputmethod/cts/EditorInfoTest.java b/tests/tests/view/src/android/view/inputmethod/cts/EditorInfoTest.java
index 5bc4515..1981d6f 100644
--- a/tests/tests/view/src/android/view/inputmethod/cts/EditorInfoTest.java
+++ b/tests/tests/view/src/android/view/inputmethod/cts/EditorInfoTest.java
@@ -41,7 +41,7 @@
         info.initialSelStart = 0;
         info.inputType = EditorInfo.TYPE_MASK_CLASS;
         info.label = "label";
-        info.packageName = "com.android.cts.stub";
+        info.packageName = "com.android.cts.view";
         info.privateImeOptions = "privateIme";
         Bundle b = new Bundle();
         String key = "bundleKey";
diff --git a/tests/src/android/view/inputmethod/cts/InputMethodStubActivity.java b/tests/tests/view/src/android/view/inputmethod/cts/InputMethodCtsActivity.java
similarity index 90%
rename from tests/src/android/view/inputmethod/cts/InputMethodStubActivity.java
rename to tests/tests/view/src/android/view/inputmethod/cts/InputMethodCtsActivity.java
index 8117918..45e5ff2 100644
--- a/tests/src/android/view/inputmethod/cts/InputMethodStubActivity.java
+++ b/tests/tests/view/src/android/view/inputmethod/cts/InputMethodCtsActivity.java
@@ -17,9 +17,9 @@
 
 import android.app.Activity;
 import android.os.Bundle;
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
-public class InputMethodStubActivity extends Activity {
+public class InputMethodCtsActivity extends Activity {
     @Override
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
diff --git a/tests/tests/view/src/android/view/inputmethod/cts/InputMethodManagerTest.java b/tests/tests/view/src/android/view/inputmethod/cts/InputMethodManagerTest.java
index 033deb2..b84292f 100644
--- a/tests/tests/view/src/android/view/inputmethod/cts/InputMethodManagerTest.java
+++ b/tests/tests/view/src/android/view/inputmethod/cts/InputMethodManagerTest.java
@@ -15,7 +15,7 @@
  */
 package android.view.inputmethod.cts;
 
-import com.android.cts.stub.R;
+import com.android.cts.view.R;
 
 import android.app.Instrumentation;
 import android.content.Context;
@@ -35,13 +35,13 @@
 import java.util.List;
 
 public class InputMethodManagerTest
-                  extends ActivityInstrumentationTestCase2<InputMethodStubActivity> {
+                  extends ActivityInstrumentationTestCase2<InputMethodCtsActivity> {
 
     public InputMethodManagerTest() {
-        super("com.android.cts.stub", InputMethodStubActivity.class);
+        super("com.android.cts.view", InputMethodCtsActivity.class);
     }
 
-    private InputMethodStubActivity mActivity;
+    private InputMethodCtsActivity mActivity;
     private Instrumentation mInstrumentation;
 
     @Override
diff --git a/tests/src/android/view/inputmethod/cts/InputMethodSettingsActivityStub.java b/tests/tests/view/src/android/view/inputmethod/cts/InputMethodSettingsActivityStub.java
similarity index 100%
rename from tests/src/android/view/inputmethod/cts/InputMethodSettingsActivityStub.java
rename to tests/tests/view/src/android/view/inputmethod/cts/InputMethodSettingsActivityStub.java