Merge "Fix broken test cases" into rvc-dev am: 15254e3b5e
am: 13f57006fd
am: 1bef15bae0
Change-Id: Ia34a119272fa43075f38104853ab7a05ec1e86dc
This commit is contained in:
@@ -49,6 +49,7 @@ import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.dashboard.profileselector.ProfileSelectFragment;
|
||||
import com.android.settings.testutils.shadow.ShadowAccountManager;
|
||||
import com.android.settings.testutils.shadow.ShadowContentResolver;
|
||||
import com.android.settings.testutils.shadow.ShadowSettingsLibUtils;
|
||||
import com.android.settingslib.search.SearchIndexableRaw;
|
||||
|
||||
import org.junit.After;
|
||||
@@ -67,7 +68,8 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
@Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class})
|
||||
@Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class,
|
||||
ShadowSettingsLibUtils.class})
|
||||
public class AccountPreferenceControllerTest {
|
||||
|
||||
@Mock(answer = RETURNS_DEEP_STUBS)
|
||||
@@ -555,7 +557,7 @@ public class AccountPreferenceControllerTest {
|
||||
mController.onResume();
|
||||
|
||||
// remove an account
|
||||
accountType1 = new Account[] {new Account("Acct11", "com.acct1")};
|
||||
accountType1 = new Account[]{new Account("Acct11", "com.acct1")};
|
||||
when(mAccountManager.getAccountsByTypeAsUser(eq("com.acct1"), any(UserHandle.class)))
|
||||
.thenReturn(accountType1);
|
||||
|
||||
|
@@ -20,6 +20,7 @@ import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.UserHandle;
|
||||
|
||||
import com.android.settingslib.Utils;
|
||||
|
||||
@@ -29,6 +30,11 @@ import org.robolectric.annotation.Implements;
|
||||
@Implements(Utils.class)
|
||||
public class ShadowSettingsLibUtils {
|
||||
|
||||
@Implementation
|
||||
protected static Drawable getBadgedIcon(Context context, Drawable icon, UserHandle user) {
|
||||
return new ColorDrawable(0);
|
||||
}
|
||||
|
||||
@Implementation
|
||||
protected static Drawable getBadgedIcon(Context context, ApplicationInfo appInfo) {
|
||||
return new ColorDrawable(0);
|
||||
|
Reference in New Issue
Block a user