Merge "Revert "[ToA] Do not use spy context"" into main
This commit is contained in:
@@ -18,6 +18,8 @@ package com.android.settings.localepicker;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.Mockito.spy;
|
||||
|
||||
import android.app.GrammaticalInflectionManager;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
@@ -32,6 +34,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import com.android.settings.widget.TickButtonPreference;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
@@ -59,7 +62,7 @@ public class TermsOfAddressFeminineControllerTest {
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mContext = ApplicationProvider.getApplicationContext();
|
||||
mContext = spy(ApplicationProvider.getApplicationContext());
|
||||
|
||||
if (Looper.myLooper() == null) {
|
||||
Looper.prepare();
|
||||
@@ -90,6 +93,7 @@ public class TermsOfAddressFeminineControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/339543490")
|
||||
public void displayPreference_setGrammaticalGenderIsFeminine_FeminineIsSelected() {
|
||||
TickButtonPreference selectedPreference =
|
||||
(TickButtonPreference) mPreferenceScreen.getPreference(2);
|
||||
|
@@ -18,6 +18,8 @@ package com.android.settings.localepicker;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.Mockito.spy;
|
||||
|
||||
import android.app.GrammaticalInflectionManager;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
@@ -32,6 +34,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import com.android.settings.widget.TickButtonPreference;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
@@ -59,7 +62,7 @@ public class TermsOfAddressMasculineControllerTest {
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mContext = ApplicationProvider.getApplicationContext();
|
||||
mContext = spy(ApplicationProvider.getApplicationContext());
|
||||
|
||||
if (Looper.myLooper() == null) {
|
||||
Looper.prepare();
|
||||
@@ -90,6 +93,7 @@ public class TermsOfAddressMasculineControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/339543490")
|
||||
public void displayPreference_setGrammaticalGenderIsMasculine_MasculineIsSelected() {
|
||||
TickButtonPreference selectedPreference =
|
||||
(TickButtonPreference) mPreferenceScreen.getPreference(3);
|
||||
|
@@ -18,6 +18,8 @@ package com.android.settings.localepicker;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.Mockito.spy;
|
||||
|
||||
import android.app.GrammaticalInflectionManager;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
@@ -32,6 +34,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import com.android.settings.widget.TickButtonPreference;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
@@ -59,7 +62,7 @@ public class TermsOfAddressNeutralControllerTest {
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mContext = ApplicationProvider.getApplicationContext();
|
||||
mContext = spy(ApplicationProvider.getApplicationContext());
|
||||
|
||||
if (Looper.myLooper() == null) {
|
||||
Looper.prepare();
|
||||
@@ -90,6 +93,7 @@ public class TermsOfAddressNeutralControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/339543490")
|
||||
public void displayPreference_setGrammaticalGenderIsNotSpecified_NeutralIsSelected() {
|
||||
TickButtonPreference selectedPreference =
|
||||
(TickButtonPreference) mPreferenceScreen.getPreference(4);
|
||||
|
@@ -18,6 +18,8 @@ package com.android.settings.localepicker;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.Mockito.spy;
|
||||
|
||||
import android.app.GrammaticalInflectionManager;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
@@ -32,6 +34,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import com.android.settings.widget.TickButtonPreference;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
@@ -59,7 +62,7 @@ public class TermsOfAddressNotSpecifiedControllerTest {
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mContext = ApplicationProvider.getApplicationContext();
|
||||
mContext = spy(ApplicationProvider.getApplicationContext());
|
||||
|
||||
if (Looper.myLooper() == null) {
|
||||
Looper.prepare();
|
||||
@@ -90,6 +93,7 @@ public class TermsOfAddressNotSpecifiedControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/339543490")
|
||||
public void displayPreference_setGrammaticalGenderIsNotSpecified_NotSpecifiedIsSelected() {
|
||||
TickButtonPreference selectedPreference =
|
||||
(TickButtonPreference) mPreferenceScreen.getPreference(1);
|
||||
|
Reference in New Issue
Block a user