diff options
author | Allan Wang <me@allanwang.ca> | 2018-04-13 00:13:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-13 00:13:28 -0400 |
commit | c5e769deabeb80d7257b85c5c3d802cf46e6b191 (patch) | |
tree | b3ac48678e893495b932c6500025db73a83e3d2b /app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt | |
parent | d9e2562267e549ee407e683262406581f2c4888e (diff) | |
download | frost-c5e769deabeb80d7257b85c5c3d802cf46e6b191.tar.gz frost-c5e769deabeb80d7257b85c5c3d802cf46e6b191.tar.bz2 frost-c5e769deabeb80d7257b85c5c3d802cf46e6b191.zip |
Fix view full image (#882)v2.0.1
* Test including full photo viewer
* Test cookie in glide
* Fix parser and add redirects to view full image
* Update changelog
Diffstat (limited to 'app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt')
-rw-r--r-- | app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt index 0e45d2f2..beda26ef 100644 --- a/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt +++ b/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt @@ -1,6 +1,7 @@ package com.pitchedapps.frost.facebook import com.pitchedapps.frost.utils.isImageUrl +import com.pitchedapps.frost.utils.isIndirectImageUrl import org.junit.Test import kotlin.test.assertEquals import kotlin.test.assertFalse @@ -48,6 +49,13 @@ class FbUrlTest { } @Test + fun ampersand() { + val url = "https://scontent-yyz1-1.xx.fbcdn.net/v/t31.0-8/fr/cp0/e15/q65/123.jpg?_nc_cat=0&efg=asdf" + val formattedUrl = "https://scontent-yyz1-1.xx.fbcdn.net/v/t31.0-8/fr/cp0/e15/q65/123.jpg?_nc_cat=0&efg=asdf" + assertFbFormat(formattedUrl, url) + } + + @Test fun doubleDash() { assertFbFormat("${FB_URL_BASE}relative", "$FB_URL_BASE/relative") } @@ -73,6 +81,15 @@ class FbUrlTest { } @Test + fun indirectImage() { + arrayOf( + "#!/photo/view_full_size/?fbid=107368839645039" + ).forEach { + assertTrue(it.isIndirectImageUrl, "Failed to match indirect image for $it") + } + } + + @Test fun antiImageRegex() { arrayOf( "http...fbcdn.net...mp4", |