diff options
author | Maurice Lam <yukl@google.com> | 2015-03-27 23:29:54 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-03-27 23:29:54 +0000 |
commit | 5e9b02ef72403231363d697dc0f71d398bac350d (patch) | |
tree | 7e97f66438293146bdbeef7893676f62240c058b /library/test/src/com/android/setupwizardlib/test/SetupWizardLayoutTests.java | |
parent | 4c4303ff1ca811ce0e3eb8ce534c3dd0c8541370 (diff) | |
parent | 9f9367672191190f903955d09a4314d40869acc6 (diff) | |
download | android_frameworks_opt_setupwizard-5e9b02ef72403231363d697dc0f71d398bac350d.tar.gz android_frameworks_opt_setupwizard-5e9b02ef72403231363d697dc0f71d398bac350d.tar.bz2 android_frameworks_opt_setupwizard-5e9b02ef72403231363d697dc0f71d398bac350d.zip |
am 9f936767: [SetupWizardLib] Eclair compat build
* commit '9f9367672191190f903955d09a4314d40869acc6':
[SetupWizardLib] Eclair compat build
Diffstat (limited to 'library/test/src/com/android/setupwizardlib/test/SetupWizardLayoutTests.java')
-rw-r--r-- | library/test/src/com/android/setupwizardlib/test/SetupWizardLayoutTests.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/library/test/src/com/android/setupwizardlib/test/SetupWizardLayoutTests.java b/library/test/src/com/android/setupwizardlib/test/SetupWizardLayoutTests.java index f5cd287..cce2f70 100644 --- a/library/test/src/com/android/setupwizardlib/test/SetupWizardLayoutTests.java +++ b/library/test/src/com/android/setupwizardlib/test/SetupWizardLayoutTests.java @@ -16,11 +16,9 @@ package com.android.setupwizardlib.test; -import android.annotation.TargetApi; import android.content.Context; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; -import android.os.Build.VERSION_CODES; import android.test.InstrumentationTestCase; import android.test.suitebuilder.annotation.SmallTest; import android.view.ContextThemeWrapper; @@ -56,16 +54,14 @@ public class SetupWizardLayoutTests extends InstrumentationTestCase { assertEquals("Header text should be \"Abracadabra\"", "Abracadabra", title.getText()); } - @TargetApi(VERSION_CODES.JELLY_BEAN_MR1) @SmallTest public void testAddView() { SetupWizardLayout layout = new SetupWizardLayout(mContext); TextView tv = new TextView(mContext); - int id = View.generateViewId(); - tv.setId(id); + tv.setId(R.id.test_view_id); layout.addView(tv); assertDefaultTemplateInflated(layout); - View view = layout.findViewById(id); + View view = layout.findViewById(R.id.test_view_id); assertSame("The view added should be the same text view", tv, view); } @@ -78,7 +74,6 @@ public class SetupWizardLayoutTests extends InstrumentationTestCase { assertTrue("@id/test_content should be a TextView", content instanceof TextView); } - @TargetApi(VERSION_CODES.JELLY_BEAN_MR1) @SmallTest public void testCustomTemplate() { SetupWizardLayout layout = new SetupWizardLayout(mContext, R.layout.test_template); @@ -86,13 +81,12 @@ public class SetupWizardLayoutTests extends InstrumentationTestCase { assertNotNull("@id/test_template_view should exist in template", templateView); TextView tv = new TextView(mContext); - int id = View.generateViewId(); - tv.setId(id); + tv.setId(R.id.test_view_id); layout.addView(tv); templateView = layout.findViewById(R.id.test_template_view); assertNotNull("@id/test_template_view should exist in template", templateView); - View contentView = layout.findViewById(id); + View contentView = layout.findViewById(R.id.test_view_id); assertSame("The view added should be the same text view", tv, contentView); // The following methods should be no-ops because the custom template doesn't contain the |