Skip to content

Commit

Permalink
Merge pull request #293 from fork-maintainers/upstream-sync
Browse files Browse the repository at this point in the history
Pull in changes from Mozilla Firefox 86.1.1
  • Loading branch information
interfect authored Mar 5, 2021
2 parents 4c2b9e9 + 4cd6544 commit 1da7a9f
Show file tree
Hide file tree
Showing 286 changed files with 10,340 additions and 2,463 deletions.
33 changes: 31 additions & 2 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ pull_request_rules:
merge:
method: rebase
strict: smart
- name: Release automation
- name: Release automation (Old)
conditions:
- base~=releases/.*
- base~=releases[_/].*
- author=github-actions[bot]
# Listing checks manually beause we do not have a "push complete" check yet.
- check-success=build-android-test-debug
Expand All @@ -57,3 +57,32 @@ pull_request_rules:
strict: smart
delete_head_branch:
force: false
- name: Release automation (New)
conditions:
- base~=releases[_/].*
- author=github-actions[bot]
# Listing checks manually beause we do not have a "push complete" check yet.
- check-success=build-android-test-beta
- check-success=build-android-test-debug
- check-success=build-beta-firebase
- check-success=build-debug
- check-success=build-nightly-simulation
- check-success=lint-compare-locales
- check-success=lint-detekt
- check-success=lint-ktlint
- check-success=lint-lint
- check-success=signing-android-test-beta
- check-success=signing-beta-firebase
- check-success=signing-nightly-simulation
- check-success=test-debug
- check-success=ui-test-x86-beta
- files~=(AndroidComponents.kt)
actions:
review:
type: APPROVE
message: 🚢
merge:
method: rebase
strict: smart
delete_head_branch:
force: false
17 changes: 11 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ android {
testInstrumentationRunnerArguments clearPackageData: 'true'
resValue "bool", "IS_DEBUG", "false"
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "false"
buildConfigField "String", "AMO_ACCOUNT", "\"mozilla\""
buildConfigField "String", "AMO_COLLECTION", "\"7dfae8669acc4312a65e8ba5553036\""
// This should be the "public" base URL of AMO.
buildConfigField "String", "AMO_BASE_URL", "\"https://addons.mozilla.org\""
buildConfigField "String", "AMO_COLLECTION_NAME", "\"7dfae8669acc4312a65e8ba5553036\""
buildConfigField "String", "AMO_COLLECTION_USER", "\"mozilla\""
// This should be the base URL used to call the AMO API.
buildConfigField "String", "AMO_SERVER_URL", "\"https://services.addons.mozilla.org\""
def deepLinkSchemeValue = "fenix-dev"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = [
Expand Down Expand Up @@ -131,8 +135,8 @@ android {
def deepLinkSchemeValue = "iceraven-debug"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
// Use custom default allowed addon list
buildConfigField "String", "AMO_ACCOUNT", "\"16201230\""
buildConfigField "String", "AMO_COLLECTION", "\"What-I-want-on-Fenix\""
buildConfigField "String", "AMO_COLLECTION_USER", "\"16201230\""
buildConfigField "String", "AMO_COLLECTION_NAME", "\"What-I-want-on-Fenix\""
}
forkRelease releaseTemplate >> {
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
Expand All @@ -143,8 +147,8 @@ android {
"deepLinkScheme": deepLinkSchemeValue
]
// Use custom default allowed addon list
buildConfigField "String", "AMO_ACCOUNT", "\"16201230\""
buildConfigField "String", "AMO_COLLECTION", "\"What-I-want-on-Fenix\""
buildConfigField "String", "AMO_COLLECTION_USER", "\"16201230\""
buildConfigField "String", "AMO_COLLECTION_NAME", "\"What-I-want-on-Fenix\""
}

}
Expand Down Expand Up @@ -466,6 +470,7 @@ dependencies {
implementation Deps.mozilla_browser_menu2
implementation Deps.mozilla_browser_search
implementation Deps.mozilla_browser_session
implementation Deps.mozilla_browser_session_storage
implementation Deps.mozilla_browser_state
implementation Deps.mozilla_browser_storage_sync
implementation Deps.mozilla_browser_tabstray
Expand Down
111 changes: 106 additions & 5 deletions app/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ metrics:
https://github.com/mozilla-mobile/fenix/issues/1607) the value will be
`custom`.
`source` will be: `action`, `suggestion`, `widget` or `shortcut`
`source` will be: `action`, `suggestion`, `widget`, `shortcut`, `topsite`
(depending on the source from which the search started). Also added the
`other` option for the source but it should never enter on this case.
send_in_pings:
Expand Down Expand Up @@ -2206,6 +2206,36 @@ reader_mode:
- [email protected]
expires: "2021-08-01"

tabs_tray.cfr:
dismiss:
type: event
description: |
A user dismisses the tabs tray CFR.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/16485
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/17442
- https://github.com/mozilla-mobile/fenix/issues/16485#issuecomment-759641324
data_sensitivity:
- interaction
notification_emails:
- [email protected]
expires: "2021-08-01"
go_to_settings:
type: event
description: |
A user selects the CFR option to navigate to settings.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/16485
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/17442
- https://github.com/mozilla-mobile/fenix/issues/16485#issuecomment-759641324
data_sensitivity:
- interaction
notification_emails:
- [email protected]
expires: "2021-08-01"

tabs_tray:
opened:
type: event
Expand Down Expand Up @@ -3385,6 +3415,19 @@ top_sites:
notification_emails:
- [email protected]
expires: "2021-08-01"
open_google_search_attribution:
type: event
description: |
A user opened the google top site
bugs:
- https://github.com/mozilla-mobile/fenix/issues/17418
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/17637
data_sensitivity:
- interaction
notification_emails:
- [email protected]
expires: "2021-08-01"
open_frecency:
type: event
description: |
Expand Down Expand Up @@ -4075,14 +4118,15 @@ storage.stats:
- https://github.com/mozilla-mobile/fenix/issues/12802
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/12876#issuecomment-666770732
- https://github.com/mozilla-mobile/fenix/pull/17704#issue-564299127
data_sensitivity:
- technical
- interaction
notification_emails:
- [email protected]
- [email protected]
- [email protected]
expires: "2021-02-01"
expires: "2021-08-01"
app_bytes:
send_in_pings:
- metrics
Expand All @@ -4099,14 +4143,15 @@ storage.stats:
- https://github.com/mozilla-mobile/fenix/issues/12802
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/12876#issuecomment-666770732
- https://github.com/mozilla-mobile/fenix/pull/17704#issue-564299127
data_sensitivity:
- technical
- interaction
notification_emails:
- [email protected]
- [email protected]
- [email protected]
expires: "2021-02-01"
expires: "2021-08-01"
cache_bytes:
send_in_pings:
- metrics
Expand All @@ -4120,14 +4165,15 @@ storage.stats:
- https://github.com/mozilla-mobile/fenix/issues/12802
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/12876#issuecomment-666770732
- https://github.com/mozilla-mobile/fenix/pull/17704#issue-564299127
data_sensitivity:
- technical
- interaction
notification_emails:
- [email protected]
- [email protected]
- [email protected]
expires: "2021-02-01"
expires: "2021-08-01"
data_dir_bytes:
send_in_pings:
- metrics
Expand All @@ -4143,14 +4189,15 @@ storage.stats:
- https://github.com/mozilla-mobile/fenix/issues/12802
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/12876#issuecomment-666770732
- https://github.com/mozilla-mobile/fenix/pull/17704#issue-564299127
data_sensitivity:
- technical
- interaction
notification_emails:
- [email protected]
- [email protected]
- [email protected]
expires: "2021-02-01"
expires: "2021-08-01"

progressive_web_app:
homescreen_tap:
Expand Down Expand Up @@ -4260,3 +4307,57 @@ tabs:
notification_emails:
- [email protected]
expires: "2021-08-01"

contextual_menu:
copy_tapped:
type: event
description: |
The context menu's 'copy' option was used.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/11580
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/16968
data_sensitivity:
- interaction
notification_emails:
- [email protected]
expires: "2021-06-01"
search_tapped:
type: event
description: |
The context menu's 'search' option was used.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/11580
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/16968
data_sensitivity:
- interaction
notification_emails:
- [email protected]
expires: "2021-06-01"
select_all_tapped:
type: event
description: |
The context menu's 'select all' option was used.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/11580
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/16968
data_sensitivity:
- interaction
notification_emails:
- [email protected]
expires: "2021-06-01"
share_tapped:
type: event
description: |
The context menu's 'share' option was used.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/11580
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/16968
data_sensitivity:
- interaction
notification_emails:
- [email protected]
expires: "2021-06-01"
1 change: 1 addition & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
####################################################################################################
-assumenosideeffects class android.util.Log {
public static boolean isLoggable(java.lang.String, int);
public static int v(...);
public static int d(...);
}

Expand Down
7 changes: 6 additions & 1 deletion app/src/androidTest/assets/pages/download.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<html>
<body>
<a href="../resources/Globe.svg" download>Page content: Globe.svg</a>
<a id="link" href="../resources/Globe.svg" download>Page content: Globe.svg</a>
<script>
(function() {
document.getElementById("link").click()
})();
</script>
</body>
</html>
18 changes: 18 additions & 0 deletions app/src/androidTest/java/org/mozilla/fenix/helpers/TestHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.os.Environment
import androidx.preference.PreferenceManager
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.ViewAction
Expand All @@ -25,11 +26,13 @@ import androidx.test.uiautomator.By
import androidx.test.uiautomator.UiScrollable
import androidx.test.uiautomator.UiSelector
import androidx.test.uiautomator.Until
import kotlinx.coroutines.runBlocking
import org.hamcrest.CoreMatchers
import org.hamcrest.CoreMatchers.allOf
import org.mozilla.fenix.R
import org.mozilla.fenix.helpers.ext.waitNotNull
import org.mozilla.fenix.ui.robots.mDevice
import java.io.File

object TestHelper {

Expand Down Expand Up @@ -120,4 +123,19 @@ object TestHelper {
0
)
}

// Remove test file from the device Downloads folder
@Suppress("Deprecation")
fun deleteDownloadFromStorage(fileName: String) {
runBlocking {
val downloadedFile = File(
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS),
fileName
)

if (downloadedFile.exists()) {
downloadedFile.delete()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ private const val EXPECTED_RUNBLOCKING_COUNT = 2
private const val EXPECTED_COMPONENT_INIT_COUNT = 42
private const val EXPECTED_VIEW_HIERARCHY_DEPTH = 12
private const val EXPECTED_RECYCLER_VIEW_CONSTRAINT_LAYOUT_CHILDREN = 4
private const val EXPECTED_NUMBER_OF_INFLATION = 12

private val failureMsgStrictMode = getErrorMessage(
shortName = "StrictMode suppression",
Expand Down Expand Up @@ -54,6 +55,11 @@ private val failureMsgRecyclerViewConstraintLayoutChildren = getErrorMessage(
) + "Please note that we're not sure if this is a useful metric to assert: with your feedback, " +
"we'll find out over time if it is or is not."

private val failureMsgNumberOfInflation = getErrorMessage(
shortName = "Number of inflation on start up doesn't match expected count",
implications = "The number of inflation can negatively impact start up time. Having more inflations" +
"will most likely mean we're adding extra work on the UI thread."
)
/**
* A performance test to limit the number of StrictMode suppressions and number of runBlocking used
* on startup.
Expand Down Expand Up @@ -90,6 +96,8 @@ class StartupExcessiveResourceUseTest {
val actualViewHierarchyDepth = countAndLogViewHierarchyDepth(rootView, 1)
val actualRecyclerViewConstraintLayoutChildren = countRecyclerViewConstraintLayoutChildren(rootView, null)

val actualNumberOfInflations = InflationCounter.inflationCount.get()

assertEquals(failureMsgStrictMode, EXPECTED_SUPPRESSION_COUNT, actualSuppresionCount)
assertEquals(failureMsgRunBlocking, EXPECTED_RUNBLOCKING_COUNT, actualRunBlocking)
assertEquals(failureMsgComponentInit, EXPECTED_COMPONENT_INIT_COUNT, actualComponentInitCount)
Expand All @@ -99,6 +107,7 @@ class StartupExcessiveResourceUseTest {
EXPECTED_RECYCLER_VIEW_CONSTRAINT_LAYOUT_CHILDREN,
actualRecyclerViewConstraintLayoutChildren
)
assertEquals(failureMsgNumberOfInflation, EXPECTED_NUMBER_OF_INFLATION, actualNumberOfInflations)
}
}

Expand Down
Loading

0 comments on commit 1da7a9f

Please sign in to comment.