diff --git a/tests/permission/src/com/android/framework/permission/tests/PmPermissionsTests.java b/tests/permission/src/com/android/framework/permission/tests/PmPermissionsTests.java
index 4351348..b690c45 100644
--- a/tests/permission/src/com/android/framework/permission/tests/PmPermissionsTests.java
+++ b/tests/permission/src/com/android/framework/permission/tests/PmPermissionsTests.java
@@ -25,13 +25,14 @@
  * Verify PackageManager api's that require specific permissions.
  */
 public class PmPermissionsTests extends AndroidTestCase {
-       private PackageManager mPm;
+    private PackageManager mPm;
+    private String mPkgName = "com.android.framework.permission.tests";
 
-       @Override
-       protected void setUp() throws Exception {
-           super.setUp();
-           mPm = getContext().getPackageManager();
-       }
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        mPm = getContext().getPackageManager();
+    }
 
     /*
      * This test verifies that PackageManger.getPackageSizeInfo enforces permission
@@ -40,8 +41,99 @@
     @SmallTest
     public void testGetPackageSize() {
         try {
-            mPm.getPackageSizeInfo("com.android.framework", null);
-            fail("PackageManager.getPackageSizeInfo did not throw SecurityException as expected");
+            mPm.getPackageSizeInfo(mPkgName, null);
+            fail("PackageManager.getPackageSizeInfo" +
+                    "did not throw SecurityException as expected");
+        } catch (SecurityException e) {
+            // expected
+        }
+    }
+
+    /*
+     * This test verifies that PackageManger.DeleteApplicationCacheFiles enforces permission
+     * android.permission.DELETE_CACHE_FILES
+     */
+    @SmallTest
+    public void testDeleteApplicationCacheFiles() {
+        try {
+            mPm.deleteApplicationCacheFiles(mPkgName, null);
+            fail("PackageManager.deleteApplicationCacheFiles" +
+                    "did not throw SecurityException as expected");
+        } catch (SecurityException e) {
+            // expected
+        }
+    }
+
+    /*
+     * This test verifies that PackageManger.installPackage enforces permission
+     * android.permission.INSTALL_PACKAGES
+     */
+    @SmallTest
+    public void testInstallPackage() {
+        try {
+            mPm.installPackage(null, null, 0, null);
+            fail("PackageManager.installPackage" +
+                    "did not throw SecurityException as expected");
+        } catch (SecurityException e) {
+            // expected
+        }
+    }
+
+    /*
+     * This test verifies that PackageManger.freeStorage
+     * enforces permission android.permission.CLEAR_APP_CACHE
+     */
+    @SmallTest
+    public void testFreeStorage1() {
+        try {
+            mPm.freeStorage(100000, null);
+            fail("PackageManager.freeStorage " +
+                   "did not throw SecurityException as expected");
+        } catch (SecurityException e) {
+            // expected
+        }
+    }
+
+    /*
+     * This test verifies that PackageManger.freeStorageAndNotify
+     * enforces permission android.permission.CLEAR_APP_CACHE
+     */
+    @SmallTest
+    public void testFreeStorage2() {
+        try {
+            mPm.freeStorageAndNotify(100000, null);
+            fail("PackageManager.freeStorageAndNotify" +
+                    " did not throw SecurityException as expected");
+        } catch (SecurityException e) {
+            // expected
+        }
+    }
+
+    /*
+     * This test verifies that PackageManger.clearApplicationUserData
+     * enforces permission android.permission.CLEAR_APP_USER_DATA
+     */
+    @SmallTest
+    public void testClearApplicationUserData() {
+        try {
+            mPm.clearApplicationUserData(mPkgName, null);
+            fail("PackageManager.clearApplicationUserData" +
+                    "did not throw SecurityException as expected");
+        } catch (SecurityException e) {
+            // expected
+        }
+    }
+
+    /*
+     * This test verifies that PackageManger.deletePackage
+     * enforces permission android.permission.DELETE_PACKAGES
+     */
+    @SmallTest
+    public void testDeletePackage() {
+        try {
+            mPm.deletePackage(mPkgName, null, 0);
+            fail("PackageManager.deletePackage" +
+                   "did not throw SecurityException as expected");
         } catch (SecurityException e) {
             // expected
         }
