-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into dev
- Loading branch information
Showing
21 changed files
with
443 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
DO NOT TOUCH; GENERATED BY DRONE | ||
<span class="mdl-layout-title">Lint Report: 103 warnings</span> | ||
<span class="mdl-layout-title">Lint Report: 102 warnings</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
src/androidTest/java/com/owncloud/android/ui/adapter/OCFileListAdapterIT.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* | ||
* Nextcloud Android client application | ||
* | ||
* @author Tobias Kaminsky | ||
* Copyright (C) 2022 Tobias Kaminsky | ||
* Copyright (C) 2022 Nextcloud GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
package com.owncloud.android.ui.adapter | ||
|
||
import com.owncloud.android.AbstractIT | ||
import com.owncloud.android.datamodel.OCFile | ||
import org.junit.Assert.assertEquals | ||
import org.junit.Test | ||
|
||
@Suppress("MagicNumber") | ||
class OCFileListAdapterIT : AbstractIT() { | ||
@Test | ||
fun testParseMedia() { | ||
// empty start | ||
storageManager.deleteAllFiles() | ||
|
||
val startDate: Long = 0 | ||
val endDate: Long = 3642752043 | ||
assertEquals(0, storageManager.getGalleryItems(startDate, endDate).size) | ||
|
||
// create dummy files | ||
OCFile("/test.txt", "01").apply { | ||
mimeType = "text/plain" | ||
}.let { | ||
storageManager.saveFile(it) | ||
} | ||
|
||
OCFile("/image.png", "02").apply { | ||
mimeType = "image/png" | ||
modificationTimestamp = 1000000 | ||
}.let { | ||
storageManager.saveFile(it) | ||
} | ||
|
||
OCFile("/image2.png", "03").apply { | ||
mimeType = "image/png" | ||
modificationTimestamp = 1000050 | ||
}.let { | ||
storageManager.saveFile(it) | ||
} | ||
|
||
OCFile("/video.mpg", "04").apply { | ||
mimeType = "video/mpg" | ||
modificationTimestamp = 1000045 | ||
}.let { | ||
storageManager.saveFile(it) | ||
} | ||
|
||
OCFile("/video2.avi", "05").apply { | ||
mimeType = "video/avi" | ||
modificationTimestamp = endDate + 10 | ||
}.let { | ||
storageManager.saveFile(it) | ||
} | ||
|
||
// list of remoteFiles | ||
assertEquals(5, storageManager.allFiles.size) | ||
assertEquals(3, storageManager.getGalleryItems(startDate, endDate).size) | ||
assertEquals(4, storageManager.allGalleryItems.size) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.