diff options
author | android-build-prod (mdb) <android-build-team-robot@google.com> | 2021-04-21 23:06:32 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-04-21 23:06:32 +0000 |
commit | e44197c9dbd043d621615acb1ddbe379d95f56a7 (patch) | |
tree | 2e8d93b4b8e18babce68b263dc58f613bfa1b138 | |
parent | b2f32cd1f2d31e7c54ef02bb181d730e1534913c (diff) | |
parent | f9c838bc0881905641b986d8c5a4fd2ee023182c (diff) | |
download | tradefederation-pie-vts-release.tar.gz |
Merge "Snap for 7300191 from a006688a9a6dc146eec21539df941dc3e10dbb9f to pie-vts-release" into pie-vts-releaseandroid-vts-9.0_r19android-vts-9.0_r18android-vts-9.0_r17pie-vts-release
-rw-r--r-- | tests/src/com/android/tradefed/device/contentprovider/ContentProviderHandlerTest.java | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/tests/src/com/android/tradefed/device/contentprovider/ContentProviderHandlerTest.java b/tests/src/com/android/tradefed/device/contentprovider/ContentProviderHandlerTest.java index a9f453352..e72b23a21 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 @@ public class ContentProviderHandlerTest { /** 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); } |