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

Commit c32abe86 authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Fix usermanager related tests.

- Fix failing test
- Updates to include in continuous test execution

Fixes: 28938682
Change-Id: I17dd9ca5cf2579f0649f3939b00b08fa71a106cf
parent 8c43f6fe
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -23,12 +23,14 @@ import android.os.Parcelable;
import android.os.UserHandle;
import android.os.UserManager;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import android.util.AtomicFile;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;

@SmallTest
public class UserManagerServiceTest extends AndroidTestCase {
    private static String[] STRING_ARRAY = new String[] {"<tag", "<![CDATA["};
    private File restrictionsFile;
+3 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.os.Bundle;
import android.os.UserHandle;
import android.os.UserManager;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.MediumTest;

import com.android.internal.util.ArrayUtils;

@@ -33,6 +34,7 @@ import java.util.Arrays;
import java.util.List;

/** Test {@link UserManager} functionality. */
@MediumTest
public class UserManagerTest extends AndroidTestCase {
    private static final int REMOVE_CHECK_INTERVAL = 500;
    private static final int REMOVE_TIMEOUT = 60 * 1000;
@@ -96,7 +98,7 @@ public class UserManagerTest extends AndroidTestCase {
                    && !user.isPrimary()) {
                found = true;
                Bundle restrictions = mUserManager.getUserRestrictions(user.getUserHandle());
                assertFalse("New user should have DISALLOW_CONFIG_WIFI =false by default",
                assertTrue("Guest user should have DISALLOW_CONFIG_WIFI=true by default",
                        restrictions.getBoolean(UserManager.DISALLOW_CONFIG_WIFI));
            }
        }
+2 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.os.Bundle;
import android.os.UserManager;
import android.test.AndroidTestCase;
import android.test.MoreAsserts;
import android.test.suitebuilder.annotation.SmallTest;

/**
 * Tests for {@link com.android.server.pm.UserRestrictionsUtils}.
@@ -35,6 +36,7 @@ import android.test.MoreAsserts;
     -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
 * </pre>
 */
@SmallTest
public class UserRestrictionsUtilsTest extends AndroidTestCase {
    public void testNonNull() {
        Bundle out = UserRestrictionsUtils.nonNull(null);