Use resource processor for Settings

Bug: 293810334
Test: m Settings
Test: robotests
Change-Id: Ie515e137648eddfdfcab5e8095f5be99721d9e1b
This commit is contained in:
Chaohui Wang
2023-08-11 13:43:02 +08:00
parent b199f3512a
commit 2cab62254c
35 changed files with 114 additions and 512 deletions

View File

@@ -35,21 +35,29 @@ class RemoteAuthEnrollFinishTest {
@Test
fun testRemoteAuthenticatorEnrollFinish_hasHeader() {
launchFragmentInContainer<RemoteAuthEnrollFinish>(Bundle(), R.style.SudThemeGlif)
.onFragment {
assertThat((it.view as GlifLayout).headerText)
.isEqualTo(mContext.getString(
R.string.security_settings_remoteauth_enroll_finish_title))
}
launchFragmentInContainer<RemoteAuthEnrollFinish>(
Bundle(),
com.google.android.setupdesign.R.style.SudThemeGlif,
).onFragment {
assertThat((it.view as GlifLayout).headerText)
.isEqualTo(
mContext.getString(R.string.security_settings_remoteauth_enroll_finish_title)
)
}
}
@Test
fun testRemoteAuthenticatorEnrollFinish_hasDescription() {
launchFragmentInContainer<RemoteAuthEnrollFinish>(Bundle(), R.style.SudThemeGlif)
.onFragment {
assertThat((it.view as GlifLayout).descriptionText)
.isEqualTo(mContext.getString(
R.string.security_settings_remoteauth_enroll_finish_description))
}
launchFragmentInContainer<RemoteAuthEnrollFinish>(
Bundle(),
com.google.android.setupdesign.R.style.SudThemeGlif,
).onFragment {
assertThat((it.view as GlifLayout).descriptionText)
.isEqualTo(
mContext.getString(
R.string.security_settings_remoteauth_enroll_finish_description
)
)
}
}
}
}

View File

@@ -30,23 +30,31 @@ import org.robolectric.RobolectricTestRunner
@RunWith(RobolectricTestRunner::class)
class RemoteAuthEnrollIntroductionTest {
private var mContext : Context = ApplicationProvider.getApplicationContext()
private var mContext: Context = ApplicationProvider.getApplicationContext()
@Test
fun testRemoteAuthenticatorEnrollIntroduction_hasHeader() {
launchFragmentInContainer<RemoteAuthEnrollIntroduction>(Bundle(), R.style.SudThemeGlif)
.onFragment {
assertThat((it.view as GlifLayout).headerText)
.isEqualTo(mContext.getString(R.string.security_settings_remoteauth_enroll_introduction_title))
}
launchFragmentInContainer<RemoteAuthEnrollIntroduction>(
Bundle(),
com.google.android.setupdesign.R.style.SudThemeGlif,
).onFragment {
assertThat((it.view as GlifLayout).headerText)
.isEqualTo(mContext.getString(R.string.security_settings_remoteauth_enroll_introduction_title))
}
}
@Test
fun testRemoteAuthenticatorEnrollIntroduction_hasDescription() {
launchFragmentInContainer<RemoteAuthEnrollIntroduction>(Bundle(), R.style.SudThemeGlif)
.onFragment {
assertThat((it.view as GlifLayout).descriptionText)
.isEqualTo(mContext.getString(R.string.security_settings_remoteauth_enroll_introduction_message))
}
launchFragmentInContainer<RemoteAuthEnrollIntroduction>(
Bundle(),
com.google.android.setupdesign.R.style.SudThemeGlif,
).onFragment {
assertThat((it.view as GlifLayout).descriptionText)
.isEqualTo(
mContext.getString(
R.string.security_settings_remoteauth_enroll_introduction_message
)
)
}
}
}
}