Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions firefox-ios/Client.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,6 @@
5A70EF10295DFD4900790249 /* Common in Frameworks */ = {isa = PBXBuildFile; productRef = 5A70EF0F295DFD4900790249 /* Common */; };
5A70EF16295DFD9000790249 /* Common in Frameworks */ = {isa = PBXBuildFile; productRef = 5A70EF15295DFD9000790249 /* Common */; };
5A70EF19295E2E1600790249 /* DependencyHelperMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A70EF18295E2E1600790249 /* DependencyHelperMock.swift */; };
5A70EF1D295E3C3500790249 /* TestSetup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A70EF1C295E3C3500790249 /* TestSetup.swift */; };
5A70EF1F295E3DFC00790249 /* UnitTestAppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A70EF1E295E3DFC00790249 /* UnitTestAppDelegate.swift */; };
5A70EF21295E3E0B00790249 /* UnitTestSceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A70EF20295E3E0B00790249 /* UnitTestSceneDelegate.swift */; };
5A8017E029CE15D90047120D /* TabManagerImplementation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A8017DF29CE15D90047120D /* TabManagerImplementation.swift */; };
Expand Down Expand Up @@ -1350,8 +1349,8 @@
AAB4321B2E8187190075E47F /* RecentSearchProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB4321A2E8187130075E47F /* RecentSearchProvider.swift */; };
AAB4321D2E8189390075E47F /* DefaultRecentSearchProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB4321C2E8189310075E47F /* DefaultRecentSearchProviderTests.swift */; };
AAB434062E82F0600075E47F /* MockTrendingSearchProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB434052E82F05C0075E47F /* MockTrendingSearchProvider.swift */; };
AAB5B7882EE077BB0051EF6E /* TranslationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB5B7872EE077BB0051EF6E /* TranslationTests.swift */; };
AAB5AF382EDDCF600051EF6E /* MockLocaleProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB5AF372EDDCF5A0051EF6E /* MockLocaleProvider.swift */; };
AAB5B7882EE077BB0051EF6E /* TranslationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB5B7872EE077BB0051EF6E /* TranslationTests.swift */; };
AAD1CD872EAABA8100BEC90A /* TranslationsConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAD1CD862EAABA7C00BEC90A /* TranslationsConfiguration.swift */; };
AAD861A82E9E748700F6E0E0 /* TranslationSetting.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAD861A72E9E748100F6E0E0 /* TranslationSetting.swift */; };
AAD861AB2E9E75AB00F6E0E0 /* TranslationSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAD861AA2E9E75A100F6E0E0 /* TranslationSettingsViewController.swift */; };
Expand Down Expand Up @@ -8314,7 +8313,6 @@
5A64225029CB506500EEC3E5 /* TabManagerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabManagerDelegate.swift; sourceTree = "<group>"; };
5A679E4A2B239FAE004F2B0D /* TabPeekViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabPeekViewController.swift; sourceTree = "<group>"; };
5A70EF18295E2E1600790249 /* DependencyHelperMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DependencyHelperMock.swift; sourceTree = "<group>"; };
5A70EF1C295E3C3500790249 /* TestSetup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSetup.swift; sourceTree = "<group>"; };
5A70EF1E295E3DFC00790249 /* UnitTestAppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnitTestAppDelegate.swift; sourceTree = "<group>"; };
5A70EF20295E3E0B00790249 /* UnitTestSceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnitTestSceneDelegate.swift; sourceTree = "<group>"; };
5A8017DF29CE15D90047120D /* TabManagerImplementation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabManagerImplementation.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -9567,8 +9565,8 @@
AAB4321A2E8187130075E47F /* RecentSearchProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecentSearchProvider.swift; sourceTree = "<group>"; };
AAB4321C2E8189310075E47F /* DefaultRecentSearchProviderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultRecentSearchProviderTests.swift; sourceTree = "<group>"; };
AAB434052E82F05C0075E47F /* MockTrendingSearchProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockTrendingSearchProvider.swift; sourceTree = "<group>"; };
AAB5B7872EE077BB0051EF6E /* TranslationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TranslationTests.swift; sourceTree = "<group>"; };
AAB5AF372EDDCF5A0051EF6E /* MockLocaleProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockLocaleProvider.swift; sourceTree = "<group>"; };
AAB5B7872EE077BB0051EF6E /* TranslationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TranslationTests.swift; sourceTree = "<group>"; };
AAD1CD862EAABA7C00BEC90A /* TranslationsConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TranslationsConfiguration.swift; sourceTree = "<group>"; };
AAD861A72E9E748100F6E0E0 /* TranslationSetting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TranslationSetting.swift; sourceTree = "<group>"; };
AAD861AA2E9E75A100F6E0E0 /* TranslationSettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TranslationSettingsViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -13747,7 +13745,6 @@
E14BF33D2950B1230039758D /* MailProvidersTests.swift */,
E1463D032982D0240074E16E /* NotificationManagerTests.swift */,
8AEE284A276A973400C7104D /* RatingPromptManagerTests.swift */,
5A70EF1C295E3C3500790249 /* TestSetup.swift */,
);
path = Helpers;
sourceTree = "<group>";
Expand Down Expand Up @@ -14847,7 +14844,6 @@
isa = PBXGroup;
children = (
21A7C44D283539170071D996 /* IntroViewModel.swift */,
81055B552BAB7CE200E166B3 /* OnboardingMultipeChoiceButtonModel.swift */,
8C51ED6F2DE0A4D700B3E58A /* OnboardingKitCardInfoModel.swift */,
8C51ED712DE0A5B500B3E58A /* OnboardingKitViewModel.swift */,
435D660423D794B90046EFA2 /* UpdateViewModel.swift */,
Expand Down Expand Up @@ -18986,7 +18982,6 @@
8A89046D2D52874600A5BB29 /* SyncedTabCell.swift in Sources */,
8A4490952BF3C42B00E7E682 /* MicrosurveyConfirmationView.swift in Sources */,
1DA6F6512B48B42900BB5AD6 /* WindowEventCoordinator.swift in Sources */,
ED07C0E62CCACD7E006C0627 /* Locale+possibilitiesForLanguageIdentifier.swift in Sources */,
437A857827E43FE100E42764 /* FxAWebViewTelemetry.swift in Sources */,
613489A32D942A020009AF01 /* ToastTelemetry.swift in Sources */,
C7F051692DB2F38000EC52C0 /* ContextMenuPreviewViewController.swift in Sources */,
Expand Down Expand Up @@ -19459,7 +19454,6 @@
ED6D46E02D3573F80045E4ED /* TitleActivityItemProviderTests.swift in Sources */,
C736C9C72E9D7C4800658045 /* StoriesFeedStateTests.swift in Sources */,
C8501F5128510DA1003B09AB /* WallpaperMigrationUtilityTests.swift in Sources */,
5A70EF1D295E3C3500790249 /* TestSetup.swift in Sources */,
E1442FDA294782F7003680B0 /* UIPasteboard+Extension.swift in Sources */,
C2D80BEB2AAF395200CDF7A9 /* CredentialAutofillCoordinatorTests.swift in Sources */,
F98CB66E2A4123F1005F38E9 /* EnhancedTrackingProtectionMenuVMTests.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class FormAutofillHelperTests: XCTestCase {
override func setUp() async throws {
try await super.setUp()
profile = MockProfile()
DependencyHelperMock().bootstrapDependencies()
await DependencyHelperMock().bootstrapDependencies()
LegacyFeatureFlagsManager.shared.initializeDeveloperFeatures(with: profile)
tab = await Tab(profile: profile, windowUUID: windowUUID)
formAutofillHelper = FormAutofillHelper(tab: tab)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import XCTest
final class LaunchTypeTests: XCTestCase {
let windowUUID: WindowUUID = .XCTestDefaultUUID

override func setUp() {
super.setUp()
DependencyHelperMock().bootstrapDependencies()
override func setUp() async throws {
try await super.setUp()
await DependencyHelperMock().bootstrapDependencies()
}

override func tearDown() {
override func tearDown() async throws {
DependencyHelperMock().reset()
super.tearDown()
try await super.tearDown()
}

func testCanLaunch_surveyFromBrowserCoordinator() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ final class LaunchScreenViewModelTests: XCTestCase {
private var delegate: MockLaunchFinishedLoadingDelegate!
let windowUUID: WindowUUID = .XCTestDefaultUUID

override func setUp() {
super.setUp()
override func setUp() async throws {
try await super.setUp()
DependencyHelperMock().bootstrapDependencies()
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The call to DependencyHelperMock().bootstrapDependencies() is missing the await keyword. Since the bootstrapDependencies method is marked as @mainactor in DependencyHelperMock.swift and this method is already async, this call should be awaited to properly handle the async context.

Suggested change
DependencyHelperMock().bootstrapDependencies()
await DependencyHelperMock().bootstrapDependencies()

Copilot uses AI. Check for mistakes.
profile = MockProfile()
delegate = MockLaunchFinishedLoadingDelegate()
Expand All @@ -25,13 +25,13 @@ final class LaunchScreenViewModelTests: XCTestCase {
UserDefaults.standard.set(true, forKey: PrefsKeys.NimbusUserEnabledFeatureTestsOverride)
}

override func tearDown() {
override func tearDown() async throws {
AppContainer.shared.reset()
UserDefaults.standard.removeObject(forKey: PrefsKeys.NimbusUserEnabledFeatureTestsOverride)
profile = nil
messageManager = nil
delegate = nil
super.tearDown()
try await super.tearDown()
}

func testLaunchDoesntCallLoadedIfNotStarted() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ final class CreditCardSettingsViewControllerTests: XCTestCase {
var profile: MockProfile!
var viewModel: CreditCardInputViewModel!

override func setUp() {
super.setUp()
DependencyHelperMock().bootstrapDependencies()
override func setUp() async throws {
try await super.setUp()
await DependencyHelperMock().bootstrapDependencies()
profile = MockProfile()
viewModel = CreditCardInputViewModel(profile: profile, creditCardProvider: MockCreditCardProvider())
}

override func tearDown() {
super.tearDown()
override func tearDown() async throws {
try await super.tearDown()
DependencyHelperMock().reset()
profile = nil
viewModel = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import XCTest

class CustomSearchEnginesTest: XCTestCase {
let windowUUID: WindowUUID = .XCTestDefaultUUID
override func setUp() {
super.setUp()
DependencyHelperMock().bootstrapDependencies()
override func setUp() async throws {
try await super.setUp()
await DependencyHelperMock().bootstrapDependencies()
}

override func tearDown() {
override func tearDown() async throws {
AppContainer.shared.reset()
super.tearDown()
try await super.tearDown()
}

@MainActor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import Common
import Storage
@testable import Client

class DependencyHelperMock {
final class DependencyHelperMock {

@MainActor
func bootstrapDependencies(
injectedWindowManager: WindowManager? = nil,
injectedTabManager: TabManager? = nil,
Expand Down Expand Up @@ -36,32 +38,15 @@ class DependencyHelperMock {
let appSessionProvider: AppSessionProvider = AppSessionManager()
AppContainer.shared.register(service: appSessionProvider as AppSessionProvider)

// FIXME: FXIOS-13151 We need to handle main actor synchronized state in this setup method used across all unit tests
if Thread.isMainThread {
MainActor.assumeIsolated {
tabManager = injectedTabManager ?? MockTabManager()
AppContainer.shared.register(service: MockThemeManager() as ThemeManager)

let searchEnginesManager = SearchEnginesManager(
prefs: profile.prefs,
files: profile.files,
engineProvider: MockSearchEngineProvider()
)
AppContainer.shared.register(service: searchEnginesManager)
}
} else {
DispatchQueue.main.sync {
tabManager = injectedTabManager ?? MockTabManager()
AppContainer.shared.register(service: MockThemeManager() as ThemeManager)

let searchEnginesManager = SearchEnginesManager(
prefs: profile.prefs,
files: profile.files,
engineProvider: MockSearchEngineProvider()
)
AppContainer.shared.register(service: searchEnginesManager)
}
}
tabManager = injectedTabManager ?? MockTabManager()
AppContainer.shared.register(service: MockThemeManager() as ThemeManager)

let searchEnginesManager = SearchEnginesManager(
prefs: profile.prefs,
files: profile.files,
engineProvider: MockSearchEngineProvider()
)
AppContainer.shared.register(service: searchEnginesManager)

let downloadQueue = DownloadQueue()
AppContainer.shared.register(service: downloadQueue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import Common

@MainActor
class DownloadProgressManagerTests: XCTestCase {
override func setUp() {
super.setUp()
override func setUp() async throws {
try await super.setUp()
DependencyHelperMock().bootstrapDependencies()
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The call to DependencyHelperMock().bootstrapDependencies() is missing the await keyword. Since this class is annotated with @mainactor and the bootstrapDependencies method is marked as @mainactor in DependencyHelperMock.swift, this call should be awaited to properly handle the async context.

Suggested change
DependencyHelperMock().bootstrapDependencies()
await DependencyHelperMock().bootstrapDependencies()

Copilot uses AI. Check for mistakes.
}

override func tearDown() {
override func tearDown() async throws {
DependencyHelperMock().reset()
super.tearDown()
try await super.tearDown()
}

func testSingleDownloadIntialization() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ final class FirefoxAccountSignInViewControllerTests: XCTestCase {
private var mockProfile: MockProfile!
var deeplinkParams: FxALaunchParams!

override func setUp() {
super.setUp()
DependencyHelperMock().bootstrapDependencies()
override func setUp() async throws {
try await super.setUp()
await DependencyHelperMock().bootstrapDependencies()
mockProfile = MockProfile()
deeplinkParams = FxALaunchParams(entrypoint: .browserMenu, query: ["test_key": "test_value"])
}

override func tearDown() {
super.tearDown()
override func tearDown() async throws {
DependencyHelperMock().reset()
try await super.tearDown()
}

@MainActor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ class BrowserViewControllerWebViewDelegateTests: XCTestCase {
}
private lazy var allowBlockingUniversalLinksPolicy = WKNavigationActionPolicy(rawValue: allowPolicyRawValue + 2)

override func setUp() {
super.setUp()
DependencyHelperMock().bootstrapDependencies()
override func setUp() async throws {
try await super.setUp()
await DependencyHelperMock().bootstrapDependencies()
profile = MockProfile()
LegacyFeatureFlagsManager.shared.initializeDeveloperFeatures(with: profile)
tabManager = MockTabManager()
fileManager = MockFileManager()
setWebEngineIntegrationEnabled(false)
}

override func tearDown() {
override func tearDown() async throws {
profile = nil
tabManager = nil
fileManager = nil
DependencyHelperMock().reset()
super.tearDown()
try await super.tearDown()
}

@MainActor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import XCTest
@testable import Client

final class SearchEngineSelectionStateTests: XCTestCase {
override func setUp() {
super.setUp()
DependencyHelperMock().bootstrapDependencies()
override func setUp() async throws {
try await super.setUp()
await DependencyHelperMock().bootstrapDependencies()
}

override func tearDown() {
override func tearDown() async throws {
DependencyHelperMock().reset()
super.tearDown()
try await super.tearDown()
}

func testInitialization() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import Common
final class PrivateHomepageViewControllerTests: XCTestCase {
let windowUUID: WindowUUID = .XCTestDefaultUUID

override func setUp() {
super.setUp()
override func setUp() async throws {
try await super.setUp()
DependencyHelperMock().bootstrapDependencies()
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The call to DependencyHelperMock().bootstrapDependencies() is missing the await keyword. Since this class is annotated with @mainactor and the bootstrapDependencies method is marked as @mainactor in DependencyHelperMock.swift, this call should be awaited to properly handle the async context.

Suggested change
DependencyHelperMock().bootstrapDependencies()
await DependencyHelperMock().bootstrapDependencies()

Copilot uses AI. Check for mistakes.
}

override func tearDown() {
override func tearDown() async throws {
DependencyHelperMock().reset()
super.tearDown()
try await super.tearDown()
}

func testPrivateHomepageViewController_simpleCreation_hasNoLeaks() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ import XCTest
final class BookmarksSectionStateTests: XCTestCase {
private var mockProfile: MockProfile!

override func setUp() {
super.setUp()
override func setUp() async throws {
try await super.setUp()
mockProfile = MockProfile()
DependencyHelperMock().bootstrapDependencies()
await DependencyHelperMock().bootstrapDependencies()
LegacyFeatureFlagsManager.shared.initializeDeveloperFeatures(with: mockProfile)
}

override func tearDown() {
override func tearDown() async throws {
DependencyHelperMock().reset()
mockProfile = nil
super.tearDown()
try await super.tearDown()
}

func tests_initialState_returnsExpectedState() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import XCTest
@testable import Client

final class HomepageStateTests: XCTestCase {
override func setUp() {
super.setUp()
DependencyHelperMock().bootstrapDependencies()
override func setUp() async throws {
try await super.setUp()
await DependencyHelperMock().bootstrapDependencies()
}

override func tearDown() {
override func tearDown() async throws {
DependencyHelperMock().reset()
super.tearDown()
try await super.tearDown()
}

func tests_initialState_returnsExpectedState() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ import XCTest
final class JumpBackInSectionStateTests: XCTestCase {
var mockProfile: MockProfile!

override func setUp() {
super.setUp()
override func setUp() async throws {
try await super.setUp()
mockProfile = MockProfile()
DependencyHelperMock().bootstrapDependencies()
await DependencyHelperMock().bootstrapDependencies()
LegacyFeatureFlagsManager.shared.initializeDeveloperFeatures(with: MockProfile())
}

override func tearDown() {
override func tearDown() async throws {
mockProfile = nil
DependencyHelperMock().reset()
super.tearDown()
try await super.tearDown()
}

func tests_initialState_returnsExpectedState() {
Expand Down
Loading