mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-08 00:16:09 +00:00
Moved target folder for download test to private storage, to fix problems with runtime check of permissions in Android 6
This commit is contained in:
parent
8b91c71d6f
commit
d17d8b9a52
@ -227,8 +227,8 @@ public class TestActivity extends Activity {
|
|||||||
public RemoteOperationResult downloadFile(RemoteFile remoteFile, String temporalFolder) {
|
public RemoteOperationResult downloadFile(RemoteFile remoteFile, String temporalFolder) {
|
||||||
// Create folder
|
// Create folder
|
||||||
String path = "/owncloud/tmp/" + temporalFolder;
|
String path = "/owncloud/tmp/" + temporalFolder;
|
||||||
File sdCard = Environment.getExternalStorageDirectory();
|
File privateFolder = getFilesDir();
|
||||||
File folder = new File(sdCard.getAbsolutePath() + "/" + path);
|
File folder = new File(privateFolder.getAbsolutePath() + "/" + path);
|
||||||
folder.mkdirs();
|
folder.mkdirs();
|
||||||
|
|
||||||
DownloadRemoteFileOperation downloadOperation = new DownloadRemoteFileOperation(remoteFile.getRemotePath(), folder.getAbsolutePath());
|
DownloadRemoteFileOperation downloadOperation = new DownloadRemoteFileOperation(remoteFile.getRemotePath(), folder.getAbsolutePath());
|
||||||
|
@ -94,9 +94,8 @@ public class DownloadFileTest extends RemoteTest {
|
|||||||
*/
|
*/
|
||||||
public void testDownloadFile() {
|
public void testDownloadFile() {
|
||||||
RemoteOperationResult result = mActivity.downloadFile(
|
RemoteOperationResult result = mActivity.downloadFile(
|
||||||
new RemoteFile(mFullPath2Image),
|
new RemoteFile(mFullPath2Image), ""
|
||||||
mActivity.getFilesDir().getAbsolutePath()
|
);
|
||||||
);
|
|
||||||
mDownloadedFilePath = mFullPath2Image;
|
mDownloadedFilePath = mFullPath2Image;
|
||||||
assertTrue(result.isSuccess());
|
assertTrue(result.isSuccess());
|
||||||
// TODO some checks involving the local file
|
// TODO some checks involving the local file
|
||||||
@ -107,9 +106,8 @@ public class DownloadFileTest extends RemoteTest {
|
|||||||
*/
|
*/
|
||||||
public void testDownloadFileSpecialChars() {
|
public void testDownloadFileSpecialChars() {
|
||||||
RemoteOperationResult result = mActivity.downloadFile(
|
RemoteOperationResult result = mActivity.downloadFile(
|
||||||
new RemoteFile(mFullPath2ImageWitSpecialChars),
|
new RemoteFile(mFullPath2ImageWitSpecialChars), ""
|
||||||
mActivity.getFilesDir().getAbsolutePath()
|
);
|
||||||
);
|
|
||||||
mDownloadedFilePath = mFullPath2ImageWitSpecialChars;
|
mDownloadedFilePath = mFullPath2ImageWitSpecialChars;
|
||||||
assertTrue(result.isSuccess());
|
assertTrue(result.isSuccess());
|
||||||
// TODO some checks involving the local file
|
// TODO some checks involving the local file
|
||||||
@ -120,9 +118,8 @@ public class DownloadFileTest extends RemoteTest {
|
|||||||
*/
|
*/
|
||||||
public void testDownloadFileNotFound() {
|
public void testDownloadFileNotFound() {
|
||||||
RemoteOperationResult result = mActivity.downloadFile(
|
RemoteOperationResult result = mActivity.downloadFile(
|
||||||
new RemoteFile(mFullPath2ImageNotFound),
|
new RemoteFile(mFullPath2ImageNotFound), ""
|
||||||
mActivity.getFilesDir().getAbsolutePath()
|
);
|
||||||
);
|
|
||||||
assertFalse(result.isSuccess());
|
assertFalse(result.isSuccess());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user