From 0dc59e78e18493aecd37427531d093e800846c3e Mon Sep 17 00:00:00 2001 From: Brett Chabot Date: Thu, 1 Apr 2010 18:21:38 -0700 Subject: [PATCH] More framework tests cleanup. Move all tests for android.* classes from tests/AndroidTests and tests/CoreTests into framework/base//tests. Consolidate all tests for java.* classes to tests/CoreTests. Eventually hopefully these will be moved to dalvik/ somewhere. Remove tests/AndroidTests entirely. Change-Id: I86584d086ab7bd045bb38a10b699907805298a95 --- core/tests/coretests/Android.mk | 3 + core/tests/coretests/AndroidManifest.xml | 3 +- .../coretests}/DisabledTestApp/Android.mk | 0 .../DisabledTestApp/AndroidManifest.xml | 16 +- .../disabled_app/EnabledActivity.java | 2 +- .../coretests}/EnabledTestApp/Android.mk | 0 .../EnabledTestApp/AndroidManifest.xml | 23 +- .../enabled_app/DisabledActivity.java | 2 +- .../enabled_app/DisabledProvider.java | 2 +- .../enabled_app/DisabledReceiver.java | 2 +- .../enabled_app/DisabledService.java | 2 +- .../enabled_app/EnabledActivity.java | 2 +- .../enabled_app/EnabledProvider.java | 2 +- .../enabled_app/EnabledReceiver.java | 2 +- .../enabled_app/EnabledService.java | 2 +- .../apks/install_decl_perm/Android.mk | 2 +- .../install_decl_perm/AndroidManifest.xml | 36 +++ .../install_decl_perm/res/values/strings.xml | 0 .../apks/install_use_perm_good/Android.mk | 2 +- .../install_use_perm_good/AndroidManifest.xml | 17 +- .../res/values/strings.xml | 0 .../tests/coretests}/res/raw/alt_ip_only.crt | 0 .../coretests}/res/raw/subject_alt_only.crt | 0 .../tests/coretests}/res/raw/subject_only.crt | 0 .../res/raw/subject_with_alt_names.crt | 0 .../res/raw/subject_with_wild_alt_name.crt | 0 .../coretests}/res/raw/wild_alt_name_only.crt | 0 .../src/android/content}/BrickDeniedTest.java | 2 +- .../src}/android/content/SyncQueueTest.java | 0 .../src/android/content/pm}/AppCacheTest.java | 2 +- .../android/content/pm}/ComponentTest.java | 26 +-- .../content/pm/PackageManagerTests.java | 38 ++-- .../NewDatabasePerformanceTestSuite.java | 5 +- .../NewDatabasePerformanceTests.java | 2 +- .../coretests/src/android/text/HtmlTest.java | 194 +++++++++++++++- .../src/android/text/util}/LinkifyTest.java | 10 +- .../src/android/util}/PatternsTest.java | 2 +- .../android/internal/net}/DNParserTest.java | 2 +- .../net}/DomainNameValidatorTest.java | 4 +- .../internal/util/HanziToPinyinTest.java | 2 +- .../tests/graphicstests}/res/color/color1.xml | 0 .../res/color/color_no_default.xml | 0 .../graphicstests}/res/values/colors.xml | 0 .../android/graphics/ColorStateListTest.java | 3 +- .../drawable/StateListDrawableTest.java | 0 .../src}/android/view/MockView.java | 0 tests/AndroidTests/Android.mk | 21 -- tests/AndroidTests/AndroidManifest.xml | 59 ----- .../DisabledTestApp/AndroidManifest.xml | 13 -- tests/AndroidTests/MODULE_LICENSE_APACHE2 | 0 tests/AndroidTests/NOTICE | 190 ---------------- .../install_decl_perm/AndroidManifest.xml | 21 -- .../install_use_perm_good/AndroidManifest.xml | 10 - .../res/values-12key-63x57/configVarying.xml | 22 -- .../res/values-12key-dpad/configVarying.xml | 22 -- .../res/values-240dpi/configVarying.xml | 22 -- .../configVarying.xml | 22 -- .../res/values-32dpi-stylus/configVarying.xml | 22 -- .../res/values-32dpi/configVarying.xml | 22 -- .../res/values-480x320/configVarying.xml | 22 -- .../res/values-640x400/configVarying.xml | 22 -- tests/AndroidTests/res/values-cs/strings.xml | 25 -- .../res/values-dpad-63x57/configVarying.xml | 22 -- .../res/values-dpad/configVarying.xml | 22 -- .../res/values-fr-rFR/configVarying.xml | 22 -- .../res/values-fr/configVarying.xml | 22 -- .../configVarying.xml | 22 -- .../values-keysexposed-dpad/configVarying.xml | 22 -- .../res/values-keysexposed/configVarying.xml | 22 -- .../res/values-land/configVarying.xml | 22 -- .../res/values-mcc110-xx/configVarying.xml | 22 -- .../values-mcc111-mnc222/configVarying.xml | 22 -- .../values-mcc111-xx-rYY/configVarying.xml | 22 -- .../res/values-mcc111-xx/configVarying.xml | 22 -- .../res/values-mcc111/configVarying.xml | 22 -- .../res/values-mcc112/configVarying.xml | 22 -- .../res/values-mnc220-xx/configVarying.xml | 22 -- .../res/values-mnc222-32dpi/configVarying.xml | 22 -- .../values-mnc222-square/configVarying.xml | 22 -- .../res/values-mnc222-xx/configVarying.xml | 22 -- .../res/values-mnc222/configVarying.xml | 22 -- .../res/values-mnc223/configVarying.xml | 22 -- .../res/values-nokeys/configVarying.xml | 22 -- .../res/values-nonav/configVarying.xml | 22 -- .../res/values-notouch/configVarying.xml | 22 -- .../res/values-square-32dpi/configVarying.xml | 22 -- .../values-square-stylus/configVarying.xml | 22 -- .../res/values-square/configVarying.xml | 22 -- .../res/values-stylus-12key/configVarying.xml | 22 -- .../configVarying.xml | 22 -- .../res/values-stylus/configVarying.xml | 22 -- .../res/values-wheel/configVarying.xml | 22 -- .../res/values-xx-32dpi/configVarying.xml | 22 -- .../res/values-xx-rYY/configVarying.xml | 22 -- .../res/values-xx-square/configVarying.xml | 22 -- .../res/values-xx/configVarying.xml | 22 -- tests/AndroidTests/res/values/arrays.xml | 42 ---- tests/AndroidTests/res/values/attrs.xml | 44 ---- .../AndroidTests/res/values/configVarying.xml | 22 -- tests/AndroidTests/res/values/dimens.xml | 42 ---- tests/AndroidTests/res/values/strings.xml | 38 ---- tests/AndroidTests/res/values/styles.xml | 46 ---- tests/AndroidTests/run_test.sh | 4 - .../src/com/android/unit_tests/HtmlTest.java | 214 ------------------ .../core}/AndroidPerformanceTests.java | 2 +- .../core/ArrayListPerformanceTest.java} | 4 +- .../android/core/HashMapPerformanceTest.java} | 4 +- .../android/core}/HashSetTest.java | 2 +- .../android/core}/HashtableTest.java | 2 +- .../android/core}/HeapTest.java | 2 +- .../android/core}/InstanceofTest.java | 2 +- .../android/core}/JavaPerformanceTests.java | 10 +- .../android/core}/JniLibTest.java | 2 +- .../android/core}/LinkedListTest.java | 2 +- .../android/core/MathPerformanceTest.java} | 4 +- .../android/core}/MonitorTest.java | 2 +- .../android/core}/PerformanceTests.java | 9 +- .../android/core}/SerializationTest.java | 2 +- .../android/core}/StringTest.java | 2 +- .../android/core}/TestHttpClient.java | 2 +- .../android/core/TreeMapPerformanceTest.java} | 4 +- .../android/core}/TreeSetTest.java | 2 +- .../android/core}/VectorTest.java | 2 +- 123 files changed, 360 insertions(+), 1828 deletions(-) rename {tests/AndroidTests => core/tests/coretests}/DisabledTestApp/Android.mk (100%) rename tests/AndroidTests/res/values/bools.xml => core/tests/coretests/DisabledTestApp/AndroidManifest.xml (57%) rename {tests/AndroidTests/DisabledTestApp/src/com/android/unit_tests => core/tests/coretests/DisabledTestApp/src/com/android/frameworks/coretests}/disabled_app/EnabledActivity.java (93%) rename {tests/AndroidTests => core/tests/coretests}/EnabledTestApp/Android.mk (100%) rename {tests/AndroidTests => core/tests/coretests}/EnabledTestApp/AndroidManifest.xml (58%) rename {tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests => core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests}/enabled_app/DisabledActivity.java (93%) rename {tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests => core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests}/enabled_app/DisabledProvider.java (96%) rename {tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests => core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests}/enabled_app/DisabledReceiver.java (94%) rename {tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests => core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests}/enabled_app/DisabledService.java (94%) rename {tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests => core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests}/enabled_app/EnabledActivity.java (93%) rename {tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests => core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests}/enabled_app/EnabledProvider.java (96%) rename {tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests => core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests}/enabled_app/EnabledReceiver.java (94%) rename {tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests => core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests}/enabled_app/EnabledService.java (94%) rename {tests/AndroidTests => core/tests/coretests}/apks/install_decl_perm/Android.mk (72%) create mode 100644 core/tests/coretests/apks/install_decl_perm/AndroidManifest.xml rename {tests/AndroidTests => core/tests/coretests}/apks/install_decl_perm/res/values/strings.xml (100%) rename {tests/AndroidTests => core/tests/coretests}/apks/install_use_perm_good/Android.mk (71%) rename tests/AndroidTests/res/values-12key/configVarying.xml => core/tests/coretests/apks/install_use_perm_good/AndroidManifest.xml (54%) rename {tests/AndroidTests => core/tests/coretests}/apks/install_use_perm_good/res/values/strings.xml (100%) rename {tests/AndroidTests => core/tests/coretests}/res/raw/alt_ip_only.crt (100%) rename {tests/AndroidTests => core/tests/coretests}/res/raw/subject_alt_only.crt (100%) rename {tests/AndroidTests => core/tests/coretests}/res/raw/subject_only.crt (100%) rename {tests/AndroidTests => core/tests/coretests}/res/raw/subject_with_alt_names.crt (100%) rename {tests/AndroidTests => core/tests/coretests}/res/raw/subject_with_wild_alt_name.crt (100%) rename {tests/AndroidTests => core/tests/coretests}/res/raw/wild_alt_name_only.crt (100%) rename {tests/AndroidTests/src/com/android/unit_tests => core/tests/coretests/src/android/content}/BrickDeniedTest.java (97%) rename {tests/CoreTests => core/tests/coretests/src}/android/content/SyncQueueTest.java (100%) rename {tests/AndroidTests/src/com/android/unit_tests => core/tests/coretests/src/android/content/pm}/AppCacheTest.java (99%) rename {tests/AndroidTests/src/com/android/unit_tests => core/tests/coretests/src/android/content/pm}/ComponentTest.java (97%) rename {tests/AndroidTests/src/com/android/unit_tests => core/tests/coretests/src/android/database}/NewDatabasePerformanceTestSuite.java (96%) rename {tests/AndroidTests/src/com/android/unit_tests => core/tests/coretests/src/android/database}/NewDatabasePerformanceTests.java (99%) rename {tests/AndroidTests/src/com/android/unit_tests => core/tests/coretests/src/android/text/util}/LinkifyTest.java (92%) rename {tests/AndroidTests/src/com/android/unit_tests => core/tests/coretests/src/android/util}/PatternsTest.java (99%) rename {tests/AndroidTests/src/com/android/unit_tests => core/tests/coretests/src/com/android/internal/net}/DNParserTest.java (98%) rename {tests/AndroidTests/src/com/android/unit_tests => core/tests/coretests/src/com/android/internal/net}/DomainNameValidatorTest.java (99%) rename {tests/AndroidTests/src/com/android/unit_tests => core/tests/coretests/src/com/android}/internal/util/HanziToPinyinTest.java (98%) rename {tests/CoreTests/android => graphics/tests/graphicstests}/res/color/color1.xml (100%) rename {tests/CoreTests/android => graphics/tests/graphicstests}/res/color/color_no_default.xml (100%) rename {tests/CoreTests/android => graphics/tests/graphicstests}/res/values/colors.xml (100%) rename {tests/CoreTests => graphics/tests/graphicstests/src}/android/graphics/ColorStateListTest.java (98%) rename {tests/CoreTests => graphics/tests/graphicstests/src}/android/graphics/drawable/StateListDrawableTest.java (100%) rename {tests/CoreTests => graphics/tests/graphicstests/src}/android/view/MockView.java (100%) delete mode 100644 tests/AndroidTests/Android.mk delete mode 100644 tests/AndroidTests/AndroidManifest.xml delete mode 100644 tests/AndroidTests/DisabledTestApp/AndroidManifest.xml delete mode 100644 tests/AndroidTests/MODULE_LICENSE_APACHE2 delete mode 100644 tests/AndroidTests/NOTICE delete mode 100644 tests/AndroidTests/apks/install_decl_perm/AndroidManifest.xml delete mode 100644 tests/AndroidTests/apks/install_use_perm_good/AndroidManifest.xml delete mode 100644 tests/AndroidTests/res/values-12key-63x57/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-12key-dpad/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-240dpi/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-32dpi-keysexposed/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-32dpi-stylus/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-32dpi/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-480x320/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-640x400/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-cs/strings.xml delete mode 100644 tests/AndroidTests/res/values-dpad-63x57/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-dpad/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-fr-rFR/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-fr/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-keysexposed-12key/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-keysexposed-dpad/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-keysexposed/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-land/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-mcc110-xx/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-mcc111-mnc222/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-mcc111-xx-rYY/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-mcc111-xx/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-mcc111/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-mcc112/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-mnc220-xx/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-mnc222-32dpi/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-mnc222-square/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-mnc222-xx/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-mnc222/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-mnc223/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-nokeys/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-nonav/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-notouch/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-square-32dpi/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-square-stylus/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-square/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-stylus-12key/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-stylus-keysexposed/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-stylus/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-wheel/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-xx-32dpi/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-xx-rYY/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-xx-square/configVarying.xml delete mode 100644 tests/AndroidTests/res/values-xx/configVarying.xml delete mode 100644 tests/AndroidTests/res/values/arrays.xml delete mode 100644 tests/AndroidTests/res/values/attrs.xml delete mode 100644 tests/AndroidTests/res/values/configVarying.xml delete mode 100644 tests/AndroidTests/res/values/dimens.xml delete mode 100644 tests/AndroidTests/res/values/strings.xml delete mode 100644 tests/AndroidTests/res/values/styles.xml delete mode 100755 tests/AndroidTests/run_test.sh delete mode 100644 tests/AndroidTests/src/com/android/unit_tests/HtmlTest.java rename tests/{AndroidTests/src/com/android/unit_tests => CoreTests/android/core}/AndroidPerformanceTests.java (97%) rename tests/{AndroidTests/src/com/android/unit_tests/ArrayListTest.java => CoreTests/android/core/ArrayListPerformanceTest.java} (98%) rename tests/{AndroidTests/src/com/android/unit_tests/HashMapTest.java => CoreTests/android/core/HashMapPerformanceTest.java} (98%) rename tests/{AndroidTests/src/com/android/unit_tests => CoreTests/android/core}/HashSetTest.java (99%) rename tests/{AndroidTests/src/com/android/unit_tests => CoreTests/android/core}/HashtableTest.java (99%) rename tests/{AndroidTests/src/com/android/unit_tests => CoreTests/android/core}/HeapTest.java (99%) rename tests/{AndroidTests/src/com/android/unit_tests => CoreTests/android/core}/InstanceofTest.java (99%) rename tests/{AndroidTests/src/com/android/unit_tests => CoreTests/android/core}/JavaPerformanceTests.java (80%) rename tests/{AndroidTests/src/com/android/unit_tests => CoreTests/android/core}/JniLibTest.java (98%) rename tests/{AndroidTests/src/com/android/unit_tests => CoreTests/android/core}/LinkedListTest.java (99%) rename tests/{AndroidTests/src/com/android/unit_tests/MathTest.java => CoreTests/android/core/MathPerformanceTest.java} (99%) rename tests/{AndroidTests/src/com/android/unit_tests => CoreTests/android/core}/MonitorTest.java (99%) rename tests/{AndroidTests/src/com/android/unit_tests => CoreTests/android/core}/PerformanceTests.java (99%) rename tests/{AndroidTests/src/com/android/unit_tests => CoreTests/android/core}/SerializationTest.java (98%) rename tests/{AndroidTests/src/com/android/unit_tests => CoreTests/android/core}/StringTest.java (99%) rename tests/{AndroidTests/src/com/android/unit_tests => CoreTests/android/core}/TestHttpClient.java (99%) rename tests/{AndroidTests/src/com/android/unit_tests/TreeMapTest.java => CoreTests/android/core/TreeMapPerformanceTest.java} (99%) rename tests/{AndroidTests/src/com/android/unit_tests => CoreTests/android/core}/TreeSetTest.java (99%) rename tests/{AndroidTests/src/com/android/unit_tests => CoreTests/android/core}/VectorTest.java (99%) diff --git a/core/tests/coretests/Android.mk b/core/tests/coretests/Android.mk index b0e28430e58f4..c067b8008a3e6 100644 --- a/core/tests/coretests/Android.mk +++ b/core/tests/coretests/Android.mk @@ -7,6 +7,8 @@ LOCAL_MODULE_TAGS := tests # Include all test java files. LOCAL_SRC_FILES := \ $(call all-java-files-under, src) \ + $(call all-java-files-under, DisabledTestApp/src) \ + $(call all-java-files-under, EnabledTestApp/src) \ src/android/os/IAidlTest.aidl LOCAL_STATIC_JAVA_LIBRARIES += android-common @@ -18,3 +20,4 @@ LOCAL_CERTIFICATE := platform include $(BUILD_PACKAGE) +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/core/tests/coretests/AndroidManifest.xml b/core/tests/coretests/AndroidManifest.xml index 9972a8c22e31e..30855d17ffe3a 100644 --- a/core/tests/coretests/AndroidManifest.xml +++ b/core/tests/coretests/AndroidManifest.xml @@ -16,7 +16,8 @@ + package="com.android.frameworks.coretests" + android:sharedUserId="com.android.uid.test"> + - - true - false - + + + + + + + + + diff --git a/tests/AndroidTests/DisabledTestApp/src/com/android/unit_tests/disabled_app/EnabledActivity.java b/core/tests/coretests/DisabledTestApp/src/com/android/frameworks/coretests/disabled_app/EnabledActivity.java similarity index 93% rename from tests/AndroidTests/DisabledTestApp/src/com/android/unit_tests/disabled_app/EnabledActivity.java rename to core/tests/coretests/DisabledTestApp/src/com/android/frameworks/coretests/disabled_app/EnabledActivity.java index 4e4dc85df7f30..e676231b5daa8 100644 --- a/tests/AndroidTests/DisabledTestApp/src/com/android/unit_tests/disabled_app/EnabledActivity.java +++ b/core/tests/coretests/DisabledTestApp/src/com/android/frameworks/coretests/disabled_app/EnabledActivity.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests.disabled_app; +package com.android.frameworks.coretests.disabled_app; import android.app.Activity; diff --git a/tests/AndroidTests/EnabledTestApp/Android.mk b/core/tests/coretests/EnabledTestApp/Android.mk similarity index 100% rename from tests/AndroidTests/EnabledTestApp/Android.mk rename to core/tests/coretests/EnabledTestApp/Android.mk diff --git a/tests/AndroidTests/EnabledTestApp/AndroidManifest.xml b/core/tests/coretests/EnabledTestApp/AndroidManifest.xml similarity index 58% rename from tests/AndroidTests/EnabledTestApp/AndroidManifest.xml rename to core/tests/coretests/EnabledTestApp/AndroidManifest.xml index ad610f129a2a5..72d933a8137bd 100644 --- a/tests/AndroidTests/EnabledTestApp/AndroidManifest.xml +++ b/core/tests/coretests/EnabledTestApp/AndroidManifest.xml @@ -1,5 +1,20 @@ + + @@ -8,7 +23,7 @@ - + @@ -19,7 +34,7 @@ @@ -31,7 +46,7 @@ diff --git a/tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/DisabledActivity.java b/core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/DisabledActivity.java similarity index 93% rename from tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/DisabledActivity.java rename to core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/DisabledActivity.java index 0ab04162fdada..325adfee4f728 100644 --- a/tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/DisabledActivity.java +++ b/core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/DisabledActivity.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests.enabled_app; +package com.android.frameworks.coretests.enabled_app; import android.app.Activity; diff --git a/tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/DisabledProvider.java b/core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/DisabledProvider.java similarity index 96% rename from tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/DisabledProvider.java rename to core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/DisabledProvider.java index 06527f9fa5dc3..26781c48224ed 100644 --- a/tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/DisabledProvider.java +++ b/core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/DisabledProvider.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests.enabled_app; +package com.android.frameworks.coretests.enabled_app; import android.content.ContentProvider; import android.content.ContentValues; diff --git a/tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/DisabledReceiver.java b/core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/DisabledReceiver.java similarity index 94% rename from tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/DisabledReceiver.java rename to core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/DisabledReceiver.java index c27b87e63044e..b06d2ce98770c 100644 --- a/tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/DisabledReceiver.java +++ b/core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/DisabledReceiver.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests.enabled_app; +package com.android.frameworks.coretests.enabled_app; import android.content.BroadcastReceiver; import android.content.Context; diff --git a/tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/DisabledService.java b/core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/DisabledService.java similarity index 94% rename from tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/DisabledService.java rename to core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/DisabledService.java index ed8d0b93b6db2..ac66ae5c3ac01 100644 --- a/tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/DisabledService.java +++ b/core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/DisabledService.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests.enabled_app; +package com.android.frameworks.coretests.enabled_app; import android.app.Service; import android.os.IBinder; diff --git a/tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/EnabledActivity.java b/core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/EnabledActivity.java similarity index 93% rename from tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/EnabledActivity.java rename to core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/EnabledActivity.java index cfac3ec86bab7..1b0ac6df7144a 100644 --- a/tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/EnabledActivity.java +++ b/core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/EnabledActivity.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests.enabled_app; +package com.android.frameworks.coretests.enabled_app; import android.app.Activity; diff --git a/tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/EnabledProvider.java b/core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/EnabledProvider.java similarity index 96% rename from tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/EnabledProvider.java rename to core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/EnabledProvider.java index 764937f84fcdb..8da70b4d97f78 100644 --- a/tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/EnabledProvider.java +++ b/core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/EnabledProvider.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests.enabled_app; +package com.android.frameworks.coretests.enabled_app; import android.content.ContentProvider; import android.content.ContentValues; diff --git a/tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/EnabledReceiver.java b/core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/EnabledReceiver.java similarity index 94% rename from tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/EnabledReceiver.java rename to core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/EnabledReceiver.java index 707448f3823ce..6cee98d5848c1 100644 --- a/tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/EnabledReceiver.java +++ b/core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/EnabledReceiver.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests.enabled_app; +package com.android.frameworks.coretests.enabled_app; import android.content.BroadcastReceiver; import android.content.Context; diff --git a/tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/EnabledService.java b/core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/EnabledService.java similarity index 94% rename from tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/EnabledService.java rename to core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/EnabledService.java index 81a80b307782a..7d05db02de1f4 100644 --- a/tests/AndroidTests/EnabledTestApp/src/com/android/unit_tests/enabled_app/EnabledService.java +++ b/core/tests/coretests/EnabledTestApp/src/com/android/frameworks/coretests/enabled_app/EnabledService.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests.enabled_app; +package com.android.frameworks.coretests.enabled_app; import android.app.Service; import android.os.IBinder; diff --git a/tests/AndroidTests/apks/install_decl_perm/Android.mk b/core/tests/coretests/apks/install_decl_perm/Android.mk similarity index 72% rename from tests/AndroidTests/apks/install_decl_perm/Android.mk rename to core/tests/coretests/apks/install_decl_perm/Android.mk index 9dcf9a0f0a149..c38e98119f41d 100644 --- a/tests/AndroidTests/apks/install_decl_perm/Android.mk +++ b/core/tests/coretests/apks/install_decl_perm/Android.mk @@ -5,7 +5,7 @@ LOCAL_MODULE_TAGS := tests LOCAL_SRC_FILES := $(call all-subdir-java-files) -LOCAL_PACKAGE_NAME := AndroidTests_install_decl_perm +LOCAL_PACKAGE_NAME := FrameworkCoreTests_install_decl_perm include $(BUILD_PACKAGE) diff --git a/core/tests/coretests/apks/install_decl_perm/AndroidManifest.xml b/core/tests/coretests/apks/install_decl_perm/AndroidManifest.xml new file mode 100644 index 0000000000000..9a1f0ff7efb00 --- /dev/null +++ b/core/tests/coretests/apks/install_decl_perm/AndroidManifest.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + diff --git a/tests/AndroidTests/apks/install_decl_perm/res/values/strings.xml b/core/tests/coretests/apks/install_decl_perm/res/values/strings.xml similarity index 100% rename from tests/AndroidTests/apks/install_decl_perm/res/values/strings.xml rename to core/tests/coretests/apks/install_decl_perm/res/values/strings.xml diff --git a/tests/AndroidTests/apks/install_use_perm_good/Android.mk b/core/tests/coretests/apks/install_use_perm_good/Android.mk similarity index 71% rename from tests/AndroidTests/apks/install_use_perm_good/Android.mk rename to core/tests/coretests/apks/install_use_perm_good/Android.mk index a25a03c759644..1a07fc845826f 100644 --- a/tests/AndroidTests/apks/install_use_perm_good/Android.mk +++ b/core/tests/coretests/apks/install_use_perm_good/Android.mk @@ -5,7 +5,7 @@ LOCAL_MODULE_TAGS := tests LOCAL_SRC_FILES := $(call all-subdir-java-files) -LOCAL_PACKAGE_NAME := AndroidTests_install_use_perm_good +LOCAL_PACKAGE_NAME := FrameworkCoreTests_install_use_perm_good include $(BUILD_PACKAGE) diff --git a/tests/AndroidTests/res/values-12key/configVarying.xml b/core/tests/coretests/apks/install_use_perm_good/AndroidManifest.xml similarity index 54% rename from tests/AndroidTests/res/values-12key/configVarying.xml rename to core/tests/coretests/apks/install_use_perm_good/AndroidManifest.xml index e11340c697928..dadce7d55fba0 100644 --- a/tests/AndroidTests/res/values-12key/configVarying.xml +++ b/core/tests/coretests/apks/install_use_perm_good/AndroidManifest.xml @@ -1,5 +1,5 @@ - + - - simple 12key - - bag 12key - - + + + + + + + diff --git a/tests/AndroidTests/apks/install_use_perm_good/res/values/strings.xml b/core/tests/coretests/apks/install_use_perm_good/res/values/strings.xml similarity index 100% rename from tests/AndroidTests/apks/install_use_perm_good/res/values/strings.xml rename to core/tests/coretests/apks/install_use_perm_good/res/values/strings.xml diff --git a/tests/AndroidTests/res/raw/alt_ip_only.crt b/core/tests/coretests/res/raw/alt_ip_only.crt similarity index 100% rename from tests/AndroidTests/res/raw/alt_ip_only.crt rename to core/tests/coretests/res/raw/alt_ip_only.crt diff --git a/tests/AndroidTests/res/raw/subject_alt_only.crt b/core/tests/coretests/res/raw/subject_alt_only.crt similarity index 100% rename from tests/AndroidTests/res/raw/subject_alt_only.crt rename to core/tests/coretests/res/raw/subject_alt_only.crt diff --git a/tests/AndroidTests/res/raw/subject_only.crt b/core/tests/coretests/res/raw/subject_only.crt similarity index 100% rename from tests/AndroidTests/res/raw/subject_only.crt rename to core/tests/coretests/res/raw/subject_only.crt diff --git a/tests/AndroidTests/res/raw/subject_with_alt_names.crt b/core/tests/coretests/res/raw/subject_with_alt_names.crt similarity index 100% rename from tests/AndroidTests/res/raw/subject_with_alt_names.crt rename to core/tests/coretests/res/raw/subject_with_alt_names.crt diff --git a/tests/AndroidTests/res/raw/subject_with_wild_alt_name.crt b/core/tests/coretests/res/raw/subject_with_wild_alt_name.crt similarity index 100% rename from tests/AndroidTests/res/raw/subject_with_wild_alt_name.crt rename to core/tests/coretests/res/raw/subject_with_wild_alt_name.crt diff --git a/tests/AndroidTests/res/raw/wild_alt_name_only.crt b/core/tests/coretests/res/raw/wild_alt_name_only.crt similarity index 100% rename from tests/AndroidTests/res/raw/wild_alt_name_only.crt rename to core/tests/coretests/res/raw/wild_alt_name_only.crt diff --git a/tests/AndroidTests/src/com/android/unit_tests/BrickDeniedTest.java b/core/tests/coretests/src/android/content/BrickDeniedTest.java similarity index 97% rename from tests/AndroidTests/src/com/android/unit_tests/BrickDeniedTest.java rename to core/tests/coretests/src/android/content/BrickDeniedTest.java index 0f2b23ba6eaf8..c7d0b7acab666 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/BrickDeniedTest.java +++ b/core/tests/coretests/src/android/content/BrickDeniedTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.content; import android.content.Intent; import android.test.AndroidTestCase; diff --git a/tests/CoreTests/android/content/SyncQueueTest.java b/core/tests/coretests/src/android/content/SyncQueueTest.java similarity index 100% rename from tests/CoreTests/android/content/SyncQueueTest.java rename to core/tests/coretests/src/android/content/SyncQueueTest.java diff --git a/tests/AndroidTests/src/com/android/unit_tests/AppCacheTest.java b/core/tests/coretests/src/android/content/pm/AppCacheTest.java similarity index 99% rename from tests/AndroidTests/src/com/android/unit_tests/AppCacheTest.java rename to core/tests/coretests/src/android/content/pm/AppCacheTest.java index fa7b9ff51d9c6..dbb10b1ba36dc 100755 --- a/tests/AndroidTests/src/com/android/unit_tests/AppCacheTest.java +++ b/core/tests/coretests/src/android/content/pm/AppCacheTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.content.pm; import java.io.File; import java.io.FileInputStream; diff --git a/tests/AndroidTests/src/com/android/unit_tests/ComponentTest.java b/core/tests/coretests/src/android/content/pm/ComponentTest.java similarity index 97% rename from tests/AndroidTests/src/com/android/unit_tests/ComponentTest.java rename to core/tests/coretests/src/android/content/pm/ComponentTest.java index 08fe7427f25e8..ebfbd683fcfb4 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/ComponentTest.java +++ b/core/tests/coretests/src/android/content/pm/ComponentTest.java @@ -14,16 +14,16 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.content.pm; -import com.android.unit_tests.enabled_app.DisabledActivity; -import com.android.unit_tests.enabled_app.DisabledProvider; -import com.android.unit_tests.enabled_app.DisabledReceiver; -import com.android.unit_tests.enabled_app.DisabledService; -import com.android.unit_tests.enabled_app.EnabledActivity; -import com.android.unit_tests.enabled_app.EnabledProvider; -import com.android.unit_tests.enabled_app.EnabledReceiver; -import com.android.unit_tests.enabled_app.EnabledService; +import com.android.frameworks.coretests.enabled_app.DisabledActivity; +import com.android.frameworks.coretests.enabled_app.DisabledProvider; +import com.android.frameworks.coretests.enabled_app.DisabledReceiver; +import com.android.frameworks.coretests.enabled_app.DisabledService; +import com.android.frameworks.coretests.enabled_app.EnabledActivity; +import com.android.frameworks.coretests.enabled_app.EnabledProvider; +import com.android.frameworks.coretests.enabled_app.EnabledReceiver; +import com.android.frameworks.coretests.enabled_app.EnabledService; import android.content.ComponentName; import android.content.Intent; @@ -65,9 +65,9 @@ public class ComponentTest extends AndroidTestCase { private Intent mDisabledAppEnabledActivityIntent; private static final String ENABLED_PACKAGENAME = - "com.android.unit_tests.enabled_app"; + "com.android.frameworks.coretests.enabled_app"; private static final String DISABLED_PACKAGENAME = - "com.android.unit_tests.disabled_app"; + "com.android.frameworks.coretests.disabled_app"; private static final String DISABLED_ACTIVITY_CLASSNAME = DisabledActivity.class.getName(); private static final ComponentName DISABLED_ACTIVITY_COMPONENTNAME = @@ -103,11 +103,11 @@ public class ComponentTest extends AndroidTestCase { new ComponentName(ENABLED_PACKAGENAME, ENABLED_PROVIDER_CLASSNAME); private static final String ENABLED_PROVIDER_NAME = EnabledProvider.class.getName(); private static final String DISABLED_APP_ENABLED_ACTIVITY_CLASSNAME = - com.android.unit_tests.disabled_app.EnabledActivity.class.getName(); + com.android.frameworks.coretests.disabled_app.EnabledActivity.class.getName(); private static final ComponentName DISABLED_APP_ENABLED_ACTIVITY_COMPONENTNAME = new ComponentName(DISABLED_PACKAGENAME, DISABLED_APP_ENABLED_ACTIVITY_CLASSNAME); private static final String TEST_CATEGORY = - "com.android.unit_tests.enabled_app.TEST_CATEGORY"; + "com.android.frameworks.coretests.enabled_app.TEST_CATEGORY"; @Override protected void setUp() throws Exception { diff --git a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java index aec82afed58d2..c699c10215bf6 100755 --- a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java +++ b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java @@ -1946,42 +1946,42 @@ public class PackageManagerTests extends AndroidTestCase { static final String BASE_PERMISSIONS_DEFINED[] = new String[] { PERM_PACKAGE, "com.android.unit_tests.install_decl_perm", PERM_DEFINED, - "com.android.unit_tests.NORMAL", - "com.android.unit_tests.DANGEROUS", - "com.android.unit_tests.SIGNATURE", + "com.android.frameworks.coretests.NORMAL", + "com.android.frameworks.coretests.DANGEROUS", + "com.android.frameworks.coretests.SIGNATURE", }; static final String BASE_PERMISSIONS_UNDEFINED[] = new String[] { - PERM_PACKAGE, "com.android.unit_tests.install_decl_perm", + PERM_PACKAGE, "com.android.frameworks.coretests.install_decl_perm", PERM_UNDEFINED, - "com.android.unit_tests.NORMAL", - "com.android.unit_tests.DANGEROUS", - "com.android.unit_tests.SIGNATURE", + "com.android.frameworks.coretests.NORMAL", + "com.android.frameworks.coretests.DANGEROUS", + "com.android.frameworks.coretests.SIGNATURE", }; static final String BASE_PERMISSIONS_USED[] = new String[] { - PERM_PACKAGE, "com.android.unit_tests.install_use_perm_good", + PERM_PACKAGE, "com.android.frameworks.coretests.install_use_perm_good", PERM_USED, - "com.android.unit_tests.NORMAL", - "com.android.unit_tests.DANGEROUS", - "com.android.unit_tests.SIGNATURE", + "com.android.frameworks.coretests.NORMAL", + "com.android.frameworks.coretests.DANGEROUS", + "com.android.frameworks.coretests.SIGNATURE", }; static final String BASE_PERMISSIONS_NOTUSED[] = new String[] { - PERM_PACKAGE, "com.android.unit_tests.install_use_perm_good", + PERM_PACKAGE, "com.android.frameworks.coretests.install_use_perm_good", PERM_NOTUSED, - "com.android.unit_tests.NORMAL", - "com.android.unit_tests.DANGEROUS", - "com.android.unit_tests.SIGNATURE", + "com.android.frameworks.coretests.NORMAL", + "com.android.frameworks.coretests.DANGEROUS", + "com.android.frameworks.coretests.SIGNATURE", }; static final String BASE_PERMISSIONS_SIGUSED[] = new String[] { - PERM_PACKAGE, "com.android.unit_tests.install_use_perm_good", + PERM_PACKAGE, "com.android.frameworks.coretests.install_use_perm_good", PERM_USED, - "com.android.unit_tests.SIGNATURE", + "com.android.frameworks.coretests.SIGNATURE", PERM_NOTUSED, - "com.android.unit_tests.NORMAL", - "com.android.unit_tests.DANGEROUS", + "com.android.frameworks.coretests.NORMAL", + "com.android.frameworks.coretests.DANGEROUS", }; /* diff --git a/tests/AndroidTests/src/com/android/unit_tests/NewDatabasePerformanceTestSuite.java b/core/tests/coretests/src/android/database/NewDatabasePerformanceTestSuite.java similarity index 96% rename from tests/AndroidTests/src/com/android/unit_tests/NewDatabasePerformanceTestSuite.java rename to core/tests/coretests/src/android/database/NewDatabasePerformanceTestSuite.java index 3462f97dec077..31cf5151e7754 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/NewDatabasePerformanceTestSuite.java +++ b/core/tests/coretests/src/android/database/NewDatabasePerformanceTestSuite.java @@ -14,12 +14,9 @@ * limitations under the License. */ -package com.android.unit_tests; -import android.test.FrameworkTests; -import android.test.suitebuilder.TestSuiteBuilder; +package android.database; import junit.framework.TestSuite; -import junit.framework.TestCase; public class NewDatabasePerformanceTestSuite extends TestSuite { public static TestSuite suite() { diff --git a/tests/AndroidTests/src/com/android/unit_tests/NewDatabasePerformanceTests.java b/core/tests/coretests/src/android/database/NewDatabasePerformanceTests.java similarity index 99% rename from tests/AndroidTests/src/com/android/unit_tests/NewDatabasePerformanceTests.java rename to core/tests/coretests/src/android/database/NewDatabasePerformanceTests.java index 8644fbb657d34..0dca90b064384 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/NewDatabasePerformanceTests.java +++ b/core/tests/coretests/src/android/database/NewDatabasePerformanceTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.database; import android.content.ContentValues; import android.database.sqlite.SQLiteDatabase; diff --git a/core/tests/coretests/src/android/text/HtmlTest.java b/core/tests/coretests/src/android/text/HtmlTest.java index a79b93eabeb30..c07d212bedc38 100644 --- a/core/tests/coretests/src/android/text/HtmlTest.java +++ b/core/tests/coretests/src/android/text/HtmlTest.java @@ -16,14 +16,25 @@ package android.text; -import android.test.InstrumentationTestCase; -import android.test.suitebuilder.annotation.MediumTest; -import android.text.Html; -import android.text.Spanned; -import android.text.style.StyleSpan; +import android.content.res.ColorStateList; +import android.content.res.Resources; import android.graphics.Typeface; +import android.test.suitebuilder.annotation.MediumTest; +import android.test.suitebuilder.annotation.SmallTest; +import android.text.style.ForegroundColorSpan; +import android.text.style.QuoteSpan; +import android.text.style.StrikethroughSpan; +import android.text.style.StyleSpan; +import android.text.style.SubscriptSpan; +import android.text.style.SuperscriptSpan; +import android.text.style.TextAppearanceSpan; +import android.text.style.TypefaceSpan; +import android.text.style.URLSpan; +import android.text.style.UnderlineSpan; -public class HtmlTest extends InstrumentationTestCase { +import junit.framework.TestCase; + +public class HtmlTest extends TestCase { @MediumTest public void testSingleTagOnWhileString() { @@ -63,4 +74,175 @@ public class HtmlTest extends InstrumentationTestCase { String spanned = Html.fromHtml("© > <").toString(); assertEquals("\u00a9 > <", spanned); } + + @MediumTest + public void testColor() throws Exception { + Spanned s; + ForegroundColorSpan[] colors; + + s = Html.fromHtml("something"); + colors = s.getSpans(0, s.length(), ForegroundColorSpan.class); + assertEquals(1, colors.length); + assertEquals(0xFF00FF00, colors[0].getForegroundColor()); + + s = Html.fromHtml("something"); + colors = s.getSpans(0, s.length(), ForegroundColorSpan.class); + assertEquals(1, colors.length); + assertEquals(0xFF000080, colors[0].getForegroundColor()); + + s = Html.fromHtml("something"); + colors = s.getSpans(0, s.length(), ForegroundColorSpan.class); + assertEquals(0, colors.length); + } + + @MediumTest + public void testResourceColor() throws Exception { + ColorStateList c = + Resources.getSystem().getColorStateList(android.R.color.primary_text_dark); + Spanned s; + TextAppearanceSpan[] colors; + + s = Html.fromHtml("something"); + colors = s.getSpans(0, s.length(), TextAppearanceSpan.class); + assertEquals(1, colors.length); + assertEquals(c.toString(), colors[0].getTextColor().toString()); + + s = Html.fromHtml("something"); + colors = s.getSpans(0, s.length(), TextAppearanceSpan.class); + assertEquals(1, colors.length); + assertEquals(c.toString(), colors[0].getTextColor().toString()); + + s = Html.fromHtml("something"); + colors = s.getSpans(0, s.length(), TextAppearanceSpan.class); + assertEquals(1, colors.length); + assertEquals(c.toString(), colors[0].getTextColor().toString()); + + s = Html.fromHtml("something"); + colors = s.getSpans(0, s.length(), TextAppearanceSpan.class); + assertEquals(1, colors.length); + assertEquals(c.toString(), colors[0].getTextColor().toString()); + + s = Html.fromHtml("something"); + colors = s.getSpans(0, s.length(), TextAppearanceSpan.class); + assertEquals(1, colors.length); + assertEquals(c.toString(), colors[0].getTextColor().toString()); + + s = Html.fromHtml("something"); + colors = s.getSpans(0, s.length(), TextAppearanceSpan.class); + assertEquals(colors.length, 0); + } + + @SmallTest + public void testParagraphs() throws Exception { + SpannableString s; + + s = new SpannableString("Hello world"); + assertEquals(Html.toHtml(s), "

Hello world

\n"); + + s = new SpannableString("Hello world\nor something"); + assertEquals(Html.toHtml(s), "

Hello world
\nor something

\n"); + + s = new SpannableString("Hello world\n\nor something"); + assertEquals(Html.toHtml(s), "

Hello world

\n

or something

\n"); + + s = new SpannableString("Hello world\n\n\nor something"); + assertEquals(Html.toHtml(s), "

Hello world

\n

or something

\n"); + + assertEquals("foo\nbar", Html.fromHtml("foo
bar").toString()); + assertEquals("foo\nbar", Html.fromHtml("foo
\nbar").toString()); + assertEquals("foo\nbar", Html.fromHtml("foo
\n \nbar").toString()); + } + + @SmallTest + public void testBlockquote() throws Exception { + SpannableString s; + + s = new SpannableString("Hello world"); + s.setSpan(new QuoteSpan(), 0, s.length(), Spannable.SPAN_PARAGRAPH); + assertEquals(Html.toHtml(s), "

Hello world

\n
\n"); + + s = new SpannableString("Hello\n\nworld"); + s.setSpan(new QuoteSpan(), 0, 7, Spannable.SPAN_PARAGRAPH); + assertEquals(Html.toHtml(s), "

Hello

\n
\n

world

\n"); + } + + @SmallTest + public void testEntities() throws Exception { + SpannableString s; + + s = new SpannableString("Hello <&> world"); + assertEquals(Html.toHtml(s), "

Hello <&> world

\n"); + + s = new SpannableString("Hello \u03D5 world"); + assertEquals(Html.toHtml(s), "

Hello ϕ world

\n"); + + s = new SpannableString("Hello world"); + assertEquals(Html.toHtml(s), "

Hello  world

\n"); + } + + @SmallTest + public void testMarkup() throws Exception { + SpannableString s; + + s = new SpannableString("Hello bold world"); + s.setSpan(new StyleSpan(Typeface.BOLD), 6, s.length() - 6, + Spannable.SPAN_EXCLUSIVE_INCLUSIVE); + assertEquals(Html.toHtml(s), "

Hello bold world

\n"); + + s = new SpannableString("Hello italic world"); + s.setSpan(new StyleSpan(Typeface.ITALIC), 6, s.length() - 6, + Spannable.SPAN_EXCLUSIVE_INCLUSIVE); + assertEquals(Html.toHtml(s), "

Hello italic world

\n"); + + s = new SpannableString("Hello monospace world"); + s.setSpan(new TypefaceSpan("monospace"), 6, s.length() - 6, + Spannable.SPAN_EXCLUSIVE_INCLUSIVE); + assertEquals(Html.toHtml(s), "

Hello monospace world

\n"); + + s = new SpannableString("Hello superscript world"); + s.setSpan(new SuperscriptSpan(), 6, s.length() - 6, + Spannable.SPAN_EXCLUSIVE_INCLUSIVE); + assertEquals(Html.toHtml(s), "

Hello superscript world

\n"); + + s = new SpannableString("Hello subscript world"); + s.setSpan(new SubscriptSpan(), 6, s.length() - 6, + Spannable.SPAN_EXCLUSIVE_INCLUSIVE); + assertEquals(Html.toHtml(s), "

Hello subscript world

\n"); + + s = new SpannableString("Hello underline world"); + s.setSpan(new UnderlineSpan(), 6, s.length() - 6, + Spannable.SPAN_EXCLUSIVE_INCLUSIVE); + assertEquals(Html.toHtml(s), "

Hello underline world

\n"); + + s = new SpannableString("Hello struck world"); + s.setSpan(new StrikethroughSpan(), 6, s.length() - 6, + Spannable.SPAN_EXCLUSIVE_INCLUSIVE); + assertEquals(Html.toHtml(s), "

Hello struck world

\n"); + + s = new SpannableString("Hello linky world"); + s.setSpan(new URLSpan("http://www.google.com"), 6, s.length() - 6, + Spannable.SPAN_EXCLUSIVE_INCLUSIVE); + assertEquals(Html.toHtml(s), + "

Hello linky world

\n"); + } + + @SmallTest + public void testImg() throws Exception { + Spanned s; + + s = Html.fromHtml("yesno"); + + assertEquals("

yesno

\n", + Html.toHtml(s)); + } + + @SmallTest + public void testUtf8() throws Exception { + Spanned s; + + s = Html.fromHtml("

\u0124\u00eb\u0142\u0142o, world!

"); + assertEquals("

Ĥëłło, world!

\n", Html.toHtml(s)); + } + } diff --git a/tests/AndroidTests/src/com/android/unit_tests/LinkifyTest.java b/core/tests/coretests/src/android/text/util/LinkifyTest.java similarity index 92% rename from tests/AndroidTests/src/com/android/unit_tests/LinkifyTest.java rename to core/tests/coretests/src/android/text/util/LinkifyTest.java index 83e07584be710..99c6501f817d3 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/LinkifyTest.java +++ b/core/tests/coretests/src/android/text/util/LinkifyTest.java @@ -14,16 +14,14 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.text.util; import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.SmallTest; -import android.text.*; -import android.text.method.*; -import android.text.style.*; -import android.text.util.*; -import android.widget.*; +import android.text.method.LinkMovementMethod; +import android.text.util.Linkify; +import android.widget.TextView; /** * LinkifyTest tests {@link Linkify}. diff --git a/tests/AndroidTests/src/com/android/unit_tests/PatternsTest.java b/core/tests/coretests/src/android/util/PatternsTest.java similarity index 99% rename from tests/AndroidTests/src/com/android/unit_tests/PatternsTest.java rename to core/tests/coretests/src/android/util/PatternsTest.java index 0edcd6d10d302..957c5937fcc8c 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/PatternsTest.java +++ b/core/tests/coretests/src/android/util/PatternsTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.unit_tests; +package android.util; import android.test.suitebuilder.annotation.SmallTest; import android.util.Patterns; diff --git a/tests/AndroidTests/src/com/android/unit_tests/DNParserTest.java b/core/tests/coretests/src/com/android/internal/net/DNParserTest.java similarity index 98% rename from tests/AndroidTests/src/com/android/unit_tests/DNParserTest.java rename to core/tests/coretests/src/com/android/internal/net/DNParserTest.java index 61d0b4298154a..9b490a329d57a 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/DNParserTest.java +++ b/core/tests/coretests/src/com/android/internal/net/DNParserTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.unit_tests; +package com.android.internal.net; import com.android.internal.net.DNParser; diff --git a/tests/AndroidTests/src/com/android/unit_tests/DomainNameValidatorTest.java b/core/tests/coretests/src/com/android/internal/net/DomainNameValidatorTest.java similarity index 99% rename from tests/AndroidTests/src/com/android/unit_tests/DomainNameValidatorTest.java rename to core/tests/coretests/src/com/android/internal/net/DomainNameValidatorTest.java index 1754dbe2818ad..f0d581e855ae5 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/DomainNameValidatorTest.java +++ b/core/tests/coretests/src/com/android/internal/net/DomainNameValidatorTest.java @@ -13,9 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.unit_tests; +package com.android.internal.net; import com.android.internal.net.DomainNameValidator; +import com.android.frameworks.coretests.R; +import com.android.frameworks.coretests.R.raw; import android.test.AndroidTestCase; diff --git a/tests/AndroidTests/src/com/android/unit_tests/internal/util/HanziToPinyinTest.java b/core/tests/coretests/src/com/android/internal/util/HanziToPinyinTest.java similarity index 98% rename from tests/AndroidTests/src/com/android/unit_tests/internal/util/HanziToPinyinTest.java rename to core/tests/coretests/src/com/android/internal/util/HanziToPinyinTest.java index 71a8ea766d140..36dee7029f0c2 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/internal/util/HanziToPinyinTest.java +++ b/core/tests/coretests/src/com/android/internal/util/HanziToPinyinTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests.internal.util; +package com.android.internal.util; import java.text.Collator; import java.util.Arrays; diff --git a/tests/CoreTests/android/res/color/color1.xml b/graphics/tests/graphicstests/res/color/color1.xml similarity index 100% rename from tests/CoreTests/android/res/color/color1.xml rename to graphics/tests/graphicstests/res/color/color1.xml diff --git a/tests/CoreTests/android/res/color/color_no_default.xml b/graphics/tests/graphicstests/res/color/color_no_default.xml similarity index 100% rename from tests/CoreTests/android/res/color/color_no_default.xml rename to graphics/tests/graphicstests/res/color/color_no_default.xml diff --git a/tests/CoreTests/android/res/values/colors.xml b/graphics/tests/graphicstests/res/values/colors.xml similarity index 100% rename from tests/CoreTests/android/res/values/colors.xml rename to graphics/tests/graphicstests/res/values/colors.xml diff --git a/tests/CoreTests/android/graphics/ColorStateListTest.java b/graphics/tests/graphicstests/src/android/graphics/ColorStateListTest.java similarity index 98% rename from tests/CoreTests/android/graphics/ColorStateListTest.java rename to graphics/tests/graphicstests/src/android/graphics/ColorStateListTest.java index 68c2fc19c473b..eb1025c36c187 100644 --- a/tests/CoreTests/android/graphics/ColorStateListTest.java +++ b/graphics/tests/graphicstests/src/android/graphics/ColorStateListTest.java @@ -16,10 +16,11 @@ package android.graphics; +import com.android.frameworks.graphicstests.R; + import android.content.res.Resources; import android.content.res.ColorStateList; import android.test.AndroidTestCase; -import android.core.R; import android.test.suitebuilder.annotation.SmallTest; /** diff --git a/tests/CoreTests/android/graphics/drawable/StateListDrawableTest.java b/graphics/tests/graphicstests/src/android/graphics/drawable/StateListDrawableTest.java similarity index 100% rename from tests/CoreTests/android/graphics/drawable/StateListDrawableTest.java rename to graphics/tests/graphicstests/src/android/graphics/drawable/StateListDrawableTest.java diff --git a/tests/CoreTests/android/view/MockView.java b/graphics/tests/graphicstests/src/android/view/MockView.java similarity index 100% rename from tests/CoreTests/android/view/MockView.java rename to graphics/tests/graphicstests/src/android/view/MockView.java diff --git a/tests/AndroidTests/Android.mk b/tests/AndroidTests/Android.mk deleted file mode 100644 index c22547feaf5bd..0000000000000 --- a/tests/AndroidTests/Android.mk +++ /dev/null @@ -1,21 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := tests - -LOCAL_JAVA_LIBRARIES := framework-tests android.test.runner services - -# Resource unit tests use a private locale -LOCAL_AAPT_FLAGS = -c xx_YY -c cs -c 160dpi -c 32dpi -c 240dpi - -LOCAL_SRC_FILES := \ - $(call all-subdir-java-files) - -LOCAL_PACKAGE_NAME := AndroidTests -LOCAL_CERTIFICATE := platform - -include $(BUILD_PACKAGE) - -LOCAL_STORED_PATH:= $(LOCAL_PATH) -include $(call all-makefiles-under,$(LOCAL_STORED_PATH)) -include $(call all-makefiles-under,$(LOCAL_STORED_PATH)/apks) diff --git a/tests/AndroidTests/AndroidManifest.xml b/tests/AndroidTests/AndroidManifest.xml deleted file mode 100644 index 1f0bf4d0feaac..0000000000000 --- a/tests/AndroidTests/AndroidManifest.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/AndroidTests/DisabledTestApp/AndroidManifest.xml b/tests/AndroidTests/DisabledTestApp/AndroidManifest.xml deleted file mode 100644 index 4d6843e592017..0000000000000 --- a/tests/AndroidTests/DisabledTestApp/AndroidManifest.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/tests/AndroidTests/MODULE_LICENSE_APACHE2 b/tests/AndroidTests/MODULE_LICENSE_APACHE2 deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/tests/AndroidTests/NOTICE b/tests/AndroidTests/NOTICE deleted file mode 100644 index c5b1efa7aac76..0000000000000 --- a/tests/AndroidTests/NOTICE +++ /dev/null @@ -1,190 +0,0 @@ - - Copyright (c) 2005-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. - - 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. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - diff --git a/tests/AndroidTests/apks/install_decl_perm/AndroidManifest.xml b/tests/AndroidTests/apks/install_decl_perm/AndroidManifest.xml deleted file mode 100644 index 43875007c89f8..0000000000000 --- a/tests/AndroidTests/apks/install_decl_perm/AndroidManifest.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - diff --git a/tests/AndroidTests/apks/install_use_perm_good/AndroidManifest.xml b/tests/AndroidTests/apks/install_use_perm_good/AndroidManifest.xml deleted file mode 100644 index 6dd3e7113d4da..0000000000000 --- a/tests/AndroidTests/apks/install_use_perm_good/AndroidManifest.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/tests/AndroidTests/res/values-12key-63x57/configVarying.xml b/tests/AndroidTests/res/values-12key-63x57/configVarying.xml deleted file mode 100644 index 50b37652ddf9f..0000000000000 --- a/tests/AndroidTests/res/values-12key-63x57/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple 12key 63x57 - - bag 12key 63x57 - - diff --git a/tests/AndroidTests/res/values-12key-dpad/configVarying.xml b/tests/AndroidTests/res/values-12key-dpad/configVarying.xml deleted file mode 100644 index 83eb080fcefee..0000000000000 --- a/tests/AndroidTests/res/values-12key-dpad/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple 12key dpad - - bag 12key dpad - - diff --git a/tests/AndroidTests/res/values-240dpi/configVarying.xml b/tests/AndroidTests/res/values-240dpi/configVarying.xml deleted file mode 100644 index 9f32f8d7b8542..0000000000000 --- a/tests/AndroidTests/res/values-240dpi/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple 240dpi - - bag 240dpi - - diff --git a/tests/AndroidTests/res/values-32dpi-keysexposed/configVarying.xml b/tests/AndroidTests/res/values-32dpi-keysexposed/configVarying.xml deleted file mode 100644 index cd7f8da9dd887..0000000000000 --- a/tests/AndroidTests/res/values-32dpi-keysexposed/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple 32dpi keysexposed - - bag 32dpi keysexposed - - diff --git a/tests/AndroidTests/res/values-32dpi-stylus/configVarying.xml b/tests/AndroidTests/res/values-32dpi-stylus/configVarying.xml deleted file mode 100644 index 63fcdc84e7b11..0000000000000 --- a/tests/AndroidTests/res/values-32dpi-stylus/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple 32dpi stylus - - bag 32dpi stylus - - diff --git a/tests/AndroidTests/res/values-32dpi/configVarying.xml b/tests/AndroidTests/res/values-32dpi/configVarying.xml deleted file mode 100644 index f903f0fdf7a10..0000000000000 --- a/tests/AndroidTests/res/values-32dpi/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple 32dpi - - bag 32dpi - - diff --git a/tests/AndroidTests/res/values-480x320/configVarying.xml b/tests/AndroidTests/res/values-480x320/configVarying.xml deleted file mode 100644 index d4305fcb5e124..0000000000000 --- a/tests/AndroidTests/res/values-480x320/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple 480x320 - - bag 480x320 - - diff --git a/tests/AndroidTests/res/values-640x400/configVarying.xml b/tests/AndroidTests/res/values-640x400/configVarying.xml deleted file mode 100644 index 30332c0967b0e..0000000000000 --- a/tests/AndroidTests/res/values-640x400/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple 640x400 - - bag 640x400 - - diff --git a/tests/AndroidTests/res/values-cs/strings.xml b/tests/AndroidTests/res/values-cs/strings.xml deleted file mode 100644 index bd402c7c315e5..0000000000000 --- a/tests/AndroidTests/res/values-cs/strings.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - A Czech dog - Few Czech dogs - Some Czech dogs - - - diff --git a/tests/AndroidTests/res/values-dpad-63x57/configVarying.xml b/tests/AndroidTests/res/values-dpad-63x57/configVarying.xml deleted file mode 100644 index 8383e9e36574f..0000000000000 --- a/tests/AndroidTests/res/values-dpad-63x57/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple dpad 63x57 - - bag dpad 63x57 - - diff --git a/tests/AndroidTests/res/values-dpad/configVarying.xml b/tests/AndroidTests/res/values-dpad/configVarying.xml deleted file mode 100644 index c8d5767c834b7..0000000000000 --- a/tests/AndroidTests/res/values-dpad/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple dpad - - bag dpad - - diff --git a/tests/AndroidTests/res/values-fr-rFR/configVarying.xml b/tests/AndroidTests/res/values-fr-rFR/configVarying.xml deleted file mode 100644 index 5ecac7caff8ad..0000000000000 --- a/tests/AndroidTests/res/values-fr-rFR/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple fr FR - - bag fr FR - - diff --git a/tests/AndroidTests/res/values-fr/configVarying.xml b/tests/AndroidTests/res/values-fr/configVarying.xml deleted file mode 100644 index 8413b5a700869..0000000000000 --- a/tests/AndroidTests/res/values-fr/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple fr - - bag fr - - diff --git a/tests/AndroidTests/res/values-keysexposed-12key/configVarying.xml b/tests/AndroidTests/res/values-keysexposed-12key/configVarying.xml deleted file mode 100644 index 2a2b8d9289190..0000000000000 --- a/tests/AndroidTests/res/values-keysexposed-12key/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple keysexposed 12key - - bag keysexposed 12key - - diff --git a/tests/AndroidTests/res/values-keysexposed-dpad/configVarying.xml b/tests/AndroidTests/res/values-keysexposed-dpad/configVarying.xml deleted file mode 100644 index f279eb0f2bcb3..0000000000000 --- a/tests/AndroidTests/res/values-keysexposed-dpad/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple keysexposed dpad - - bag keysexposed dpad - - diff --git a/tests/AndroidTests/res/values-keysexposed/configVarying.xml b/tests/AndroidTests/res/values-keysexposed/configVarying.xml deleted file mode 100644 index 2380e7e6e6822..0000000000000 --- a/tests/AndroidTests/res/values-keysexposed/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple keysexposed - - bag keysexposed - - diff --git a/tests/AndroidTests/res/values-land/configVarying.xml b/tests/AndroidTests/res/values-land/configVarying.xml deleted file mode 100644 index 7d3d7e89fe1d0..0000000000000 --- a/tests/AndroidTests/res/values-land/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple landscape - - bag landscape - - diff --git a/tests/AndroidTests/res/values-mcc110-xx/configVarying.xml b/tests/AndroidTests/res/values-mcc110-xx/configVarying.xml deleted file mode 100644 index 82e24355d035b..0000000000000 --- a/tests/AndroidTests/res/values-mcc110-xx/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mcc110 xx - - bag mcc110 xx - - diff --git a/tests/AndroidTests/res/values-mcc111-mnc222/configVarying.xml b/tests/AndroidTests/res/values-mcc111-mnc222/configVarying.xml deleted file mode 100644 index 84c31c64747e7..0000000000000 --- a/tests/AndroidTests/res/values-mcc111-mnc222/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mcc111 mnc222 - - bag mcc111 mnc222 - - diff --git a/tests/AndroidTests/res/values-mcc111-xx-rYY/configVarying.xml b/tests/AndroidTests/res/values-mcc111-xx-rYY/configVarying.xml deleted file mode 100644 index 3aa1ba0a935a1..0000000000000 --- a/tests/AndroidTests/res/values-mcc111-xx-rYY/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mcc111 xx-rYY - - bag mcc111 xx-rYY - - diff --git a/tests/AndroidTests/res/values-mcc111-xx/configVarying.xml b/tests/AndroidTests/res/values-mcc111-xx/configVarying.xml deleted file mode 100644 index 09bd8179d76ba..0000000000000 --- a/tests/AndroidTests/res/values-mcc111-xx/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mcc111 xx - - bag mcc111 xx - - diff --git a/tests/AndroidTests/res/values-mcc111/configVarying.xml b/tests/AndroidTests/res/values-mcc111/configVarying.xml deleted file mode 100644 index b51619476bdd2..0000000000000 --- a/tests/AndroidTests/res/values-mcc111/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mcc111 - - bag mcc111 - - diff --git a/tests/AndroidTests/res/values-mcc112/configVarying.xml b/tests/AndroidTests/res/values-mcc112/configVarying.xml deleted file mode 100644 index 9c05d77b6d7b7..0000000000000 --- a/tests/AndroidTests/res/values-mcc112/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mcc112 - - bag mcc112 - - diff --git a/tests/AndroidTests/res/values-mnc220-xx/configVarying.xml b/tests/AndroidTests/res/values-mnc220-xx/configVarying.xml deleted file mode 100644 index fbc78882d8aa5..0000000000000 --- a/tests/AndroidTests/res/values-mnc220-xx/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mnc220 xx - - bag mnc220 xx - - diff --git a/tests/AndroidTests/res/values-mnc222-32dpi/configVarying.xml b/tests/AndroidTests/res/values-mnc222-32dpi/configVarying.xml deleted file mode 100644 index 03bea33ae2d07..0000000000000 --- a/tests/AndroidTests/res/values-mnc222-32dpi/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mnc222 32dpi - - bag mnc222 32dpi - - diff --git a/tests/AndroidTests/res/values-mnc222-square/configVarying.xml b/tests/AndroidTests/res/values-mnc222-square/configVarying.xml deleted file mode 100644 index 952c595089956..0000000000000 --- a/tests/AndroidTests/res/values-mnc222-square/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mnc222 square - - bag mnc222 square - - diff --git a/tests/AndroidTests/res/values-mnc222-xx/configVarying.xml b/tests/AndroidTests/res/values-mnc222-xx/configVarying.xml deleted file mode 100644 index c1cafbcf43a6e..0000000000000 --- a/tests/AndroidTests/res/values-mnc222-xx/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mnc222 xx - - bag mnc222 xx - - diff --git a/tests/AndroidTests/res/values-mnc222/configVarying.xml b/tests/AndroidTests/res/values-mnc222/configVarying.xml deleted file mode 100644 index a37b7efd5a5db..0000000000000 --- a/tests/AndroidTests/res/values-mnc222/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mnc222 - - bag mnc222 - - diff --git a/tests/AndroidTests/res/values-mnc223/configVarying.xml b/tests/AndroidTests/res/values-mnc223/configVarying.xml deleted file mode 100644 index 8936cbcb09bfc..0000000000000 --- a/tests/AndroidTests/res/values-mnc223/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mnc223 - - bag mnc223 - - diff --git a/tests/AndroidTests/res/values-nokeys/configVarying.xml b/tests/AndroidTests/res/values-nokeys/configVarying.xml deleted file mode 100644 index 71f7e0b3e0322..0000000000000 --- a/tests/AndroidTests/res/values-nokeys/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple nokeys - - bag nokeys - - diff --git a/tests/AndroidTests/res/values-nonav/configVarying.xml b/tests/AndroidTests/res/values-nonav/configVarying.xml deleted file mode 100644 index 12549207b1d4c..0000000000000 --- a/tests/AndroidTests/res/values-nonav/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple nonav - - bag nonav - - diff --git a/tests/AndroidTests/res/values-notouch/configVarying.xml b/tests/AndroidTests/res/values-notouch/configVarying.xml deleted file mode 100644 index f919f875b178a..0000000000000 --- a/tests/AndroidTests/res/values-notouch/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple notouch - - bag notouch - - diff --git a/tests/AndroidTests/res/values-square-32dpi/configVarying.xml b/tests/AndroidTests/res/values-square-32dpi/configVarying.xml deleted file mode 100644 index 41a69cdc1984b..0000000000000 --- a/tests/AndroidTests/res/values-square-32dpi/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple square 32dpi - - bag square 32dpi - - diff --git a/tests/AndroidTests/res/values-square-stylus/configVarying.xml b/tests/AndroidTests/res/values-square-stylus/configVarying.xml deleted file mode 100644 index de7892e5ee839..0000000000000 --- a/tests/AndroidTests/res/values-square-stylus/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple square stylus - - bag square stylus - - diff --git a/tests/AndroidTests/res/values-square/configVarying.xml b/tests/AndroidTests/res/values-square/configVarying.xml deleted file mode 100644 index ba3a0367315a8..0000000000000 --- a/tests/AndroidTests/res/values-square/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple square - - bag square - - diff --git a/tests/AndroidTests/res/values-stylus-12key/configVarying.xml b/tests/AndroidTests/res/values-stylus-12key/configVarying.xml deleted file mode 100644 index d79f079eb6ce8..0000000000000 --- a/tests/AndroidTests/res/values-stylus-12key/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple stylus 12key - - bag stylus 12key - - diff --git a/tests/AndroidTests/res/values-stylus-keysexposed/configVarying.xml b/tests/AndroidTests/res/values-stylus-keysexposed/configVarying.xml deleted file mode 100644 index ff4e7669c07fc..0000000000000 --- a/tests/AndroidTests/res/values-stylus-keysexposed/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple stylus keysexposed - - bag stylus keysexposed - - diff --git a/tests/AndroidTests/res/values-stylus/configVarying.xml b/tests/AndroidTests/res/values-stylus/configVarying.xml deleted file mode 100644 index 83936a767c3a3..0000000000000 --- a/tests/AndroidTests/res/values-stylus/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple stylus - - bag stylus - - diff --git a/tests/AndroidTests/res/values-wheel/configVarying.xml b/tests/AndroidTests/res/values-wheel/configVarying.xml deleted file mode 100644 index 6164855aee86f..0000000000000 --- a/tests/AndroidTests/res/values-wheel/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple wheel - - bag wheel - - diff --git a/tests/AndroidTests/res/values-xx-32dpi/configVarying.xml b/tests/AndroidTests/res/values-xx-32dpi/configVarying.xml deleted file mode 100644 index 4cc162cfd3b2c..0000000000000 --- a/tests/AndroidTests/res/values-xx-32dpi/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple xx 32dpi - - bag xx 32dpi - - diff --git a/tests/AndroidTests/res/values-xx-rYY/configVarying.xml b/tests/AndroidTests/res/values-xx-rYY/configVarying.xml deleted file mode 100644 index 2d2a9a1ea9a85..0000000000000 --- a/tests/AndroidTests/res/values-xx-rYY/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple xx-rYY - - bag xx-rYY - - diff --git a/tests/AndroidTests/res/values-xx-square/configVarying.xml b/tests/AndroidTests/res/values-xx-square/configVarying.xml deleted file mode 100644 index 807feecc74a18..0000000000000 --- a/tests/AndroidTests/res/values-xx-square/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple xx square - - bag xx square - - diff --git a/tests/AndroidTests/res/values-xx/configVarying.xml b/tests/AndroidTests/res/values-xx/configVarying.xml deleted file mode 100644 index fef273726fe84..0000000000000 --- a/tests/AndroidTests/res/values-xx/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple xx - - bag xx - - diff --git a/tests/AndroidTests/res/values/arrays.xml b/tests/AndroidTests/res/values/arrays.xml deleted file mode 100644 index 20ab4077bc054..0000000000000 --- a/tests/AndroidTests/res/values/arrays.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - 101 - - - - zero - 1 - @string/reference - - - 0 - 1 - @integer/reference - - diff --git a/tests/AndroidTests/res/values/attrs.xml b/tests/AndroidTests/res/values/attrs.xml deleted file mode 100644 index d3a31caf2c31d..0000000000000 --- a/tests/AndroidTests/res/values/attrs.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/AndroidTests/res/values/configVarying.xml b/tests/AndroidTests/res/values/configVarying.xml deleted file mode 100644 index 3b3e4a4209f3a..0000000000000 --- a/tests/AndroidTests/res/values/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple default - - bag default - - diff --git a/tests/AndroidTests/res/values/dimens.xml b/tests/AndroidTests/res/values/dimens.xml deleted file mode 100644 index 72d10107f858c..0000000000000 --- a/tests/AndroidTests/res/values/dimens.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - 100% - 1% - .1% - .01% - 0% - 1.1% - 100.1% - 25510% - 25610% - 6553510% - 6553610% - - 100%p - 1%p - .1%p - .01%p - 0%p - 1.1%p - 100.1%p - 25510%p - 25610%p - 6553510%p - 6553610%p - - diff --git a/tests/AndroidTests/res/values/strings.xml b/tests/AndroidTests/res/values/strings.xml deleted file mode 100644 index e8b150a7aacce..0000000000000 --- a/tests/AndroidTests/res/values/strings.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 100 - true - #fff - 100.0 - 100px - 100% - - Format[] - Format[%d] - Format[%3$d,%2$s] - - here - - - A dog - Some dogs - - - - diff --git a/tests/AndroidTests/res/values/styles.xml b/tests/AndroidTests/res/values/styles.xml deleted file mode 100644 index 6c60e21481a50..0000000000000 --- a/tests/AndroidTests/res/values/styles.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tests/AndroidTests/run_test.sh b/tests/AndroidTests/run_test.sh deleted file mode 100755 index bc06b7e906bbe..0000000000000 --- a/tests/AndroidTests/run_test.sh +++ /dev/null @@ -1,4 +0,0 @@ -framework=/system/framework -bpath=$framework/core.jar:$framework/ext.jar:$framework/framework.jar:$framework/android.test.runner.jar -adb shell exec dalvikvm -Xbootclasspath:$bpath -cp /system/app/AndroidTests.apk:/data/app/com.android.unit_tests.apk:/data/app/AndroidTests.apk \ - com.android.internal.util.WithFramework junit.textui.TestRunner $* diff --git a/tests/AndroidTests/src/com/android/unit_tests/HtmlTest.java b/tests/AndroidTests/src/com/android/unit_tests/HtmlTest.java deleted file mode 100644 index 027730fa3f43c..0000000000000 --- a/tests/AndroidTests/src/com/android/unit_tests/HtmlTest.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.unit_tests; - -import android.content.res.ColorStateList; -import android.content.res.Resources; -import android.graphics.Typeface; -import android.test.suitebuilder.annotation.MediumTest; -import android.test.suitebuilder.annotation.SmallTest; -import android.text.Html; -import android.text.Spannable; -import android.text.SpannableString; -import android.text.Spanned; -import android.text.style.ForegroundColorSpan; -import android.text.style.QuoteSpan; -import android.text.style.StrikethroughSpan; -import android.text.style.StyleSpan; -import android.text.style.SubscriptSpan; -import android.text.style.SuperscriptSpan; -import android.text.style.TextAppearanceSpan; -import android.text.style.TypefaceSpan; -import android.text.style.URLSpan; -import android.text.style.UnderlineSpan; - -import junit.framework.TestCase; - -/** - * HtmlTest tests the Spanned-to-HTML converter - */ -public class HtmlTest extends TestCase { - @MediumTest - public void testColor() throws Exception { - Spanned s; - ForegroundColorSpan[] colors; - - s = Html.fromHtml("something"); - colors = s.getSpans(0, s.length(), ForegroundColorSpan.class); - assertEquals(1, colors.length); - assertEquals(0xFF00FF00, colors[0].getForegroundColor()); - - s = Html.fromHtml("something"); - colors = s.getSpans(0, s.length(), ForegroundColorSpan.class); - assertEquals(1, colors.length); - assertEquals(0xFF000080, colors[0].getForegroundColor()); - - s = Html.fromHtml("something"); - colors = s.getSpans(0, s.length(), ForegroundColorSpan.class); - assertEquals(0, colors.length); - } - - @MediumTest - public void testResourceColor() throws Exception { - ColorStateList c = - Resources.getSystem().getColorStateList(android.R.color.primary_text_dark); - Spanned s; - TextAppearanceSpan[] colors; - - s = Html.fromHtml("something"); - colors = s.getSpans(0, s.length(), TextAppearanceSpan.class); - assertEquals(1, colors.length); - assertEquals(c.toString(), colors[0].getTextColor().toString()); - - s = Html.fromHtml("something"); - colors = s.getSpans(0, s.length(), TextAppearanceSpan.class); - assertEquals(1, colors.length); - assertEquals(c.toString(), colors[0].getTextColor().toString()); - - s = Html.fromHtml("something"); - colors = s.getSpans(0, s.length(), TextAppearanceSpan.class); - assertEquals(1, colors.length); - assertEquals(c.toString(), colors[0].getTextColor().toString()); - - s = Html.fromHtml("something"); - colors = s.getSpans(0, s.length(), TextAppearanceSpan.class); - assertEquals(1, colors.length); - assertEquals(c.toString(), colors[0].getTextColor().toString()); - - s = Html.fromHtml("something"); - colors = s.getSpans(0, s.length(), TextAppearanceSpan.class); - assertEquals(1, colors.length); - assertEquals(c.toString(), colors[0].getTextColor().toString()); - - s = Html.fromHtml("something"); - colors = s.getSpans(0, s.length(), TextAppearanceSpan.class); - assertEquals(colors.length, 0); - } - - @SmallTest - public void testParagraphs() throws Exception { - SpannableString s; - - s = new SpannableString("Hello world"); - assertEquals(Html.toHtml(s), "

Hello world

\n"); - - s = new SpannableString("Hello world\nor something"); - assertEquals(Html.toHtml(s), "

Hello world
\nor something

\n"); - - s = new SpannableString("Hello world\n\nor something"); - assertEquals(Html.toHtml(s), "

Hello world

\n

or something

\n"); - - s = new SpannableString("Hello world\n\n\nor something"); - assertEquals(Html.toHtml(s), "

Hello world

\n

or something

\n"); - - assertEquals("foo\nbar", Html.fromHtml("foo
bar").toString()); - assertEquals("foo\nbar", Html.fromHtml("foo
\nbar").toString()); - assertEquals("foo\nbar", Html.fromHtml("foo
\n \nbar").toString()); - } - - @SmallTest - public void testBlockquote() throws Exception { - SpannableString s; - - s = new SpannableString("Hello world"); - s.setSpan(new QuoteSpan(), 0, s.length(), Spannable.SPAN_PARAGRAPH); - assertEquals(Html.toHtml(s), "

Hello world

\n
\n"); - - s = new SpannableString("Hello\n\nworld"); - s.setSpan(new QuoteSpan(), 0, 7, Spannable.SPAN_PARAGRAPH); - assertEquals(Html.toHtml(s), "

Hello

\n
\n

world

\n"); - } - - @SmallTest - public void testEntities() throws Exception { - SpannableString s; - - s = new SpannableString("Hello <&> world"); - assertEquals(Html.toHtml(s), "

Hello <&> world

\n"); - - s = new SpannableString("Hello \u03D5 world"); - assertEquals(Html.toHtml(s), "

Hello ϕ world

\n"); - - s = new SpannableString("Hello world"); - assertEquals(Html.toHtml(s), "

Hello  world

\n"); - } - - @SmallTest - public void testMarkup() throws Exception { - SpannableString s; - - s = new SpannableString("Hello bold world"); - s.setSpan(new StyleSpan(Typeface.BOLD), 6, s.length() - 6, - Spannable.SPAN_EXCLUSIVE_INCLUSIVE); - assertEquals(Html.toHtml(s), "

Hello bold world

\n"); - - s = new SpannableString("Hello italic world"); - s.setSpan(new StyleSpan(Typeface.ITALIC), 6, s.length() - 6, - Spannable.SPAN_EXCLUSIVE_INCLUSIVE); - assertEquals(Html.toHtml(s), "

Hello italic world

\n"); - - s = new SpannableString("Hello monospace world"); - s.setSpan(new TypefaceSpan("monospace"), 6, s.length() - 6, - Spannable.SPAN_EXCLUSIVE_INCLUSIVE); - assertEquals(Html.toHtml(s), "

Hello monospace world

\n"); - - s = new SpannableString("Hello superscript world"); - s.setSpan(new SuperscriptSpan(), 6, s.length() - 6, - Spannable.SPAN_EXCLUSIVE_INCLUSIVE); - assertEquals(Html.toHtml(s), "

Hello superscript world

\n"); - - s = new SpannableString("Hello subscript world"); - s.setSpan(new SubscriptSpan(), 6, s.length() - 6, - Spannable.SPAN_EXCLUSIVE_INCLUSIVE); - assertEquals(Html.toHtml(s), "

Hello subscript world

\n"); - - s = new SpannableString("Hello underline world"); - s.setSpan(new UnderlineSpan(), 6, s.length() - 6, - Spannable.SPAN_EXCLUSIVE_INCLUSIVE); - assertEquals(Html.toHtml(s), "

Hello underline world

\n"); - - s = new SpannableString("Hello struck world"); - s.setSpan(new StrikethroughSpan(), 6, s.length() - 6, - Spannable.SPAN_EXCLUSIVE_INCLUSIVE); - assertEquals(Html.toHtml(s), "

Hello struck world

\n"); - - s = new SpannableString("Hello linky world"); - s.setSpan(new URLSpan("http://www.google.com"), 6, s.length() - 6, - Spannable.SPAN_EXCLUSIVE_INCLUSIVE); - assertEquals(Html.toHtml(s), - "

Hello linky world

\n"); - } - - @SmallTest - public void testImg() throws Exception { - Spanned s; - - s = Html.fromHtml("yesno"); - - assertEquals("

yesno

\n", - Html.toHtml(s)); - } - - @SmallTest - public void testUtf8() throws Exception { - Spanned s; - - s = Html.fromHtml("

\u0124\u00eb\u0142\u0142o, world!

"); - assertEquals("

Ĥëłło, world!

\n", Html.toHtml(s)); - } -} diff --git a/tests/AndroidTests/src/com/android/unit_tests/AndroidPerformanceTests.java b/tests/CoreTests/android/core/AndroidPerformanceTests.java similarity index 97% rename from tests/AndroidTests/src/com/android/unit_tests/AndroidPerformanceTests.java rename to tests/CoreTests/android/core/AndroidPerformanceTests.java index 795fe2bf60a63..e604d592cbdd0 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/AndroidPerformanceTests.java +++ b/tests/CoreTests/android/core/AndroidPerformanceTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; import android.test.TestListActivity; diff --git a/tests/AndroidTests/src/com/android/unit_tests/ArrayListTest.java b/tests/CoreTests/android/core/ArrayListPerformanceTest.java similarity index 98% rename from tests/AndroidTests/src/com/android/unit_tests/ArrayListTest.java rename to tests/CoreTests/android/core/ArrayListPerformanceTest.java index 81e6efd915421..6130e8334564e 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/ArrayListTest.java +++ b/tests/CoreTests/android/core/ArrayListPerformanceTest.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; import java.util.ArrayList; import android.test.PerformanceTestBase; -public class ArrayListTest extends PerformanceTestBase { +public class ArrayListPerformanceTest extends PerformanceTestBase { private ArrayList mList; diff --git a/tests/AndroidTests/src/com/android/unit_tests/HashMapTest.java b/tests/CoreTests/android/core/HashMapPerformanceTest.java similarity index 98% rename from tests/AndroidTests/src/com/android/unit_tests/HashMapTest.java rename to tests/CoreTests/android/core/HashMapPerformanceTest.java index b4d15c9d25b01..82727bb231f51 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/HashMapTest.java +++ b/tests/CoreTests/android/core/HashMapPerformanceTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; import java.util.Collection; import java.util.HashMap; @@ -23,7 +23,7 @@ import java.util.Set; import android.test.PerformanceTestBase; import android.test.PerformanceTestCase; -public class HashMapTest extends PerformanceTestBase { +public class HashMapPerformanceTest extends PerformanceTestBase { public static final int ITERATIONS = 1000; public HashMap mMap; public String[] mKeys; diff --git a/tests/AndroidTests/src/com/android/unit_tests/HashSetTest.java b/tests/CoreTests/android/core/HashSetTest.java similarity index 99% rename from tests/AndroidTests/src/com/android/unit_tests/HashSetTest.java rename to tests/CoreTests/android/core/HashSetTest.java index 80d3d8de2c0a4..09a711f0277c8 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/HashSetTest.java +++ b/tests/CoreTests/android/core/HashSetTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; import android.test.PerformanceTestBase; import android.test.PerformanceTestCase; diff --git a/tests/AndroidTests/src/com/android/unit_tests/HashtableTest.java b/tests/CoreTests/android/core/HashtableTest.java similarity index 99% rename from tests/AndroidTests/src/com/android/unit_tests/HashtableTest.java rename to tests/CoreTests/android/core/HashtableTest.java index 42bec11a3dfb0..6160f5733915d 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/HashtableTest.java +++ b/tests/CoreTests/android/core/HashtableTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; import android.test.PerformanceTestBase; import android.test.PerformanceTestCase; diff --git a/tests/AndroidTests/src/com/android/unit_tests/HeapTest.java b/tests/CoreTests/android/core/HeapTest.java similarity index 99% rename from tests/AndroidTests/src/com/android/unit_tests/HeapTest.java rename to tests/CoreTests/android/core/HeapTest.java index f6ae6f65a40b6..6116f5e0b5e6f 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/HeapTest.java +++ b/tests/CoreTests/android/core/HeapTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; import android.test.suitebuilder.annotation.LargeTest; import android.test.suitebuilder.annotation.MediumTest; diff --git a/tests/AndroidTests/src/com/android/unit_tests/InstanceofTest.java b/tests/CoreTests/android/core/InstanceofTest.java similarity index 99% rename from tests/AndroidTests/src/com/android/unit_tests/InstanceofTest.java rename to tests/CoreTests/android/core/InstanceofTest.java index 1f82df8d38983..b35ef6bdf272a 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/InstanceofTest.java +++ b/tests/CoreTests/android/core/InstanceofTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; import junit.framework.TestCase; import android.test.suitebuilder.annotation.MediumTest; diff --git a/tests/AndroidTests/src/com/android/unit_tests/JavaPerformanceTests.java b/tests/CoreTests/android/core/JavaPerformanceTests.java similarity index 80% rename from tests/AndroidTests/src/com/android/unit_tests/JavaPerformanceTests.java rename to tests/CoreTests/android/core/JavaPerformanceTests.java index e778d533699a8..fbe70ccfe4aa8 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/JavaPerformanceTests.java +++ b/tests/CoreTests/android/core/JavaPerformanceTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; /** * @@ -24,15 +24,15 @@ public class JavaPerformanceTests { public static String[] children() { return new String[] { StringTest.class.getName(), - HashMapTest.class.getName(), - ArrayListTest.class.getName(), - TreeMapTest.class.getName(), + HashMapPerformanceTest.class.getName(), + ArrayListPerformanceTest.class.getName(), + TreeMapPerformanceTest.class.getName(), TreeSetTest.class.getName(), HashSetTest.class.getName(), HashtableTest.class.getName(), VectorTest.class.getName(), LinkedListTest.class.getName(), - MathTest.class.getName(), + MathPerformanceTest.class.getName(), }; } } diff --git a/tests/AndroidTests/src/com/android/unit_tests/JniLibTest.java b/tests/CoreTests/android/core/JniLibTest.java similarity index 98% rename from tests/AndroidTests/src/com/android/unit_tests/JniLibTest.java rename to tests/CoreTests/android/core/JniLibTest.java index 6b740ba127db0..d4760720f8184 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/JniLibTest.java +++ b/tests/CoreTests/android/core/JniLibTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; import android.test.suitebuilder.annotation.Suppress; import android.util.Log; diff --git a/tests/AndroidTests/src/com/android/unit_tests/LinkedListTest.java b/tests/CoreTests/android/core/LinkedListTest.java similarity index 99% rename from tests/AndroidTests/src/com/android/unit_tests/LinkedListTest.java rename to tests/CoreTests/android/core/LinkedListTest.java index ca470cd3cbd5b..8b237fd0670eb 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/LinkedListTest.java +++ b/tests/CoreTests/android/core/LinkedListTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; import android.test.PerformanceTestBase; import android.test.PerformanceTestCase; diff --git a/tests/AndroidTests/src/com/android/unit_tests/MathTest.java b/tests/CoreTests/android/core/MathPerformanceTest.java similarity index 99% rename from tests/AndroidTests/src/com/android/unit_tests/MathTest.java rename to tests/CoreTests/android/core/MathPerformanceTest.java index caf2d209bc18d..b1eb50033c724 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/MathTest.java +++ b/tests/CoreTests/android/core/MathPerformanceTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; import android.test.PerformanceTestBase; import android.test.PerformanceTestCase; @@ -25,7 +25,7 @@ import android.test.PerformanceTestCase; * */ -public class MathTest extends PerformanceTestBase { +public class MathPerformanceTest extends PerformanceTestBase { public static final int ITERATIONS = 1000; public static final double sDouble1 = -2450.50; public static final double sDouble2 = -500; diff --git a/tests/AndroidTests/src/com/android/unit_tests/MonitorTest.java b/tests/CoreTests/android/core/MonitorTest.java similarity index 99% rename from tests/AndroidTests/src/com/android/unit_tests/MonitorTest.java rename to tests/CoreTests/android/core/MonitorTest.java index b5c6d87aa722a..73c33db7d208d 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/MonitorTest.java +++ b/tests/CoreTests/android/core/MonitorTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; import junit.framework.TestCase; import android.test.suitebuilder.annotation.MediumTest; diff --git a/tests/AndroidTests/src/com/android/unit_tests/PerformanceTests.java b/tests/CoreTests/android/core/PerformanceTests.java similarity index 99% rename from tests/AndroidTests/src/com/android/unit_tests/PerformanceTests.java rename to tests/CoreTests/android/core/PerformanceTests.java index 9e5454011c5be..faf46e62d03a6 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/PerformanceTests.java +++ b/tests/CoreTests/android/core/PerformanceTests.java @@ -14,13 +14,12 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; + +import org.apache.harmony.dalvik.NativeTestTarget; -import android.os.Debug; -import junit.framework.Assert; import android.test.PerformanceTestBase; import android.test.PerformanceTestCase; -import org.apache.harmony.dalvik.NativeTestTarget; import java.util.ArrayList; import java.util.HashMap; @@ -28,6 +27,8 @@ import java.util.Iterator; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; +import junit.framework.Assert; + public class PerformanceTests { public static String[] children() { return new String[] { diff --git a/tests/AndroidTests/src/com/android/unit_tests/SerializationTest.java b/tests/CoreTests/android/core/SerializationTest.java similarity index 98% rename from tests/AndroidTests/src/com/android/unit_tests/SerializationTest.java rename to tests/CoreTests/android/core/SerializationTest.java index 4b64144335646..9644d0389cbf9 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/SerializationTest.java +++ b/tests/CoreTests/android/core/SerializationTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; import junit.framework.TestCase; diff --git a/tests/AndroidTests/src/com/android/unit_tests/StringTest.java b/tests/CoreTests/android/core/StringTest.java similarity index 99% rename from tests/AndroidTests/src/com/android/unit_tests/StringTest.java rename to tests/CoreTests/android/core/StringTest.java index dc40a0af93265..128531c7eb3d4 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/StringTest.java +++ b/tests/CoreTests/android/core/StringTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; import java.util.Locale; diff --git a/tests/AndroidTests/src/com/android/unit_tests/TestHttpClient.java b/tests/CoreTests/android/core/TestHttpClient.java similarity index 99% rename from tests/AndroidTests/src/com/android/unit_tests/TestHttpClient.java rename to tests/CoreTests/android/core/TestHttpClient.java index 9b5e655e493cc..c657f1e6effbe 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/TestHttpClient.java +++ b/tests/CoreTests/android/core/TestHttpClient.java @@ -29,7 +29,7 @@ * */ -package com.android.unit_tests; +package android.core; import java.io.IOException; diff --git a/tests/AndroidTests/src/com/android/unit_tests/TreeMapTest.java b/tests/CoreTests/android/core/TreeMapPerformanceTest.java similarity index 99% rename from tests/AndroidTests/src/com/android/unit_tests/TreeMapTest.java rename to tests/CoreTests/android/core/TreeMapPerformanceTest.java index d77a81975f0b2..3a210f43c6c11 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/TreeMapTest.java +++ b/tests/CoreTests/android/core/TreeMapPerformanceTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; import android.test.PerformanceTestBase; import android.test.PerformanceTestCase; @@ -28,7 +28,7 @@ import java.util.TreeMap; * Implements basic performance test functionality for java.util.TreeMap */ -public class TreeMapTest extends PerformanceTestBase { +public class TreeMapPerformanceTest extends PerformanceTestBase { public static final int ITERATIONS = 1000; public static TreeMap sMap; public static String[] sKeys; diff --git a/tests/AndroidTests/src/com/android/unit_tests/TreeSetTest.java b/tests/CoreTests/android/core/TreeSetTest.java similarity index 99% rename from tests/AndroidTests/src/com/android/unit_tests/TreeSetTest.java rename to tests/CoreTests/android/core/TreeSetTest.java index 60dfe9ae5c87a..a6a33096067ba 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/TreeSetTest.java +++ b/tests/CoreTests/android/core/TreeSetTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; import android.test.PerformanceTestBase; import android.test.PerformanceTestCase; diff --git a/tests/AndroidTests/src/com/android/unit_tests/VectorTest.java b/tests/CoreTests/android/core/VectorTest.java similarity index 99% rename from tests/AndroidTests/src/com/android/unit_tests/VectorTest.java rename to tests/CoreTests/android/core/VectorTest.java index 22f97711a31f9..b4c84fdde83ac 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/VectorTest.java +++ b/tests/CoreTests/android/core/VectorTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.unit_tests; +package android.core; import android.test.PerformanceTestBase; import android.test.PerformanceTestCase;