Merge "Snap for 7300191 from a006688a9a6dc146eec21539df941dc3e10dbb9f to pie-vts-release" into pie-vts-release
diff --git a/tests/src/com/android/tradefed/device/contentprovider/ContentProviderHandlerTest.java b/tests/src/com/android/tradefed/device/contentprovider/ContentProviderHandlerTest.java
index a9f4533..e72b23a 100644
--- a/tests/src/com/android/tradefed/device/contentprovider/ContentProviderHandlerTest.java
+++ b/tests/src/com/android/tradefed/device/contentprovider/ContentProviderHandlerTest.java
@@ -190,28 +190,16 @@
     /** Test {@link ContentProviderHandler#pullFile(String, File)}. */
     @Test
     public void testPullFile_createLocalFileIfNotExist() throws Exception {
-        File pullTo = new File("content-provider-test.txt");
+        File pullTo = FileUtil.createTempFile("content-provider-test", ".txt");
+        // Delete to test unexisting file.
+        pullTo.delete();
         String devicePath = "path/somewhere/file.txt";
         mockPullFileSuccess();
 
         try {
             assertFalse(pullTo.exists());
-            mProvider.pullFile(devicePath, pullTo);
-            assertTrue(pullTo.exists());
-        } finally {
-            FileUtil.deleteFile(pullTo);
-        }
-    }
-
-    /** Test {@link ContentProviderHandler#pullFile(String, File)}. */
-    @Test
-    public void testPullFile_success() throws Exception {
-        File pullTo = new File("content-provider-test.txt");
-        String devicePath = "path/somewhere/file.txt";
-
-        try {
-            mockPullFileSuccess();
             assertTrue(mProvider.pullFile(devicePath, pullTo));
+            assertTrue(pullTo.exists());
         } finally {
             FileUtil.deleteFile(pullTo);
         }