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

Commit bb883ddf authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix usermanager related tests." into nyc-mr1-dev

parents cec78d07 c32abe86
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -23,12 +23,14 @@ import android.os.Parcelable;
import android.os.UserHandle;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.UserManager;
import android.test.AndroidTestCase;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import android.util.AtomicFile;
import android.util.AtomicFile;


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


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


import com.android.internal.util.ArrayUtils;
import com.android.internal.util.ArrayUtils;


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


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


/**
/**
 * Tests for {@link com.android.server.pm.UserRestrictionsUtils}.
 * 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
     -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
 * </pre>
 * </pre>
 */
 */
@SmallTest
public class UserRestrictionsUtilsTest extends AndroidTestCase {
public class UserRestrictionsUtilsTest extends AndroidTestCase {
    public void testNonNull() {
    public void testNonNull() {
        Bundle out = UserRestrictionsUtils.nonNull(null);
        Bundle out = UserRestrictionsUtils.nonNull(null);