Skip to content

Commit

Permalink
Adding conditional import of MozillaAppServices where needed, and rem…
Browse files Browse the repository at this point in the history
…oving some unneeded test setup
  • Loading branch information
travis79 committed Jun 23, 2022
1 parent 2ebfcf1 commit a7f92f6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 29 deletions.
4 changes: 3 additions & 1 deletion components/logins/ios/Logins/LoginsStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import Foundation
import Glean
import UIKit
#if canImport(MozillaRustComponents)
import MozillaRustComponents
#endif

typealias LoginsStoreError = LoginsStorageError

Expand Down
4 changes: 3 additions & 1 deletion components/nimbus/ios/Nimbus/GleanPlumbHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import Foundation
import Glean
#if canImport(MozillaRustComponents)
import MozillaRustComponents
#endif

/**
* Instances of this class are useful for implementing a messaging service based upon
Expand Down
4 changes: 3 additions & 1 deletion components/nimbus/ios/Nimbus/Nimbus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import Foundation
import Glean
#if canImport(MozillaRustComponents)
import MozillaRustComponents
#endif

public class Nimbus: NimbusApi {
private let nimbusClient: NimbusClientProtocol
Expand Down
4 changes: 3 additions & 1 deletion components/nimbus/ios/Nimbus/NimbusApi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import Foundation
import Glean
#if canImport(MozillaRustComponents)
import MozillaRustComponents
#endif

/// This is the main experiments API, which is exposed through the global [Nimbus] object.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,10 @@

@testable import MozillaTestServices

import Glean
import UIKit
import XCTest

class NimbusTests: XCTestCase {
override func setUp() {
Glean.shared.resetGlean(clearStores: true)
Glean.shared.enableTestingMode()
let buildDate = DateComponents(
calendar: Calendar.current,
timeZone: TimeZone(abbreviation: "UTC"),
year: 2019,
month: 10,
day: 23,
hour: 12,
minute: 52,
second: 8
)
let buildInfo = BuildInfo(buildDate: buildDate)
Glean.shared.initialize(
uploadEnabled: true,
configuration: Configuration(
channel: "test",
serverEndpoint: "https://example.com"
),
buildInfo: buildInfo
)
}

func emptyExperimentJSON() -> String {
return """
{ "data": [] }
Expand Down

0 comments on commit a7f92f6

Please sign in to comment.