Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6631bf6 authored by Tony Mantler's avatar Tony Mantler
Browse files

Update to Robolectric 3.4.2

Bug: clean-up
Test: RunSettingsLibRoboTests
Change-Id: Id812a4d8aa6b1a4260d73087b742b043e79ab6a1
parent 73f950dd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -261,7 +261,7 @@ public class SuggestionParser {
        if (requiredAccountType == null) {
            return true;
        }
        AccountManager accountManager = AccountManager.get(mContext);
        AccountManager accountManager = mContext.getSystemService(AccountManager.class);
        Account[] accounts = accountManager.getAccountsByType(requiredAccountType);
        boolean satisfiesRequiredAccount = accounts.length > 0;
        if (!satisfiesRequiredAccount) {
+5 −2
Original line number Diff line number Diff line
@@ -42,11 +42,12 @@ LOCAL_SRC_FILES := $(call all-java-files-under, src)
# Include the testing libraries (JUnit4 + Robolectric libs).
LOCAL_STATIC_JAVA_LIBRARIES := \
    mockito-robolectric-prebuilt \
    platform-robolectric-android-all-stubs \
    truth-prebuilt

LOCAL_JAVA_LIBRARIES := \
    junit \
    platform-robolectric-prebuilt
    platform-robolectric-3.4.2-prebuilt

LOCAL_INSTRUMENTATION_FOR := SettingsLibShell
LOCAL_MODULE := SettingsLibRoboTests
@@ -69,4 +70,6 @@ LOCAL_STATIC_JAVA_LIBRARIES := \

LOCAL_TEST_PACKAGE := SettingsLibShell

include prebuilts/misc/common/robolectric/run_robotests.mk
LOCAL_ROBOTEST_TIMEOUT := 36000

include prebuilts/misc/common/robolectric/3.4.2/run_robotests.mk
+7 −4
Original line number Diff line number Diff line
@@ -20,8 +20,11 @@ import static android.app.admin.DevicePolicyManager.KEYGUARD_DISABLE_FEATURES_NO
import static android.app.admin.DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT;
import static android.app.admin.DevicePolicyManager.KEYGUARD_DISABLE_REMOTE_INPUT;
import static android.app.admin.DevicePolicyManager.KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS;

import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;

import static com.google.common.truth.Truth.assertThat;

import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doReturn;
@@ -56,10 +59,10 @@ public class RestrictedLockUtilsTest {
    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
    private RestrictedLockUtils.Proxy mProxy;

    private static final int mUserId = 194;
    private static final int mProfileId = 160;
    private static final ComponentName mAdmin1 = new ComponentName("admin1", "admin1class");
    private static final ComponentName mAdmin2 = new ComponentName("admin2", "admin2class");
    private final int mUserId = 194;
    private final int mProfileId = 160;
    private final ComponentName mAdmin1 = new ComponentName("admin1", "admin1class");
    private final ComponentName mAdmin2 = new ComponentName("admin2", "admin2class");

    @Before
    public void setUp() {
+3 −3
Original line number Diff line number Diff line
@@ -53,15 +53,15 @@ public class SettingsLibRobolectricTestRunner extends RobolectricTestRunner {

    static void getIncludedResourcePaths(String packageName, List<ResourcePath> paths) {
        paths.add(new ResourcePath(
                packageName,
                null,
                Fs.fileFromPath("./frameworks/base/packages/SettingsLib/res"),
                null));
        paths.add(new ResourcePath(
                packageName,
                null,
                Fs.fileFromPath("./frameworks/base/core/res/res"),
                null));
        paths.add(new ResourcePath(
                packageName,
                null,
                Fs.fileFromPath("./frameworks/support/v7/appcompat/res"),
                null));
    }
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
package com.android.settingslib;

public class TestConfig {
    public static final int SDK_VERSION = 23;
    public static final int SDK_VERSION = 25;
    public static final String MANIFEST_PATH =
            "frameworks/base/packages/SettingsLib/tests/robotests/AndroidManifest.xml";
}
Loading