Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #26844: Rename CFRPopupFullscreenLayout class to conform to filen…
Browse files Browse the repository at this point in the history
…ame rule.
  • Loading branch information
mcarare committed Sep 7, 2022
1 parent f0f3a71 commit 9ddccf1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/org/mozilla/fenix/compose/cfr/CFRPopup.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class CFRPopup(
// This is just a facade for the CFRPopupFullScreenLayout composable offering a cleaner API.

@VisibleForTesting
internal var popup: WeakReference<CFRPopupFullScreenLayout>? = null
internal var popup: WeakReference<CFRPopupFullscreenLayout>? = null

/**
* Construct and display a styled CFR popup shown at the coordinates of [anchor].
Expand All @@ -72,7 +72,7 @@ class CFRPopup(
*/
fun show() {
anchor.post {
CFRPopupFullScreenLayout(text, anchor, properties, onDismiss, action).apply {
CFRPopupFullscreenLayout(text, anchor, properties, onDismiss, action).apply {
this.show()
popup = WeakReference(this)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private data class PopupHorizontalBounds(
* @param action Optional other composable to show just below the popup text.
*/
@SuppressLint("ViewConstructor") // Intended to be used only in code, don't need a View constructor
internal class CFRPopupFullScreenLayout(
internal class CFRPopupFullscreenLayout(
private val text: String,
private val anchor: View,
private val properties: CFRPopupProperties,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ import org.junit.runner.RunWith
import org.mozilla.fenix.helpers.FenixRobolectricTestRunner

@RunWith(FenixRobolectricTestRunner::class)
class CFRPopupFullScreenLayoutTest {
class CFRPopupFullscreenLayoutTest {
@Test
fun `WHEN the popup is constructed THEN setup lifecycle owners`() {
val anchor = View(testContext).apply {
ViewTreeLifecycleOwner.set(this, mockk())
this.setViewTreeSavedStateRegistryOwner(mockk())
}

val popupView = spyk(CFRPopupFullScreenLayout("", anchor, mockk(), mockk()) {})
val popupView = spyk(CFRPopupFullscreenLayout("", anchor, mockk(), mockk()) {})

assertNotNull(popupView.findViewTreeLifecycleOwner())
assertEquals(
Expand All @@ -59,7 +59,7 @@ class CFRPopupFullScreenLayoutTest {
}
val windowManager = spyk(context.getSystemService(Context.WINDOW_SERVICE) as WindowManager)
every { context.getSystemService(Context.WINDOW_SERVICE) } returns windowManager
val popupView = CFRPopupFullScreenLayout("", anchor, mockk(), mockk()) {}
val popupView = CFRPopupFullscreenLayout("", anchor, mockk(), mockk()) {}
popupView.show()
assertNotNull(popupView.findViewTreeLifecycleOwner())
assertNotNull(popupView.findViewTreeSavedStateRegistryOwner())
Expand All @@ -77,7 +77,7 @@ class CFRPopupFullScreenLayoutTest {
val anchor = View(context)
val windowManager = spyk(context.getSystemService(Context.WINDOW_SERVICE))
every { context.getSystemService(Context.WINDOW_SERVICE) } returns windowManager
val popupView = CFRPopupFullScreenLayout("", anchor, mockk(), mockk()) {}
val popupView = CFRPopupFullscreenLayout("", anchor, mockk(), mockk()) {}
val layoutParamsCaptor = slot<LayoutParams>()

popupView.show()
Expand All @@ -97,7 +97,7 @@ class CFRPopupFullScreenLayoutTest {
@Test
fun `WHEN creating layout params THEN get fullscreen translucent layout params`() {
val anchor = View(testContext)
val popupView = CFRPopupFullScreenLayout("", anchor, mockk(), mockk()) {}
val popupView = CFRPopupFullscreenLayout("", anchor, mockk(), mockk()) {}

val result = popupView.createLayoutParams()

Expand Down

0 comments on commit 9ddccf1

Please sign in to comment.