aboutsummaryrefslogtreecommitdiff
path: root/app/src/androidTest/kotlin/com
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-12-31 18:57:28 -0500
committerGitHub <noreply@github.com>2018-12-31 18:57:28 -0500
commit149c6be1bfd4bd84381757940fece1be7b9801aa (patch)
tree85fe10e3ee3ea34ad717f0d61975ca0119dd36d5 /app/src/androidTest/kotlin/com
parent7661bbfc9b8f34bf9d92dc08a9fcd7cc6ec7cbb3 (diff)
downloadfrost-149c6be1bfd4bd84381757940fece1be7b9801aa.tar.gz
frost-149c6be1bfd4bd84381757940fece1be7b9801aa.tar.bz2
frost-149c6be1bfd4bd84381757940fece1be7b9801aa.zip
Enhancement/coroutines (#1273)
* Convert rest of fbcookie to suspended methods * Replace active checks with yield * Apply spotless * Switch cookie domain to exact url * Optimize imports and enable travis tests again * Update proguard rules * Remove unnecessary yield * Remove unused flyweight * Remove unused disposable and method * Use contexthelper instead of dispatcher main * Convert login activity to coroutines * Use kau helper methods for coroutines * Enhancement/offline site (#1288) * Begin conversion of offline site logic * Fix offline tests and add validation tests * Ignore cookie in jsoup if it is blank * Force load and zip to be in io * Use different zip files to fix tests * Log all test output * Do not log stdout * Allow test skip for fb offline
Diffstat (limited to 'app/src/androidTest/kotlin/com')
-rw-r--r--app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ImageActivityTest.kt6
-rw-r--r--app/src/androidTest/kotlin/com/pitchedapps/frost/facebook/FbCookieTest.kt18
2 files changed, 20 insertions, 4 deletions
diff --git a/app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ImageActivityTest.kt b/app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ImageActivityTest.kt
index 23f6dab9..d32b956e 100644
--- a/app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ImageActivityTest.kt
+++ b/app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ImageActivityTest.kt
@@ -62,14 +62,14 @@ class ImageActivityTest {
}
private val mockServer: MockWebServer by lazy {
- val magentaImg = Buffer()
- magentaImg.writeAll(Okio.source(getResource("bayer-pattern.jpg")))
+ val img = Buffer()
+ img.writeAll(Okio.source(getResource("bayer-pattern.jpg")))
MockWebServer().apply {
setDispatcher(object : Dispatcher() {
override fun dispatch(request: RecordedRequest): MockResponse =
when {
request.path.contains("text") -> MockResponse().setResponseCode(200).setBody("Valid mock text response")
- request.path.contains("image") -> MockResponse().setResponseCode(200).setBody(magentaImg)
+ request.path.contains("image") -> MockResponse().setResponseCode(200).setBody(img)
else -> MockResponse().setResponseCode(404).setBody("Error mock response")
}
})
diff --git a/app/src/androidTest/kotlin/com/pitchedapps/frost/facebook/FbCookieTest.kt b/app/src/androidTest/kotlin/com/pitchedapps/frost/facebook/FbCookieTest.kt
index d5c8d2e1..a826391e 100644
--- a/app/src/androidTest/kotlin/com/pitchedapps/frost/facebook/FbCookieTest.kt
+++ b/app/src/androidTest/kotlin/com/pitchedapps/frost/facebook/FbCookieTest.kt
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2018 Allan Wang
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
package com.pitchedapps.frost.facebook
import android.webkit.CookieManager
@@ -10,4 +26,4 @@ class FbCookieTest {
fun managerAcceptsCookie() {
assertTrue(CookieManager.getInstance().acceptCookie(), "Cookie manager should accept cookie by default")
}
-} \ No newline at end of file
+}