Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into bug-1877307
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Mar 13, 2024
2 parents f2ab5c6 + c38b385 commit 5113f64
Show file tree
Hide file tree
Showing 1,119 changed files with 50,719 additions and 27,498 deletions.
2 changes: 1 addition & 1 deletion .cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
type: decision-task
treeherder-symbol: screenshots-D
target-tasks-method: screenshots
when: [{weekday: 'Monday', hour: 10, minute: 0}]
when: [] # unscheduled
- name: legacy-api-ui-tests
job:
type: decision-task
Expand Down
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: We are now using Bugzilla for issue tracking!
url: https://bugzilla.mozilla.org/enter_bug.cgi?product=Fenix
about: Please file your ticket there, and select the corresponding component from the list. If the component is not in the list, select "General". In commit messages, please reference the ticket using "Bug 1234567 - " as prefix.
3 changes: 3 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ queue_rules:
- name: default
conditions:
- status-success=complete-pr
- or:
- current-datetime<2024-03-15T00:00:00Z
- base!=main
allow_checks_interruption: false
priority_rules:
- name: high priority
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

This repository hosts the Firefox for Android (Fenix), Focus on Android, and Mozilla Android Components projects.

⚠️ This repository will soon be migrated to Mozilla Central. See the [announcement here](https://github.com/mozilla-mobile/firefox-android/wiki#upcoming-migration-to-mozilla-central).

# Firefox for Android

[![Task Status](https://firefox-ci-tc.services.mozilla.com/api/github/v1/repository/mozilla-mobile/firefox-android/main/badge.svg)](https://firefox-ci-tc.services.mozilla.com/api/github/v1/repository/mozilla-mobile/firefox-android/main/latest)
Expand Down
14 changes: 14 additions & 0 deletions android-components/.buildconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ projects:
- ui-autocomplete
- ui-colors
- ui-icons
- ui-widgets
compose-awesomebar:
description: An awesomebar component showing search results matching text entered
into the toolbar.
Expand Down Expand Up @@ -601,7 +602,9 @@ projects:
path: components/feature/autofill
publish: true
upstream_dependencies:
- browser-errorpages
- concept-base
- concept-engine
- concept-fetch
- concept-storage
- lib-fetch-okhttp
Expand Down Expand Up @@ -756,6 +759,7 @@ projects:
- ui-colors
- ui-icons
- ui-tabcounter
- ui-widgets
feature-downloads:
description: Feature implementation for apps that want to use Android downloads
manager.
Expand Down Expand Up @@ -1029,6 +1033,7 @@ projects:
- ui-colors
- ui-icons
- ui-tabcounter
- ui-widgets
feature-qr:
description: A feature that provides functionality for scanning QR codes.
path: components/feature/qr
Expand Down Expand Up @@ -1863,6 +1868,7 @@ projects:
- ui-colors
- ui-icons
- ui-tabcounter
- ui-widgets
service-contile:
description: A library to communicate with the Contile services API
path: components/service/contile
Expand Down Expand Up @@ -2261,9 +2267,17 @@ projects:
path: components/ui/widgets
publish: true
upstream_dependencies:
- browser-errorpages
- concept-base
- concept-engine
- concept-fetch
- concept-storage
- lib-publicsuffixlist
- support-base
- support-ktx
- support-test
- support-test-fakes
- support-utils
- tooling-lint
- ui-colors
- ui-icons
1 change: 1 addition & 0 deletions android-components/.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
componentsGroupId: "org.mozilla.components"

# Synchronized build configuration for all modules
jvmTargetCompatibility: 17
compileSdkVersion: 34
minSdkVersion: 21
targetSdkVersion: 34
3 changes: 0 additions & 3 deletions android-components/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ root = True
indent_size = 4
indent_style = space

# Matches maxLineLength in detekt.yml
max_line_length = 120

ij_kotlin_allow_trailing_comma_on_call_site=true
ij_kotlin_allow_trailing_comma=true

10 changes: 4 additions & 6 deletions android-components/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ subprojects {
lintChecks project(':tooling-lint')
}

kotlin {
jvmToolchain(config.jvmTargetCompatibility)
}

android {
testOptions {
unitTests {
Expand All @@ -224,13 +228,7 @@ subprojects {
ignoreAssetsPattern "manifest.template.json"
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

tasks.withType(KotlinCompile).configureEach {
kotlinOptions.jvmTarget = "17"
kotlinOptions.freeCompilerArgs += ["-opt-in=kotlin.RequiresOptIn"]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,7 @@ class GeckoEngineSession(
session: GeckoSession,
url: String?,
geckoPermissions: List<ContentPermission>,
hasUserGesture: Boolean,
) {
this@GeckoEngineSession.geckoPermissions = geckoPermissions
if (url == null) {
Expand Down Expand Up @@ -1140,7 +1141,7 @@ class GeckoEngineSession(
}
// Reset the status of current page being product or not when user navigates away.
notifyObservers { onProductUrlChange(false) }
notifyObservers { onLocationChange(url) }
notifyObservers { onLocationChange(url, hasUserGesture) }
}

override fun onLoadRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import org.mozilla.geckoview.Autocomplete
*/
fun Autocomplete.Address.toAddress() = Address(
guid = guid ?: "",
givenName = givenName,
additionalName = additionalName,
familyName = familyName,
name = name,
organization = organization,
streetAddress = streetAddress,
addressLevel3 = addressLevel3,
Expand All @@ -31,10 +29,7 @@ fun Autocomplete.Address.toAddress() = Address(
*/
fun Address.toAutocompleteAddress() = Autocomplete.Address.Builder()
.guid(guid)
.name(fullName)
.givenName(givenName)
.additionalName(additionalName)
.familyName(familyName)
.name(name)
.organization(organization)
.streetAddress(streetAddress)
.addressLevel3(addressLevel3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import mozilla.components.concept.engine.Settings
import mozilla.components.concept.engine.webextension.Action
import mozilla.components.concept.engine.webextension.ActionHandler
import mozilla.components.concept.engine.webextension.DisabledFlags
import mozilla.components.concept.engine.webextension.Incognito
import mozilla.components.concept.engine.webextension.MessageHandler
import mozilla.components.concept.engine.webextension.Metadata
import mozilla.components.concept.engine.webextension.Port
Expand Down Expand Up @@ -365,6 +366,8 @@ class GeckoWebExtension(
reviewUrl = it.reviewUrl,
version = it.version,
permissions = it.permissions.toList(),
optionalPermissions = it.optionalPermissions.toList(),
optionalOrigins = it.optionalOrigins.toList(),
// Origins is marked as @NonNull but may be null: https://bugzilla.mozilla.org/show_bug.cgi?id=1629957
hostPermissions = it.origins.orEmpty().toList(),
disabledFlags = DisabledFlags.select(it.disabledFlags),
Expand All @@ -373,6 +376,7 @@ class GeckoWebExtension(
baseUrl = it.baseUrl,
temporary = it.temporary,
detailUrl = it.amoListingUrl,
incognito = Incognito.fromString(it.incognito),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,17 @@ class GeckoEngineSessionTest {
val engineSession = GeckoEngineSession(runtime, geckoSessionProvider = geckoSessionProvider)

var observedUrl = ""
var observedUserGesture = true
var observedCanGoBack = false
var observedCanGoForward = false
var cookieBanner = CookieBannerHandlingStatus.HANDLED
var displaysProduct = false
engineSession.register(
object : EngineSession.Observer {
override fun onLocationChange(url: String) { observedUrl = url }
override fun onLocationChange(url: String, hasUserGesture: Boolean) {
observedUrl = url
observedUserGesture = hasUserGesture
}
override fun onNavigationStateChange(canGoBack: Boolean?, canGoForward: Boolean?) {
canGoBack?.let { observedCanGoBack = canGoBack }
canGoForward?.let { observedCanGoForward = canGoForward }
Expand All @@ -320,8 +324,9 @@ class GeckoEngineSessionTest {

captureDelegates()

navigationDelegate.value.onLocationChange(mock(), "http://mozilla.org", emptyList())
navigationDelegate.value.onLocationChange(mock(), "http://mozilla.org", emptyList(), false)
assertEquals("http://mozilla.org", observedUrl)
assertEquals(false, observedUserGesture)
assertEquals(CookieBannerHandlingStatus.NO_DETECTED, cookieBanner)
// TO DO: add a positive test case after a test endpoint is implemented in desktop (Bug 1846341)
assertEquals(false, displaysProduct)
Expand Down Expand Up @@ -858,22 +863,22 @@ class GeckoEngineSessionTest {
var observedUrl = ""
engineSession.register(
object : EngineSession.Observer {
override fun onLocationChange(url: String) { observedUrl = url }
override fun onLocationChange(url: String, hasUserGesture: Boolean) { observedUrl = url }
},
)

captureDelegates()

navigationDelegate.value.onLocationChange(mock(), "about:blank", emptyList())
navigationDelegate.value.onLocationChange(mock(), "about:blank", emptyList(), false)
assertEquals("", observedUrl)

navigationDelegate.value.onLocationChange(mock(), "about:blank", emptyList())
navigationDelegate.value.onLocationChange(mock(), "about:blank", emptyList(), false)
assertEquals("", observedUrl)

navigationDelegate.value.onLocationChange(mock(), "https://www.mozilla.org", emptyList())
navigationDelegate.value.onLocationChange(mock(), "https://www.mozilla.org", emptyList(), false)
assertEquals("https://www.mozilla.org", observedUrl)

navigationDelegate.value.onLocationChange(mock(), "about:blank", emptyList())
navigationDelegate.value.onLocationChange(mock(), "about:blank", emptyList(), false)
assertEquals("about:blank", observedUrl)
}

Expand All @@ -883,7 +888,7 @@ class GeckoEngineSessionTest {
captureDelegates()
assertTrue(session.initialLoad)

navigationDelegate.value.onLocationChange(mock(), "https://mozilla.org", emptyList())
navigationDelegate.value.onLocationChange(mock(), "https://mozilla.org", emptyList(), false)
assertFalse(session.initialLoad)

navigationDelegate.value.onLoadRequest(mock(), mockLoadRequest("moz-extension://1234-test"))
Expand All @@ -892,16 +897,16 @@ class GeckoEngineSessionTest {
var observedUrl = ""
session.register(
object : EngineSession.Observer {
override fun onLocationChange(url: String) { observedUrl = url }
override fun onLocationChange(url: String, hasUserGesture: Boolean) { observedUrl = url }
},
)
navigationDelegate.value.onLocationChange(mock(), "about:blank", emptyList())
navigationDelegate.value.onLocationChange(mock(), "about:blank", emptyList(), false)
assertEquals("", observedUrl)

navigationDelegate.value.onLocationChange(mock(), "https://www.mozilla.org", emptyList())
navigationDelegate.value.onLocationChange(mock(), "https://www.mozilla.org", emptyList(), false)
assertEquals("https://www.mozilla.org", observedUrl)

navigationDelegate.value.onLocationChange(mock(), "about:blank", emptyList())
navigationDelegate.value.onLocationChange(mock(), "about:blank", emptyList(), false)
assertEquals("about:blank", observedUrl)
}

Expand Down Expand Up @@ -931,10 +936,10 @@ class GeckoEngineSessionTest {
geckoResult.complete(true)

assertNull(engineSession.currentUrl)
navigationDelegate.value.onLocationChange(geckoSession, "https://www.mozilla.org", emptyList())
navigationDelegate.value.onLocationChange(geckoSession, "https://www.mozilla.org", emptyList(), false)
assertEquals("https://www.mozilla.org", engineSession.currentUrl)

navigationDelegate.value.onLocationChange(geckoSession, "https://www.firefox.com", emptyList())
navigationDelegate.value.onLocationChange(geckoSession, "https://www.firefox.com", emptyList(), false)
assertEquals("https://www.firefox.com", engineSession.currentUrl)
}

Expand All @@ -944,7 +949,7 @@ class GeckoEngineSessionTest {

captureDelegates()

navigationDelegate.value.onLocationChange(geckoSession, "https://www.mozilla.org", listOf(mock()))
navigationDelegate.value.onLocationChange(geckoSession, "https://www.mozilla.org", listOf(mock()), false)

assertTrue(engineSession.geckoPermissions.isNotEmpty())
}
Expand All @@ -955,7 +960,7 @@ class GeckoEngineSessionTest {

captureDelegates()

navigationDelegate.value.onLocationChange(geckoSession, null, listOf(mock()))
navigationDelegate.value.onLocationChange(geckoSession, null, listOf(mock()), false)

assertTrue(engineSession.geckoPermissions.isNotEmpty())
}
Expand All @@ -981,7 +986,7 @@ class GeckoEngineSessionTest {
verify(historyTrackingDelegate, never()).onTitleChanged(anyString(), anyString())

// This sets the currentUrl.
navigationDelegate.value.onLocationChange(geckoSession, "https://www.mozilla.com", emptyList())
navigationDelegate.value.onLocationChange(geckoSession, "https://www.mozilla.com", emptyList(), false)

contentDelegate.value.onTitleChange(geckoSession, "Hello World!")
verify(historyTrackingDelegate).onTitleChanged(eq("https://www.mozilla.com"), eq("Hello World!"))
Expand Down Expand Up @@ -1038,7 +1043,7 @@ class GeckoEngineSessionTest {

engineSession.register(
object : EngineSession.Observer {
override fun onLocationChange(url: String) { observedUrl = url }
override fun onLocationChange(url: String, hasUserGesture: Boolean) { observedUrl = url }
override fun onTitleChange(title: String) { observedTitle = title }
},
)
Expand Down Expand Up @@ -1072,7 +1077,7 @@ class GeckoEngineSessionTest {
),
)

navigationDelegate.value.onLocationChange(geckoSession, emptyPageUrl, emptyList())
navigationDelegate.value.onLocationChange(geckoSession, emptyPageUrl, emptyList(), false)
contentDelegate.value.onTitleChange(geckoSession, emptyPageUrl)

historyDelegate.value.onVisited(
Expand Down Expand Up @@ -1112,7 +1117,7 @@ class GeckoEngineSessionTest {
verify(historyTrackingDelegate, never()).onPreviewImageChange(anyString(), anyString())

// This sets the currentUrl.
navigationDelegate.value.onLocationChange(geckoSession, "https://www.mozilla.com", emptyList())
navigationDelegate.value.onLocationChange(geckoSession, "https://www.mozilla.com", emptyList(), false)

contentDelegate.value.onPreviewImage(geckoSession, previewImageUrl)
verify(historyTrackingDelegate).onPreviewImageChange(eq("https://www.mozilla.com"), eq(previewImageUrl))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1853,9 +1853,7 @@ class GeckoPromptDelegateTest {

val address = Address(
guid = "1",
givenName = "Firefox",
additionalName = "-",
familyName = "-",
name = "Firefox",
organization = "-",
streetAddress = "street",
addressLevel3 = "address3",
Expand Down
Loading

0 comments on commit 5113f64

Please sign in to comment.