Bug 1838903 - Fix Fenix formatting issues and update baseline

fenix/116.0
Ryan VanderMeulen 11 months ago committed by mergify[bot]
parent a5cefbfb1b
commit 437b188fe8

@ -39,8 +39,6 @@ import org.mozilla.fenix.ui.robots.searchScreen
* Tests for verifying basic functionality of bookmarks
*/
class BookmarksTest {
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
private lateinit var mockWebServer: MockWebServer
private lateinit var mDevice: UiDevice
private val bookmarksFolderName = "New Folder"

@ -154,7 +154,7 @@ class DownloadTest {
/* Verifies downloads in the Downloads Menu:
- downloads appear in the list
- deleting a download from device storage, removes it from the Downloads Menu too
*/
*/
@SmokeTest
@Test
fun manageDownloadsInDownloadsMenuTest() {

@ -38,7 +38,6 @@ import org.mozilla.fenix.ui.robots.searchScreen
*
*/
class HistoryTest {
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
private lateinit var mockWebServer: MockWebServer
private lateinit var mDevice: UiDevice
@ -159,7 +158,6 @@ class HistoryTest {
RecyclerViewIdlingResource(activityTestRule.activity.findViewById(R.id.history_list), 1),
) {
clickDeleteAllHistoryButton()
}
verifyDeleteConfirmationMessage()
selectEverythingOption()

@ -28,8 +28,6 @@ import org.mozilla.fenix.ui.robots.navigationToolbar
*/
class HomeScreenTest {
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
private lateinit var mDevice: UiDevice
private lateinit var mockWebServer: MockWebServer
private lateinit var firstPocketStoryPublisher: String

@ -33,8 +33,6 @@ import org.mozilla.fenix.ui.robots.notificationShade
* Note: this test only verifies media notifications, not media itself
*/
class MediaNotificationTest {
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
private lateinit var mockWebServer: MockWebServer
private lateinit var mDevice: UiDevice

@ -37,7 +37,6 @@ class NavigationToolbarTest {
private lateinit var mDevice: UiDevice
private lateinit var mockWebServer: MockWebServer
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
@get:Rule
val activityTestRule = HomeActivityTestRule.withDefaultSettingsOverrides()

@ -25,8 +25,6 @@ import org.mozilla.fenix.ui.robots.homeScreen
*/
class SettingsAboutTest {
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
private lateinit var mDevice: UiDevice
private lateinit var mockWebServer: MockWebServer

@ -30,8 +30,6 @@ import org.mozilla.fenix.ui.robots.navigationToolbar
*/
class SettingsAdvancedTest {
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
private lateinit var mDevice: UiDevice
private lateinit var mockWebServer: MockWebServer

@ -35,7 +35,6 @@ import org.mozilla.fenix.ui.robots.navigationToolbar
*
*/
class SettingsDeleteBrowsingDataOnQuitTest {
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
private lateinit var mockWebServer: MockWebServer
@get:Rule

@ -33,7 +33,6 @@ import org.mozilla.fenix.ui.robots.settingsScreen
*/
class SettingsDeleteBrowsingDataTest {
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
private lateinit var mockWebServer: MockWebServer
@get:Rule

@ -22,8 +22,6 @@ import org.mozilla.fenix.ui.robots.homeScreen
*/
class SettingsDeveloperToolsTest {
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
private lateinit var mDevice: UiDevice
private lateinit var mockWebServer: MockWebServer

@ -35,7 +35,6 @@ import java.util.Locale
*
*/
class SettingsGeneralTest {
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
private lateinit var mockWebServer: MockWebServer
@get:Rule

@ -24,8 +24,6 @@ import org.mozilla.fenix.ui.robots.notificationShade
*/
class SettingsPrivacyTest {
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
private lateinit var mDevice: UiDevice
private lateinit var mockWebServer: MockWebServer

@ -21,8 +21,6 @@ import org.mozilla.fenix.helpers.HomeActivityTestRule
*/
class SettingsSyncTest {
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
private lateinit var mDevice: UiDevice
private lateinit var mockWebServer: MockWebServer

@ -93,7 +93,7 @@ class SmokeTest {
- editing the url bar
- the tab drawer button
- opening a new search and dismissing the nav bar
*/
*/
@Test
fun verifyBasicNavigationToolbarFunctionality() {
val defaultWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)

@ -42,7 +42,6 @@ class TabbedBrowsingTest {
private lateinit var mDevice: UiDevice
private lateinit var mockWebServer: MockWebServer
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
@get:Rule
val activityTestRule = HomeActivityTestRule.withDefaultSettingsOverrides()

@ -26,8 +26,6 @@ import org.mozilla.fenix.ui.robots.longClickPageObject
*/
class ThreeDotMenuMainTest {
/* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping.
private lateinit var mockWebServer: MockWebServer
@get:Rule

@ -99,9 +99,9 @@ class BrowserRobot {
}
/* Asserts that the text within DOM element with ID="testContent" has the given text, i.e.
* document.querySelector('#testContent').innerText == expectedText
*
*/
* document.querySelector('#testContent').innerText == expectedText
*
*/
fun verifyPageContent(expectedText: String) {
sessionLoadedIdlingResource = SessionLoadedIdlingResource()

@ -217,15 +217,13 @@ class SettingsRobot {
return BrowserRobot.Transition()
}
fun openAboutFirefoxPreview(interact: SettingsSubMenuAboutRobot.() -> Unit):
SettingsSubMenuAboutRobot.Transition {
fun openAboutFirefoxPreview(interact: SettingsSubMenuAboutRobot.() -> Unit): SettingsSubMenuAboutRobot.Transition {
aboutFirefoxHeading().click()
SettingsSubMenuAboutRobot().interact()
return SettingsSubMenuAboutRobot.Transition()
}
fun openSearchSubMenu(interact: SettingsSubMenuSearchRobot.() -> Unit):
SettingsSubMenuSearchRobot.Transition {
fun openSearchSubMenu(interact: SettingsSubMenuSearchRobot.() -> Unit): SettingsSubMenuSearchRobot.Transition {
itemWithText(getStringResource(R.string.preferences_search))
.also {
it.waitForExists(waitingTimeShort)

@ -408,8 +408,7 @@ class TabDrawerRobot {
return Transition()
}
fun openRecentlyClosedTabs(interact: RecentlyClosedTabsRobot.() -> Unit):
RecentlyClosedTabsRobot.Transition {
fun openRecentlyClosedTabs(interact: RecentlyClosedTabsRobot.() -> Unit): RecentlyClosedTabsRobot.Transition {
threeDotMenu().click()
mDevice.waitNotNull(
@ -424,8 +423,7 @@ class TabDrawerRobot {
return RecentlyClosedTabsRobot.Transition()
}
fun clickSaveCollection(interact: CollectionRobot.() -> Unit):
CollectionRobot.Transition {
fun clickSaveCollection(interact: CollectionRobot.() -> Unit): CollectionRobot.Transition {
saveTabsToCollectionButton().click()
CollectionRobot().interact()

@ -72,7 +72,7 @@ class CollectionCreationView(
interactor.onNewCollectionNameSaved(selectedTabs.toList(), text)
SaveCollectionStep.RenameCollection ->
selectedCollection?.let { interactor.onCollectionRenamed(it, text) }
else -> { /* noop */
else -> { // noop
}
}
}
@ -243,7 +243,7 @@ class CollectionCreationView(
}
transition.addListener(
object : Transition.TransitionListener {
override fun onTransitionStart(transition: Transition) { /* noop */
override fun onTransitionStart(transition: Transition) { // noop
}
override fun onTransitionEnd(transition: Transition) {
@ -251,13 +251,13 @@ class CollectionCreationView(
transition.removeListener(this)
}
override fun onTransitionCancel(transition: Transition) { /* noop */
override fun onTransitionCancel(transition: Transition) { // noop
}
override fun onTransitionPause(transition: Transition) { /* noop */
override fun onTransitionPause(transition: Transition) { // noop
}
override fun onTransitionResume(transition: Transition) { /* noop */
override fun onTransitionResume(transition: Transition) { // noop
}
},
)

@ -76,7 +76,7 @@ class FenixSnackbar private constructor(
companion object {
const val LENGTH_LONG = Snackbar.LENGTH_LONG
const val LENGTH_SHORT = Snackbar.LENGTH_SHORT
private const val LENGTH_ACCESSIBLE = 15000 /* 15 seconds in ms */
private const val LENGTH_ACCESSIBLE = 15000 // 15 seconds in ms
const val LENGTH_INDEFINITE = Snackbar.LENGTH_INDEFINITE
private const val minTextSize = 12

@ -106,9 +106,9 @@ class TrackingProtectionPolicyFactory(
}
}
@Suppress("MaxLineLength")
@VisibleForTesting
internal fun TrackingProtectionPolicyForSessionTypes.applyTCPIfNeeded(settings: Settings):
TrackingProtectionPolicyForSessionTypes {
internal fun TrackingProtectionPolicyForSessionTypes.applyTCPIfNeeded(settings: Settings): TrackingProtectionPolicyForSessionTypes {
val updatedCookiePolicy = if (settings.enabledTotalCookieProtection) {
CookiePolicy.ACCEPT_FIRST_PARTY_AND_ISOLATE_OTHERS
} else {

@ -15,7 +15,7 @@ import org.mozilla.fenix.library.history.History
import org.mozilla.fenix.library.history.HistoryItemTimeGroup
import org.mozilla.fenix.utils.Settings.Companion.SEARCH_GROUP_MINIMUM_SITES
private const val BUFFER_TIME = 15000 /* 15 seconds in ms */
private const val BUFFER_TIME = 15000 // 15 seconds in ms
/**
* Class representing a history entry.

@ -83,8 +83,8 @@ fun ClickableSubstringLink(
annotatedText
.getStringAnnotations("link", it, it)
.firstOrNull()?.let {
onClick()
}
onClick()
}
},
)
}

@ -69,7 +69,7 @@ class AppStartReasonProvider {
// this Runnable should execute before the first Activity is created.
reason = when (reason) {
StartReason.TO_BE_DETERMINED -> StartReason.NON_ACTIVITY
StartReason.ACTIVITY -> reason /* the start reason is already known: do nothing. */
StartReason.ACTIVITY -> reason // the start reason is already known: do nothing.
StartReason.NON_ACTIVITY -> {
Metrics.startReasonProcessError.set(true)
logger.error("AppStartReasonProvider.Process...onCreate unexpectedly called twice")
@ -87,7 +87,7 @@ class AppStartReasonProvider {
// See ProcessLifecycleObserver.onCreate for details.
reason = when (reason) {
StartReason.TO_BE_DETERMINED -> StartReason.ACTIVITY
StartReason.NON_ACTIVITY -> reason /* the start reason is already known: do nothing. */
StartReason.NON_ACTIVITY -> reason // the start reason is already known: do nothing.
StartReason.ACTIVITY -> {
Metrics.startReasonActivityError.set(true)
logger.error("AppStartReasonProvider.Activity...onCreate unexpectedly called twice")

@ -77,7 +77,7 @@ class AboutLibrariesFragment : Fragment(R.layout.fragment_about_libraries) {
[name] : either the name of the library, or its artifact name.
See https://github.com/google/play-services-plugins/tree/master/oss-licenses-plugin
*/
*/
val licensesData = resources
.openRawResource(R.raw.third_party_licenses)
.readBytes()

@ -107,6 +107,6 @@ class CookieBannerReEngagementDialog : DialogFragment() {
}
companion object {
private const val LENGTH_SNACKBAR_DURATION = 4000 /* 4 seconds in ms */
private const val LENGTH_SNACKBAR_DURATION = 4000 // 4 seconds in ms
}
}

@ -78,7 +78,7 @@ class SaveToPDFMiddleware(
* @param exception - A given exception that will be properly labeled for telemetry posting.
* @return processed failure reason to send in telemetry.
*/
/* package */ @VisibleForTesting
@VisibleForTesting // package
fun telemetryErrorReason(exception: Exception): String {
var failureMsg = "unknown"
// Requiring information from GeckoView isn't a good practice,
@ -105,7 +105,7 @@ class SaveToPDFMiddleware(
* @param isPdfViewer - If the page has a PDF viewer or not.
* @return processed page source type to send in telemetry.
*/
/* package */ @VisibleForTesting
@VisibleForTesting // package
fun telemetrySource(isPdfViewer: Boolean?): String {
val source = when (isPdfViewer) {
null -> "unknown"

@ -60,11 +60,11 @@ data class Wallpaper(
const val defaultName = "default"
/*
Note: this collection could get out of sync with the version of it generated when fetching
remote metadata. It is included mostly for convenience, but use with utmost care until
we find a better way of handling the edge cases around this collection. It is generally
safer to do comparison directly with the collection name.
*/
* Note: this collection could get out of sync with the version of it generated when fetching
* remote metadata. It is included mostly for convenience, but use with utmost care until
* we find a better way of handling the edge cases around this collection. It is generally
* safer to do comparison directly with the collection name.
*/
const val classicFirefoxCollectionName = "classic-firefox"
val ClassicFirefoxCollection = Collection(
name = classicFirefoxCollectionName,

@ -31,7 +31,7 @@ class NimbusSystemTest {
// By default this comes from the generated Nimbus features.
val config = NimbusSystem(
refreshIntervalForeground = 60, /* minutes */
refreshIntervalForeground = 60, // minutes
)
class NimbusUnderTest(override val context: Context) : NimbusInterface {

@ -4,7 +4,7 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<baseline version="1.0">
<file name="app/src/main/java/org/mozilla/fenix/home/topsites/TopSiteItemViewHolder.kt">
<error line="65" column="35" source="annotation" />
<file name="app/src/test/java/org/mozilla/fenix/home/recentvisits/view/RecentBookmarksViewHolderTest.kt">
<error line="36" column="6" source="standard:block-comment-initial-star-alignment" />
</file>
</baseline>

Loading…
Cancel
Save