aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-prod (mdb) <android-build-team-robot@google.com>2021-04-21 23:06:32 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-04-21 23:06:32 +0000
commite44197c9dbd043d621615acb1ddbe379d95f56a7 (patch)
tree2e8d93b4b8e18babce68b263dc58f613bfa1b138
parentb2f32cd1f2d31e7c54ef02bb181d730e1534913c (diff)
parentf9c838bc0881905641b986d8c5a4fd2ee023182c (diff)
downloadtradefederation-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.java20
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);
}