Skip to content

Commit

Permalink
Merge remote-tracking branch 'mozilla/main' into ih/FXIOS-9833-favico…
Browse files Browse the repository at this point in the history
…ns-cachekey-non-optional-refactor

# Conflicts:
#	BrowserKit/Sources/SiteImageView/FaviconURLProcessing/FaviconURLHandler.swift
#	BrowserKit/Sources/SiteImageView/ImageProcessing/ImageHandler.swift
#	BrowserKit/Sources/SiteImageView/SiteImageHandler.swift
#	BrowserKit/Tests/SiteImageViewTests/ImageProcessing/ImageHandlerTests.swift
#	firefox-ios/Client/TabManagement/Tab.swift
#	firefox-ios/Storage/DefaultSuggestedSites.swift
  • Loading branch information
ih-codes committed Aug 29, 2024
2 parents 1d0919c + eb617dc commit fbaf5e9
Show file tree
Hide file tree
Showing 722 changed files with 12,479 additions and 3,031 deletions.
178 changes: 91 additions & 87 deletions .github/workflows/firefox-ios-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ jobs:
-scheme ${{ env.xcodebuild_scheme }} \
-target ${{ env.xcodebuild_target }} \
-derivedDataPath ~/DerivedData \
-destination 'platform=iOS Simulator,name=${{ env.ios_simulator_default }},OS=${{ env.ios_version }}'
-destination 'platform=iOS Simulator,name=${{ env.ios_simulator_default }},OS=${{ env.ios_version }}' \
COMPILER_INDEX_STORE_ENABLE=NO CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO ARCHS="arm64"
working-directory: ${{ env.browser }}
- name: Compress Derived Data
id: compress-dd
Expand All @@ -61,7 +62,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ios_simulator: ['iPhone 15 Plus']
ios_simulator: ['iPhone 15 Plus', 'iPad Pro 13-inch (M4)']
steps:
- name: Check out source code
uses: actions/[email protected]
Expand All @@ -70,7 +71,7 @@ jobs:
run: |
gem install xcpretty -v 0.3.0
pip install blockkit==1.9.1
npm install -g [email protected]
npm install -g [email protected]
- name: Setup Xcode
id: xcode
run: |
Expand Down Expand Up @@ -99,7 +100,7 @@ jobs:
-destination 'platform=iOS Simulator,name=${{ matrix.ios_simulator }},OS=${{ env.ios_version }}' \
-testPlan Smoketest1 \
-resultBundlePath ${{ env.test_results_directory }}/results-smoketest1 \
| tee xcodebuild.log | xcpretty -r junit --output ./junit-smoketest1.xml && exit ${PIPESTATUS[0]}
| tee xcodebuild-smoketest1.log | xcpretty -r junit --output ./junit-smoketest1.xml && exit ${PIPESTATUS[0]}
working-directory: ${{ env.browser }}
continue-on-error: true
- name: Run Smoketest2
Expand All @@ -113,7 +114,7 @@ jobs:
-destination 'platform=iOS Simulator,name=${{ matrix.ios_simulator }},OS=${{ env.ios_version }}' \
-testPlan Smoketest2 \
-resultBundlePath ${{ env.test_results_directory }}/results-smoketest2 \
| tee xcodebuild.log | xcpretty -r junit --output ./junit-smoketest2.xml && exit ${PIPESTATUS[0]}
| tee xcodebuild-smoketest2.log | xcpretty -r junit --output ./junit-smoketest2.xml && exit ${PIPESTATUS[0]}
working-directory: ${{ env.browser }}
continue-on-error: true
- name: Run Smoketest3
Expand All @@ -127,7 +128,7 @@ jobs:
-destination 'platform=iOS Simulator,name=${{ matrix.ios_simulator }},OS=${{ env.ios_version }}' \
-testPlan Smoketest3 \
-resultBundlePath ${{ env.test_results_directory }}/results-smoketest3 \
| tee xcodebuild.log | xcpretty -r junit --output ./junit-smoketest3.xml && exit ${PIPESTATUS[0]}
| tee xcodebuild-smoketest3.log | xcpretty -r junit --output ./junit-smoketest3.xml && exit ${PIPESTATUS[0]}
working-directory: ${{ env.browser }}
continue-on-error: true
- name: Run Smoketest4
Expand All @@ -141,7 +142,7 @@ jobs:
-destination 'platform=iOS Simulator,name=${{ matrix.ios_simulator }},OS=${{ env.ios_version }}' \
-testPlan Smoketest4 \
-resultBundlePath ${{ env.test_results_directory }}/results-smoketest4 \
| tee xcodebuild.log | xcpretty -r junit --output ./junit-smoketest4.xml && exit ${PIPESTATUS[0]}
| tee xcodebuild-smoketest4.log | xcpretty -r junit --output ./junit-smoketest4.xml && exit ${PIPESTATUS[0]}
working-directory: ${{ env.browser }}
continue-on-error: true
- name: Determine pass/fail status
Expand All @@ -167,20 +168,21 @@ jobs:
python ../test-fixtures/ci/convert_junit_to_markdown.py --smoke --github --${{ env.browser }} ./combined.xml ./github.md
cat github.md >> $GITHUB_STEP_SUMMARY
python ../test-fixtures/ci/convert_junit_to_markdown.py --smoke --slack --${{ env.browser }} ./combined.xml ./slack.json
mv ./combined.xml "junit-smoketests-${{ matrix.ios_simulator }}-`date +"%Y-%m-%d"`.xml"
working-directory: ${{ env.browser }}
- name: Upload junit files
id: upload-junit
uses: actions/[email protected]
with:
name: ${{ env.browser }}-smoketests-${{ matrix.ios_simulator }}-junit-${{ github.run_number }}
path: ${{ env.browser }}/junit-*.xml
path: ${{ env.browser }}/junit-smoketests-*.xml
retention-days: 90
- name: Upload log file
id: upload-log
uses: actions/[email protected]
with:
name: ${{ env.browser }}-smoketests-${{ matrix.ios_simulator }}-xcodebuildlog-${{ github.run_number }}
path: ${{ env.browser }}/xcodebuild.log
path: ${{ env.browser }}/xcodebuild-smoketest*.log
retention-days: 90
- name: Report to Slack
id: slack
Expand All @@ -203,81 +205,83 @@ jobs:
exit ${{ steps.passfail.outcome == 'success' && '0' || '1' }}
run-fullfunctionaltests:
name: Run full functional tests
runs-on: macos-14
needs: compile
strategy:
fail-fast: false
matrix:
ios_simulator: ['iPhone 15 Plus']
steps:
- name: Check out source code
uses: actions/[email protected]
- name: Install packages
id: packages
run: |
gem install xcpretty -v 0.3.0
pip install blockkit==1.9.1
- name: Get derived data
id: download-derived-data
uses: actions/download-artifact@v4
with:
name: xcode-cache-deriveddata-${{ github.workflow }}-${{ github.sha }}
- name: Decompress derived data
id: decompress-dd
run: |
tar xzf derived-data.tar.gz -C /
- name: Run tests
id: run-tests
run: |
xcodebuild \
test-without-building \
-scheme ${{ env.xcodebuild_scheme }} \
-target ${{ env.xcodebuild_target }} \
-derivedDataPath ~/DerivedData \
-destination 'platform=iOS Simulator,name=${{ matrix.ios_simulator }},OS=${{ env.ios_version }}' \
-testPlan FullFunctionalTestPlan \
-resultBundlePath ${{ env.test_results_directory }}/results \
| tee xcodebuild.log | xcpretty -r junit && exit ${PIPESTATUS[0]}
working-directory: ${{ env.browser }}
continue-on-error: true
- name: Print test report
id: test-report
run: |
python ../test-fixtures/ci/convert_junit_to_markdown.py --github --${{ env.browser }} ./build/reports/junit.xml ./github.md
cat github.md >> $GITHUB_STEP_SUMMARY
python ../test-fixtures/ci/convert_junit_to_markdown.py --slack --${{ env.browser }} ./build/reports/junit.xml ./slack.json
working-directory: ${{ env.browser }}
- name: Upload junit files
id: upload-junit
uses: actions/[email protected]
with:
name: ${{ env.browser }}-fullfunctional-${{ matrix.ios_simulator }}-junit-${{ github.run_number }}
path: ${{ env.browser }}/junit-*.xml
retention-days: 90
- name: Upload log file
id: upload-log
uses: actions/[email protected]
with:
name: ${{ env.browser }}-fullfunctional-${{ matrix.ios_simulator }}-xcodebuildlog-${{ github.run_number }}
path: ${{ env.browser }}/xcodebuild.log
retention-days: 90
- name: Report to Slack
id: slack
uses: slackapi/[email protected]
with:
payload-file-path: ${{ env.browser }}/slack.json
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
ios_simulator: ${{ matrix.ios_simulator }}
pass_fail: ${{ steps.run-tests.outcome == 'success' && ':white_check_mark:' || ':x:' }}
xcodebuild_test_plan: FullFunctionalTestPlan
ref_name: ${{ github.ref_name }}
repository: ${{ github.repository }}
run_id: ${{ github.run_id }}
server_url: ${{ github.server_url }}
sha: ${{ github.sha }}
- name: Return fail status if a test fails
run: |
exit ${{ steps.run-tests.outcome == 'success' && '0' || '1' }}
name: Run full functional tests
runs-on: macos-14
needs: compile
strategy:
fail-fast: false
matrix:
ios_simulator: ['iPhone 15 Pro Max']
steps:
- name: Check out source code
uses: actions/[email protected]
- name: Install packages
id: packages
run: |
gem install xcpretty -v 0.3.0
pip install blockkit==1.9.1
- name: Get derived data
id: download-derived-data
uses: actions/download-artifact@v4
with:
name: xcode-cache-deriveddata-${{ github.workflow }}-${{ github.sha }}
- name: Decompress derived data
id: decompress-dd
run: |
tar xzf derived-data.tar.gz -C /
- name: Run tests
id: run-tests
run: |
xcrun simctl boot '${{ matrix.ios_simulator }}'
xcodebuild \
test-without-building \
-scheme ${{ env.xcodebuild_scheme }} \
-target ${{ env.xcodebuild_target }} \
-derivedDataPath ~/DerivedData \
-destination 'platform=iOS Simulator,name=${{ matrix.ios_simulator }},OS=${{ env.ios_version }}' \
-testPlan FullFunctionalTestPlan \
-resultBundlePath ${{ env.test_results_directory }}/results \
| tee xcodebuild.log | xcpretty -r junit && exit ${PIPESTATUS[0]}
working-directory: ${{ env.browser }}
continue-on-error: true
- name: Print test report
id: test-report
run: |
python ../test-fixtures/ci/convert_junit_to_markdown.py --github --${{ env.browser }} ./build/reports/junit.xml ./github.md
cat github.md >> $GITHUB_STEP_SUMMARY
python ../test-fixtures/ci/convert_junit_to_markdown.py --slack --${{ env.browser }} ./build/reports/junit.xml ./slack.json
mv ./build/reports/junit.xml "junit-fullfunctional-${{ matrix.ios_simulator }}-`date +"%Y-%m-%d"`.xml"
working-directory: ${{ env.browser }}
- name: Upload junit files
id: upload-junit
uses: actions/[email protected]
with:
name: ${{ env.browser }}-fullfunctional-${{ matrix.ios_simulator }}-junit-${{ github.run_number }}
path: ${{ env.browser }}/junit-*.xml
retention-days: 90
- name: Upload log file
id: upload-log
uses: actions/[email protected]
with:
name: ${{ env.browser }}-fullfunctional-${{ matrix.ios_simulator }}-xcodebuildlog-${{ github.run_number }}
path: ${{ env.browser }}/xcodebuild.log
retention-days: 90
- name: Report to Slack
id: slack
uses: slackapi/[email protected]
with:
payload-file-path: ${{ env.browser }}/slack.json
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
ios_simulator: ${{ matrix.ios_simulator }}
pass_fail: ${{ steps.run-tests.outcome == 'success' && ':white_check_mark:' || ':x:' }}
xcodebuild_test_plan: FullFunctionalTestPlan
ref_name: ${{ github.ref_name }}
repository: ${{ github.repository }}
run_id: ${{ github.run_id }}
server_url: ${{ github.server_url }}
sha: ${{ github.sha }}
- name: Return fail status if a test fails
run: |
exit ${{ steps.run-tests.outcome == 'success' && '0' || '1' }}
2 changes: 2 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ only_rules: # Only enforce these rules, ignore all others
- vertical_whitespace_closing_braces
- vertical_whitespace_opening_braces
- yoda_condition
- accessibility_label_for_image
- accessibility_trait_for_button

# These rules were originally opted into. Disabling for now to get
# Swiftlint up and running.
Expand Down
2 changes: 1 addition & 1 deletion .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ tasks:
$if: >
tasks_for in ["action", "cron"]
|| (isPullRequest && pullRequestAction in ["opened", "reopened", "synchronize"])
|| (tasks_for == "github-push" && (short_head_branch == "main" || short_head_branch[:8] == "releases"))
|| (tasks_for == "github-push" && short_head_branch == "main")
|| (tasks_for == "github-release" && releaseAction == "published")
then:
taskId:
Expand Down
4 changes: 2 additions & 2 deletions BrowserKit/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/getsentry/sentry-cocoa.git",
"state" : {
"revision" : "38f4f70d07117b9f958a76b1bff278c2f29ffe0e",
"version" : "8.21.0"
"revision" : "d2ced2d961b34573ebd2ea0567a2f1408e90f0ae",
"version" : "8.34.0"
}
},
{
Expand Down
12 changes: 11 additions & 1 deletion BrowserKit/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ let package = Package(
.library(
name: "ToolbarKit",
targets: ["ToolbarKit"]),
.library(
name: "MenuKit",
targets: ["MenuKit"]),
.library(
name: "ContentBlockingGenerator",
targets: ["ContentBlockingGenerator"]),
Expand All @@ -52,7 +55,7 @@ let package = Package(
exact: "2.0.0"),
.package(
url: "https://github.com/getsentry/sentry-cocoa.git",
exact: "8.21.0"),
exact: "8.34.0"),
.package(url: "https://github.com/nbhasin2/GCDWebServer.git",
branch: "master")
],
Expand Down Expand Up @@ -109,6 +112,13 @@ let package = Package(
.testTarget(
name: "ToolbarKitTests",
dependencies: ["ToolbarKit"]),
.target(
name: "MenuKit",
dependencies: ["Common"],
swiftSettings: [.unsafeFlags(["-enable-testing"])]),
.testTarget(
name: "MenuKitTests",
dependencies: ["MenuKit"]),
.target(
name: "ContentBlockingGenerator",
swiftSettings: [.unsafeFlags(["-enable-testing"])]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Foundation
public struct StandardImageIdentifiers {
// Icon size 16x16
public struct Small {
public static let externalLink = "externalLinkSmall"
public static let notificationDot = "notificationDotSmall"
public static let notificationDotFill = "notificationDotFillSmall"
public static let pinBadgeFill = "pinBadgeFillSmall"
Expand Down Expand Up @@ -95,7 +96,7 @@ public struct StandardImageIdentifiers {
public static let readingListAdd = "readingListAddLarge"
public static let search = "searchLarge"
public static let settings = "settingsLarge"
public static let shareApple = "shareAppleLarge"
public static let share = "shareLarge"
public static let shield = "shieldLarge"
public static let shieldSlash = "shieldSlashLarge"
public static let shipping = "shippingLarge"
Expand Down
12 changes: 12 additions & 0 deletions BrowserKit/Sources/Common/Extensions/StringExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@ extension StringProtocol {
return replacingOccurrences(of: target, with: "")
}
}

public extension String {
/// Returns a new string made by removing the leading String characters contained
/// in a given character set.
func stringByTrimmingLeadingCharactersInSet(_ set: CharacterSet) -> String {
var trimmed = self
while trimmed.rangeOfCharacter(from: set)?.lowerBound == trimmed.startIndex {
trimmed.remove(at: trimmed.startIndex)
}
return trimmed
}
}
1 change: 1 addition & 0 deletions BrowserKit/Sources/Common/Theming/DarkTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ private struct DarkColourPalette: ThemeColourPalette {
var layerConfirmation: UIColor = FXColors.Green80
var layerWarning: UIColor = FXColors.Yellow70.withAlphaComponent(0.77)
var layerError: UIColor = FXColors.Pink80
var layerSelectedText: UIColor = FXColors.LightGrey05.withAlphaComponent(0.34)
var layerSearch: UIColor = FXColors.DarkGrey80
var layerGradientURL = Gradient(colors: [
FXColors.DarkGrey80.withAlphaComponent(0),
Expand Down
1 change: 1 addition & 0 deletions BrowserKit/Sources/Common/Theming/LightTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ private struct LightColourPalette: ThemeColourPalette {
var layerConfirmation: UIColor = FXColors.Green20
var layerWarning: UIColor = FXColors.Yellow20
var layerError: UIColor = FXColors.Red10
var layerSelectedText: UIColor = FXColors.DarkGrey05.withAlphaComponent(0.73)
var layerSearch: UIColor = FXColors.LightGrey30
var layerGradientURL = Gradient(colors: [
FXColors.LightGrey30.withAlphaComponent(0),
Expand Down
1 change: 1 addition & 0 deletions BrowserKit/Sources/Common/Theming/PrivateModeTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ private struct PrivateModeColorPalette: ThemeColourPalette {
var layerConfirmation: UIColor = FXColors.Green80
var layerWarning: UIColor = FXColors.Yellow70.withAlphaComponent(0.77)
var layerError: UIColor = FXColors.Pink80
var layerSelectedText: UIColor = FXColors.Violet60
var layerSearch: UIColor = FXColors.Ink90
var layerGradientURL = Gradient(colors: [
FXColors.Ink90.withAlphaComponent(0),
Expand Down
1 change: 1 addition & 0 deletions BrowserKit/Sources/Common/Theming/ThemeColourPalette.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public protocol ThemeColourPalette {
var layerConfirmation: UIColor { get }
var layerWarning: UIColor { get }
var layerError: UIColor { get }
var layerSelectedText: UIColor { get }
var layerSearch: UIColor { get }
var layerGradientURL: Gradient { get }

Expand Down
Loading

0 comments on commit fbaf5e9

Please sign in to comment.