Skip to content

Commit

Permalink
Merge branch 'dev' into strings-squashed
Browse files Browse the repository at this point in the history
  • Loading branch information
AL-Session committed Aug 19, 2024
2 parents 27bc90b + f379604 commit 27ca77d
Show file tree
Hide file tree
Showing 304 changed files with 64 additions and 3,078 deletions.
108 changes: 55 additions & 53 deletions app/src/androidTest/java/network/loki/messenger/HomeActivityTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,23 @@ class HomeActivityTests {
PermissionGranter.allowPermissionsIfNeeded(Manifest.permission.POST_NOTIFICATIONS)
}


private fun goToMyChat() {
onView(withId(R.id.newConversationButton)).perform(ViewActions.click())
onView(withId(R.id.createPrivateChatButton)).perform(ViewActions.click())
// new chat
onView(withId(R.id.publicKeyEditText)).perform(ViewActions.closeSoftKeyboard())
onView(withId(R.id.copyButton)).perform(ViewActions.click())
val context = InstrumentationRegistry.getInstrumentation().targetContext
lateinit var copied: String
InstrumentationRegistry.getInstrumentation().runOnMainSync {
val clipboardManager = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
copied = clipboardManager.primaryClip!!.getItemAt(0).text.toString()
}
onView(withId(R.id.publicKeyEditText)).perform(ViewActions.typeText(copied))
onView(withId(R.id.publicKeyEditText)).perform(ViewActions.closeSoftKeyboard())
onView(withId(R.id.createPrivateChatButton)).perform(ViewActions.click())
}
// ACL - COMMENTED OUT BECAUSE REFERENCES DELETED FRAGMENT `EnterPublicKeyFragment.kt` - which itself used R.id.<stuff_which_no_longer_exists>
// private fun goToMyChat() {
// onView(withId(R.id.newConversationButton)).perform(ViewActions.click())
// onView(withId(R.id.createPrivateChatButton)).perform(ViewActions.click())
// // new chat
// onView(withId(R.id.publicKeyEditText)).perform(ViewActions.closeSoftKeyboard())
// onView(withId(R.id.copyButton)).perform(ViewActions.click())
// val context = InstrumentationRegistry.getInstrumentation().targetContext
// lateinit var copied: String
// InstrumentationRegistry.getInstrumentation().runOnMainSync {
// val clipboardManager = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
// copied = clipboardManager.primaryClip!!.getItemAt(0).text.toString()
// }
// onView(withId(R.id.publicKeyEditText)).perform(ViewActions.typeText(copied))
// onView(withId(R.id.publicKeyEditText)).perform(ViewActions.closeSoftKeyboard())
// onView(withId(R.id.createPrivateChatButton)).perform(ViewActions.click())
// }

@Test
fun testLaunches_dismiss_seedView() {
Expand All @@ -147,42 +147,44 @@ class HomeActivityTests {
onView(withId(R.id.seedReminderView)).check(matches(not(isDisplayed())))
}

@Test
fun testChat_withSelf() {
setupLoggedInState()
goToMyChat()
TextSecurePreferences.setLinkPreviewsEnabled(context, true)
sendMessage("howdy")
sendMessage("test")
// tests url rewriter doesn't crash
sendMessage("https://www.getsession.org?random_query_parameter=testtesttesttesttesttesttesttest&other_query_parameter=testtesttesttesttesttesttesttest")
sendMessage("https://www.ámazon.com")
}

@Test
fun testChat_displaysCorrectUrl() {
setupLoggedInState()
goToMyChat()
TextSecurePreferences.setLinkPreviewsEnabled(InstrumentationRegistry.getInstrumentation().targetContext, true)
// given the link url text
val url = "https://www.ámazon.com"
sendMessage(url, LinkPreview(url, "amazon", Optional.absent()))

// when the URL span is clicked
onView(withSubstring(url)).perform(ViewActions.click())

// then the URL dialog should be displayed with a known punycode url
val amazonPuny = "https://www.xn--mazon-wqa.com/"

// Substitute the URL into our string
val c = InstrumentationRegistry.getInstrumentation().targetContext
val dialogPromptText = Phrase.from(c, R.string.urlOpenDescription)
.put(URL_KEY, amazonPuny)
.format().toString()

onView(isRoot()).perform(waitFor(1000)) // no other way for this to work apparently
onView(withText(dialogPromptText)).check(matches(isDisplayed()))
}
// ACL - COMMENTED OUT BECAUSE REFERENCES DELETED FRAGMENT `EnterPublicKeyFragment.kt` - which itself used R.id.<stuff_which_no_longer_exists>
// @Test
// fun testChat_withSelf() {
// setupLoggedInState()
// goToMyChat()
// TextSecurePreferences.setLinkPreviewsEnabled(context, true)
// sendMessage("howdy")
// sendMessage("test")
// // tests url rewriter doesn't crash
// sendMessage("https://www.getsession.org?random_query_parameter=testtesttesttesttesttesttesttest&other_query_parameter=testtesttesttesttesttesttesttest")
// sendMessage("https://www.ámazon.com")
// }

// ACL - COMMENTED OUT BECAUSE REFERENCES DELETED FRAGMENT `EnterPublicKeyFragment.kt` - which itself used R.id.<stuff_which_no_longer_exists>
// @Test
// fun testChat_displaysCorrectUrl() {
// setupLoggedInState()
// goToMyChat()
// TextSecurePreferences.setLinkPreviewsEnabled(InstrumentationRegistry.getInstrumentation().targetContext, true)
// // given the link url text
// val url = "https://www.ámazon.com"
// sendMessage(url, LinkPreview(url, "amazon", Optional.absent()))
//
// // when the URL span is clicked
// onView(withSubstring(url)).perform(ViewActions.click())
//
// // then the URL dialog should be displayed with a known punycode url
// val amazonPuny = "https://www.xn--mazon-wqa.com/"
//
// // Substitute the URL into our string
// val c = InstrumentationRegistry.getInstrumentation().targetContext
// val dialogPromptText = Phrase.from(c, R.string.urlOpenDescription)
// .put(URL_KEY, amazonPuny)
// .format().toString()
//
// onView(isRoot()).perform(waitFor(1000)) // no other way for this to work apparently
// onView(withText(dialogPromptText)).check(matches(isDisplayed()))
// }

/**
* Perform action of waiting for a specific time.
Expand Down

This file was deleted.

8 changes: 0 additions & 8 deletions app/src/main/res/anim/camera_slide_from_bottom.xml

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/anim/fade_in.xml

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/anim/fade_out.xml

This file was deleted.

17 changes: 0 additions & 17 deletions app/src/main/res/anim/fade_scale_in.xml

This file was deleted.

11 changes: 0 additions & 11 deletions app/src/main/res/anim/slide_from_top.xml

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/anim/slide_to_top.xml

This file was deleted.

8 changes: 0 additions & 8 deletions app/src/main/res/animator/bottom_pause_to_play_animation.xml

This file was deleted.

8 changes: 0 additions & 8 deletions app/src/main/res/animator/bottom_play_to_pause_animation.xml

This file was deleted.

9 changes: 0 additions & 9 deletions app/src/main/res/animator/rotate_90_animation.xml

This file was deleted.

9 changes: 0 additions & 9 deletions app/src/main/res/animator/rotate_minus_90_animation.xml

This file was deleted.

8 changes: 0 additions & 8 deletions app/src/main/res/animator/upper_pause_to_play_animation.xml

This file was deleted.

8 changes: 0 additions & 8 deletions app/src/main/res/animator/upper_play_to_pause_animation.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/color/icon_tab_selector.xml

This file was deleted.

Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_account_box_dark.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_account_box_light.png
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_audio_light.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_image_light.png
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_note_to_self.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_video_light.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_volume_up_light.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_warning_light.png
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/ic_account_box_dark.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/ic_account_box_light.png
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/ic_audio_light.png
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/ic_contact_picture.png
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/ic_image_light.png
Binary file not shown.
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_note_to_self.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_video_light.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_volume_up_light.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_warning_light.png
Diff not rendered.
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_account_box_dark.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_audio_light.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_image_light.png
Diff not rendered.
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_note_to_self.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_video_light.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_volume_up_light.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_warning_light.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_audio_light.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_image_light.png
Diff not rendered.
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_note_to_self.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_video_light.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_volume_up_light.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_warning_light.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxxhdpi/ic_note_to_self.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
4 changes: 0 additions & 4 deletions app/src/main/res/drawable/circle_tintable_4dp_inset.xml

This file was deleted.

13 changes: 0 additions & 13 deletions app/src/main/res/drawable/colorpickerpreference_pref_swatch.xml

This file was deleted.

16 changes: 0 additions & 16 deletions app/src/main/res/drawable/compose_background_light.xml

This file was deleted.

Loading

0 comments on commit 27ca77d

Please sign in to comment.