diff --git a/Package.resolved b/Package.resolved index a55ccb2cc..0b2b63760 100644 --- a/Package.resolved +++ b/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/content-scope-scripts", "state" : { - "revision" : "7958ddab724c26326333cae13fe81478290607fa", - "version" : "7.6.0" + "revision" : "0502ed7de4130bd8705daebaca9aeb20d3e62d15", + "version" : "7.5.0" } }, { @@ -50,8 +50,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/privacy-dashboard", "state" : { - "revision" : "bea4d750913ef82c10cd06e791686501c8e648e4", - "version" : "7.6.0" + "branch" : "pr-releases/pr-302", + "revision" : "05d04de7505117b32949b2007e5a56ba2d39469b" } }, { diff --git a/Package.swift b/Package.swift index c2c04a331..9c6a8e0bf 100644 --- a/Package.swift +++ b/Package.swift @@ -55,8 +55,8 @@ let package = Package( .package(url: "https://github.com/duckduckgo/TrackerRadarKit", exact: "3.0.0"), .package(url: "https://github.com/duckduckgo/sync_crypto", exact: "0.4.0"), .package(url: "https://github.com/gumob/PunycodeSwift.git", exact: "3.0.0"), - .package(url: "https://github.com/duckduckgo/content-scope-scripts", exact: "7.6.0"), - .package(url: "https://github.com/duckduckgo/privacy-dashboard", exact: "7.6.0"), + .package(url: "https://github.com/duckduckgo/content-scope-scripts", exact: "7.5.0"), + .package(url: "https://github.com/duckduckgo/privacy-dashboard", branch: "pr-releases/pr-302"), .package(url: "https://github.com/httpswift/swifter.git", exact: "1.5.0"), .package(url: "https://github.com/duckduckgo/bloom_cpp.git", exact: "3.0.0"), .package(url: "https://github.com/1024jp/GzipSwift.git", exact: "6.0.1"), diff --git a/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift b/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift index 2d268e55d..47143df0f 100644 --- a/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift +++ b/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift @@ -48,7 +48,6 @@ public enum PrivacyFeature: String { case performanceMetrics case privacyPro case sslCertificates - case brokenSiteReportExperiment case toggleReports case maliciousSiteProtection case brokenSitePrompt diff --git a/Sources/PrivacyDashboard/PrivacyDashboardController.swift b/Sources/PrivacyDashboard/PrivacyDashboardController.swift index 7f1bc6d7c..5bc696c1e 100644 --- a/Sources/PrivacyDashboard/PrivacyDashboardController.swift +++ b/Sources/PrivacyDashboard/PrivacyDashboardController.swift @@ -40,12 +40,9 @@ public protocol PrivacyDashboardControllerDelegate: AnyObject { didRequestOpenUrlInNewTab url: URL) func privacyDashboardController(_ privacyDashboardController: PrivacyDashboardController, didRequestOpenSettings target: PrivacyDashboardOpenSettingsTarget) - func privacyDashboardController(_ privacyDashboardController: PrivacyDashboardController, - didSelectBreakageCategory category: String) func privacyDashboardController(_ privacyDashboardController: PrivacyDashboardController, didRequestSubmitBrokenSiteReportWithCategory category: String, description: String) - func privacyDashboardControllerDidRequestShowAlertForMissingDescription(_ privacyDashboardController: PrivacyDashboardController) func privacyDashboardControllerDidRequestShowGeneralFeedback(_ privacyDashboardController: PrivacyDashboardController) func privacyDashboardController(_ privacyDashboardController: PrivacyDashboardController, didRequestSubmitToggleReportWithSource source: BrokenSiteReport.Source) @@ -89,7 +86,6 @@ public protocol PrivacyDashboardControllerDelegate: AnyObject { public private(set) weak var privacyInfo: PrivacyInfo? private let entryPoint: PrivacyDashboardEntryPoint - private let variant: PrivacyDashboardVariant private let eventMapping: EventMapping weak var webView: WKWebView? @@ -103,12 +99,10 @@ public protocol PrivacyDashboardControllerDelegate: AnyObject { public init(privacyInfo: PrivacyInfo?, entryPoint: PrivacyDashboardEntryPoint, - variant: PrivacyDashboardVariant, toggleReportingManager: ToggleReportingManaging, eventMapping: EventMapping) { self.privacyInfo = privacyInfo self.entryPoint = entryPoint - self.variant = variant self.eventMapping = eventMapping self.toggleReportingManager = toggleReportingManager script = PrivacyDashboardUserScript() @@ -118,6 +112,12 @@ public protocol PrivacyDashboardControllerDelegate: AnyObject { self.webView = webView webView.navigationDelegate = self + if #available(iOS 16.4, macOS 13.3, *) { + webView.isInspectable = true + } else { + // Fallback on earlier versions + } + setupPrivacyDashboardUserScript() loadStartScreen() startToggleReportingFlowIfNeeded() @@ -141,8 +141,8 @@ public protocol PrivacyDashboardControllerDelegate: AnyObject { } private func loadStartScreen() { - let url = PrivacyDashboardURLBuilder(configuration: .startScreen(entryPoint: entryPoint, variant: variant)).build() - webView?.loadHTMLString(dashboardHtml, baseURL: url.deletingLastPathComponent()) + let url = PrivacyDashboardURLBuilder(configuration: .startScreen(entryPoint: entryPoint)).build() + webView?.loadFileURL(url, allowingReadAccessTo: url.deletingLastPathComponent().deletingLastPathComponent()) } public func updatePrivacyInfo(_ privacyInfo: PrivacyInfo?) { @@ -181,7 +181,6 @@ public protocol PrivacyDashboardControllerDelegate: AnyObject { case .dashboard: source = .dashboard case .prompt: source = .prompt case .toggleReport: source = .onProtectionsOffMenu - case .afterTogglePrompt: source = .afterTogglePrompt } if let toggleReportingSource = toggleReportingFlow?.entryPoint.source { source = toggleReportingSource @@ -335,9 +334,6 @@ extension PrivacyDashboardController: PrivacyDashboardUserScriptDelegate { } func userScript(_ userScript: PrivacyDashboardUserScript, didChangeProtectionState protectionState: ProtectionState) { - if protectionState.eventOrigin.screen == .choiceToggle { - eventMapping.fire(.toggleProtectionOff) - } if shouldSegueToToggleReportScreen(with: protectionState) { segueToToggleReportScreen(with: protectionState) } else { @@ -372,11 +368,13 @@ extension PrivacyDashboardController: PrivacyDashboardUserScriptDelegate { } func userScriptDidRequestShowReportBrokenSite(_ userScript: PrivacyDashboardUserScript) { + eventMapping.fire(.showReportBrokenSite) + } + + func userScriptDidRequestReportBrokenSiteShown(_ userScript: PrivacyDashboardUserScript) { eventMapping.fire(.reportBrokenSiteShown, parameters: [ - PrivacyDashboardEvents.Parameters.variant: variant.rawValue, PrivacyDashboardEvents.Parameters.source: source.rawValue ]) - eventMapping.fire(.showReportBrokenSite) } func userScript(_ userScript: PrivacyDashboardUserScript, setHeight height: Int) { @@ -384,11 +382,9 @@ extension PrivacyDashboardController: PrivacyDashboardUserScriptDelegate { } func userScript(_ userScript: PrivacyDashboardUserScript, didRequestSubmitBrokenSiteReportWithCategory category: String, description: String) { - var parameters = [PrivacyDashboardEvents.Parameters.variant: variant.rawValue] - if case let .afterTogglePrompt(_, didToggleProtectionsFixIssue) = entryPoint { - parameters[PrivacyDashboardEvents.Parameters.didToggleProtectionsFixIssue] = didToggleProtectionsFixIssue.description - } - eventMapping.fire(.reportBrokenSiteSent, parameters: parameters) + eventMapping.fire(.reportBrokenSiteSent, parameters: [ + PrivacyDashboardEvents.Parameters.source: source.rawValue + ]) delegate?.privacyDashboardController(self, didRequestSubmitBrokenSiteReportWithCategory: category, description: description) } @@ -410,30 +406,8 @@ extension PrivacyDashboardController: PrivacyDashboardUserScriptDelegate { toggleReportingFlow?.userScriptDidSelectReportAction(shouldSendReport: shouldSendReport) } - // MARK: - Experiment flows (soon to be removed) - - func userScript(_ userScript: PrivacyDashboardUserScript, didSelectOverallCategory category: String) { - eventMapping.fire(.overallCategorySelected, parameters: [PrivacyDashboardEvents.Parameters.category: category]) - } - - func userScript(_ userScript: PrivacyDashboardUserScript, didSelectBreakageCategory category: String) { - eventMapping.fire(.breakageCategorySelected, parameters: [ - PrivacyDashboardEvents.Parameters.variant: variant.rawValue, - PrivacyDashboardEvents.Parameters.category: category - ]) - delegate?.privacyDashboardController(self, didSelectBreakageCategory: category) - } - - func userScriptDidRequestShowAlertForMissingDescription(_ userScript: PrivacyDashboardUserScript) { - delegate?.privacyDashboardControllerDidRequestShowAlertForMissingDescription(self) - } - func userScriptDidRequestShowNativeFeedback(_ userScript: PrivacyDashboardUserScript) { delegate?.privacyDashboardControllerDidRequestShowGeneralFeedback(self) } - func userScriptDidSkipTogglingStep(_ userScript: PrivacyDashboardUserScript) { - eventMapping.fire(.skipToggleStep) - } - } diff --git a/Sources/PrivacyDashboard/PrivacyDashboardEntryPoint.swift b/Sources/PrivacyDashboard/PrivacyDashboardEntryPoint.swift index 4322eaf55..dd28591fd 100644 --- a/Sources/PrivacyDashboard/PrivacyDashboardEntryPoint.swift +++ b/Sources/PrivacyDashboard/PrivacyDashboardEntryPoint.swift @@ -33,25 +33,12 @@ public enum PrivacyDashboardEntryPoint: Equatable { /// The prompt report screen, which is triggered whenever the user taps report from the toast 'Site not working?" case prompt - /// The experimental after toggle prompt screen, presented in variant B. - /// After the user toggles off protection, this prompt asks if the action helped and allows the user to report their experience. - /// - Parameters: - /// - category: The category of the issue reported by the user. - /// - didToggleProtectionsFixIssue: A Boolean indicating whether toggling protections resolved the issue. - case afterTogglePrompt(category: String, didToggleProtectionsFixIssue: Bool) - - func screen(for variant: PrivacyDashboardVariant) -> Screen { - switch (self, variant) { - case (.dashboard, _): return .primaryScreen - - case (.report, .control): return .breakageForm - case (.report, .a): return .categorySelection - case (.report, .b): return .categoryTypeSelection - - case (.afterTogglePrompt, _): return .choiceBreakageForm - - case (.prompt, _): return .promptBreakageForm - case (.toggleReport, _): return .toggleReport + var screen: Screen { + switch self { + case .dashboard: return .primaryScreen + case .report: return .breakageForm + case .prompt: return .breakageForm + case .toggleReport: return .toggleReport } } @@ -61,8 +48,7 @@ public enum PrivacyDashboardEntryPoint: Equatable { (.dashboard, .dashboard), (.report, .report), (.toggleReport, .toggleReport), - (.prompt, .prompt), - (.afterTogglePrompt, .afterTogglePrompt): + (.prompt, .prompt): return true default: return false diff --git a/Sources/PrivacyDashboard/PrivacyDashboardEvents.swift b/Sources/PrivacyDashboard/PrivacyDashboardEvents.swift index 454313255..44888ad1e 100644 --- a/Sources/PrivacyDashboard/PrivacyDashboardEvents.swift +++ b/Sources/PrivacyDashboard/PrivacyDashboardEvents.swift @@ -22,20 +22,14 @@ public enum PrivacyDashboardEvents { public enum Parameters { - public static let variant = "variant" public static let source = "source" public static let category = "category" - public static let didToggleProtectionsFixIssue = "didToggleProtectionsFixIssue" } case showReportBrokenSite case reportBrokenSiteShown - case breakageCategorySelected case reportBrokenSiteSent - case overallCategorySelected - case skipToggleStep - case toggleProtectionOff } diff --git a/Sources/PrivacyDashboard/PrivacyDashboardURLBuilder.swift b/Sources/PrivacyDashboard/PrivacyDashboardURLBuilder.swift index 11e30afc1..1f98524f1 100644 --- a/Sources/PrivacyDashboard/PrivacyDashboardURLBuilder.swift +++ b/Sources/PrivacyDashboard/PrivacyDashboardURLBuilder.swift @@ -22,7 +22,7 @@ final class PrivacyDashboardURLBuilder { enum Configuration { - case startScreen(entryPoint: PrivacyDashboardEntryPoint, variant: PrivacyDashboardVariant) + case startScreen(entryPoint: PrivacyDashboardEntryPoint) case segueToScreen(_ screen: Screen, entryPoint: PrivacyDashboardEntryPoint) } @@ -38,31 +38,16 @@ final class PrivacyDashboardURLBuilder { func build() -> URL { url.addingScreenParameter(from: configuration) - .addingBreakageScreenParameterIfNeeded(from: configuration) - .addingCategoryParameterIfNeeded(from: configuration) .addingOpenerParameterIfNeeded(from: configuration) } } -private extension PrivacyDashboardVariant { - - var breakageScreen: BreakageScreen? { - switch self { - case .control: return nil - case .a: return .categorySelection - case .b: return .categoryTypeSelection - } - } - -} - private extension URL { private enum Constant { static let screenKey = "screen" - static let breakageScreenKey = "breakageScreen" static let openerKey = "opener" static let categoryKey = "category" @@ -74,32 +59,24 @@ private extension URL { func addingScreenParameter(from configuration: PrivacyDashboardURLBuilder.Configuration) -> URL { var screen: Screen switch configuration { - case .startScreen(let entryPoint, let variant): - screen = entryPoint.screen(for: variant) + case .startScreen(let entryPoint): + screen = entryPoint.screen case .segueToScreen(let destinationScreen, _): screen = destinationScreen } return appendingParameter(name: Constant.screenKey, value: screen.rawValue) } - func addingBreakageScreenParameterIfNeeded(from configuration: PrivacyDashboardURLBuilder.Configuration) -> URL { - if case .startScreen(_, let variant) = configuration, let breakageScreen = variant.breakageScreen?.rawValue { - return appendingParameter(name: Constant.breakageScreenKey, value: breakageScreen) - } - return self - } - - func addingCategoryParameterIfNeeded(from configuration: PrivacyDashboardURLBuilder.Configuration) -> URL { - if case .startScreen(let entryPoint, _) = configuration, case .afterTogglePrompt(let category, _) = entryPoint { - return appendingParameter(name: Constant.categoryKey, value: category) - } - return self - } - func addingOpenerParameterIfNeeded(from configuration: PrivacyDashboardURLBuilder.Configuration) -> URL { - if case .startScreen(let entryPoint, _) = configuration, case .toggleReport = entryPoint { - return appendingParameter(name: Constant.openerKey, value: Constant.menuScreenKey) + if case .startScreen(let entryPoint) = configuration { + switch entryPoint { + case .toggleReport, .report: + return appendingParameter(name: Constant.openerKey, value: Constant.menuScreenKey) + default: + break + } } + if case .segueToScreen(_, let entryPoint) = configuration, entryPoint == .dashboard { return appendingParameter(name: Constant.openerKey, value: Constant.dashboardScreenKey) } diff --git a/Sources/PrivacyDashboard/PrivacyDashboardUserScript.swift b/Sources/PrivacyDashboard/PrivacyDashboardUserScript.swift index 3fc35c46d..f00c94df6 100644 --- a/Sources/PrivacyDashboard/PrivacyDashboardUserScript.swift +++ b/Sources/PrivacyDashboard/PrivacyDashboardUserScript.swift @@ -31,6 +31,7 @@ protocol PrivacyDashboardUserScriptDelegate: AnyObject { func userScript(_ userScript: PrivacyDashboardUserScript, setHeight height: Int) func userScriptDidRequestClose(_ userScript: PrivacyDashboardUserScript) func userScriptDidRequestShowReportBrokenSite(_ userScript: PrivacyDashboardUserScript) + func userScriptDidRequestReportBrokenSiteShown(_ userScript: PrivacyDashboardUserScript) func userScript(_ userScript: PrivacyDashboardUserScript, didRequestSubmitBrokenSiteReportWithCategory category: String, description: String) func userScript(_ userScript: PrivacyDashboardUserScript, didRequestOpenUrlInNewTab: URL) func userScript(_ userScript: PrivacyDashboardUserScript, didRequestOpenSettings: String) @@ -41,11 +42,7 @@ protocol PrivacyDashboardUserScriptDelegate: AnyObject { func userScript(_ userScript: PrivacyDashboardUserScript, didSelectReportAction shouldSendReport: Bool) // Experiment flows - func userScript(_ userScript: PrivacyDashboardUserScript, didSelectOverallCategory category: String) - func userScript(_ userScript: PrivacyDashboardUserScript, didSelectBreakageCategory category: String) - func userScriptDidRequestShowAlertForMissingDescription(_ userScript: PrivacyDashboardUserScript) func userScriptDidRequestShowNativeFeedback(_ userScript: PrivacyDashboardUserScript) - func userScriptDidSkipTogglingStep(_ userScript: PrivacyDashboardUserScript) } @@ -67,14 +64,6 @@ public enum Screen: String, Decodable, CaseIterable { case choiceToggle case toggleReport - case promptBreakageForm - -} - -public enum BreakageScreen: String, Decodable { - - case categorySelection - case categoryTypeSelection } @@ -115,11 +104,11 @@ final class PrivacyDashboardUserScript: NSObject, StaticUserScript { enum MessageNames: String, CaseIterable { - case privacyDashboardTelemetrySpan case privacyDashboardSetProtection case privacyDashboardSetSize case privacyDashboardClose case privacyDashboardShowReportBrokenSite + case privacyDashboardReportBrokenSiteShown case privacyDashboardSubmitBrokenSiteReport case privacyDashboardOpenUrlInNewTab case privacyDashboardOpenSettings @@ -128,7 +117,6 @@ final class PrivacyDashboardUserScript: NSObject, StaticUserScript { case privacyDashboardGetToggleReportOptions case privacyDashboardSendToggleReport case privacyDashboardRejectToggleReport - case privacyDashboardShowAlertForMissingDescription case privacyDashboardShowNativeFeedback } @@ -157,6 +145,8 @@ final class PrivacyDashboardUserScript: NSObject, StaticUserScript { handleClose() case .privacyDashboardShowReportBrokenSite: handleShowReportBrokenSite() + case .privacyDashboardReportBrokenSiteShown: + handleReportBrokenSiteShown() case .privacyDashboardSubmitBrokenSiteReport: handleSubmitBrokenSiteReport(message: message) case .privacyDashboardOpenUrlInNewTab: @@ -173,12 +163,8 @@ final class PrivacyDashboardUserScript: NSObject, StaticUserScript { handleSendToggleReport() case .privacyDashboardRejectToggleReport: handleDoNotSendToggleReport() - case .privacyDashboardShowAlertForMissingDescription: - handleShowAlertForMissingDescription() case .privacyDashboardShowNativeFeedback: handleShowNativeFeedback() - case .privacyDashboardTelemetrySpan: - handleTelemetrySpan(message: message) } } @@ -214,6 +200,10 @@ final class PrivacyDashboardUserScript: NSObject, StaticUserScript { delegate?.userScriptDidRequestShowReportBrokenSite(self) } + private func handleReportBrokenSiteShown() { + delegate?.userScriptDidRequestReportBrokenSiteShown(self) + } + private func handleSubmitBrokenSiteReport(message: WKScriptMessage) { guard let dict = message.body as? [String: Any], let category = dict["category"] as? String, @@ -286,52 +276,10 @@ final class PrivacyDashboardUserScript: NSObject, StaticUserScript { delegate?.userScript(self, didSelectReportAction: false) } - private func handleSelectOverallCategory(message: WKScriptMessage) { - guard let dict = message.body as? [String: Any], - let category = dict["category"] as? String - else { - assertionFailure("handleSelectOverallCategory: expected { category: String }") - return - } - delegate?.userScript(self, didSelectOverallCategory: category) - } - - private func handleSelectBreakageCategory(message: WKScriptMessage) { - guard let dict = message.body as? [String: Any], - let category = dict["category"] as? String - else { - assertionFailure("handleSelectBreakageCategory: expected { category: String }") - return - } - delegate?.userScript(self, didSelectBreakageCategory: category) - } - - private func handleShowAlertForMissingDescription() { - delegate?.userScriptDidRequestShowAlertForMissingDescription(self) - } - private func handleShowNativeFeedback() { delegate?.userScriptDidRequestShowNativeFeedback(self) } - private func handleTelemetrySpan(message: WKScriptMessage) { - guard let telemetrySpan: TelemetrySpan = DecodableHelper.decode(from: message.messageBody) else { - assertionFailure("privacyDashboardTelemetrySpan: expected TelemetrySpan") - return - } - - if telemetrySpan.attributes.name == "categoryTypeSelected" { - let category = telemetrySpan.attributes.value ?? "" - delegate?.userScript(self, didSelectOverallCategory: category) - } else if telemetrySpan.attributes.name == "categorySelected" { - let category = telemetrySpan.attributes.value ?? "" - delegate?.userScript(self, didSelectBreakageCategory: category) - } else if telemetrySpan.attributes.name == "toggleSkipped" { - delegate?.userScriptDidSkipTogglingStep(self) - } - - } - // MARK: - Calls to script's JS API func setToggleReportOptions(forSite site: String, webView: WKWebView) { @@ -340,7 +288,7 @@ final class PrivacyDashboardUserScript: NSObject, StaticUserScript { atbEntry = "" #endif let js = """ - const json = { + window.onGetToggleReportOptionsResponse({ "data": [ { "id": "siteUrl", @@ -365,8 +313,7 @@ final class PrivacyDashboardUserScript: NSObject, StaticUserScript { {"id": "userRefreshCount"}, {"id": "locale"}, ] - } - window.onGetToggleReportOptionsResponse(json); + }); """ evaluate(js: js, in: webView) } diff --git a/Sources/PrivacyDashboard/PrivacyDashboardVariant.swift b/Sources/PrivacyDashboard/PrivacyDashboardVariant.swift deleted file mode 100644 index 4eb557e45..000000000 --- a/Sources/PrivacyDashboard/PrivacyDashboardVariant.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// PrivacyDashboardVariant.swift -// -// Copyright © 2024 DuckDuckGo. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -public enum PrivacyDashboardVariant: String { - - case control - case a, b - -} diff --git a/Tests/PrivacyDashboardTests/Mocks/PrivacyDashboardDelegateMock.swift b/Tests/PrivacyDashboardTests/Mocks/PrivacyDashboardDelegateMock.swift index e9378295c..d908e0d40 100644 --- a/Tests/PrivacyDashboardTests/Mocks/PrivacyDashboardDelegateMock.swift +++ b/Tests/PrivacyDashboardTests/Mocks/PrivacyDashboardDelegateMock.swift @@ -49,11 +49,9 @@ final class PrivacyDashboardDelegateMock: PrivacyDashboardControllerDelegate { func privacyDashboardController(_ privacyDashboardController: PrivacyDashboardController, didRequestOpenUrlInNewTab url: URL) {} func privacyDashboardController(_ privacyDashboardController: PrivacyDashboardController, didRequestOpenSettings target: PrivacyDashboardOpenSettingsTarget) {} - func privacyDashboardController(_ privacyDashboardController: PrivacyDashboardController, didSelectBreakageCategory category: String) {} func privacyDashboardController(_ privacyDashboardController: PrivacyDashboardController, didRequestSubmitBrokenSiteReportWithCategory category: String, description: String) {} - func privacyDashboardControllerDidRequestShowAlertForMissingDescription(_ privacyDashboardController: PrivacyDashboardController) {} func privacyDashboardControllerDidRequestShowGeneralFeedback(_ privacyDashboardController: PrivacyDashboardController) {} func privacyDashboardController(_ privacyDashboardController: PrivacyDashboardController, didSetHeight height: Int) {} func privacyDashboardController(_ privacyDashboardController: PrivacyDashboardController, diff --git a/Tests/PrivacyDashboardTests/PrivacyDashboardControllerTests.swift b/Tests/PrivacyDashboardTests/PrivacyDashboardControllerTests.swift index a3ee836fc..5f9d833b0 100644 --- a/Tests/PrivacyDashboardTests/PrivacyDashboardControllerTests.swift +++ b/Tests/PrivacyDashboardTests/PrivacyDashboardControllerTests.swift @@ -37,7 +37,6 @@ final class PrivacyDashboardControllerTests: XCTestCase { toggleReportingManagerMock = ToggleReportingManagerMock() privacyDashboardController = PrivacyDashboardController(privacyInfo: privacyInfo, entryPoint: entryPoint, - variant: .control, toggleReportingManager: toggleReportingManagerMock, eventMapping: EventMapping { _, _, _, _ in }) webView = WKWebView() @@ -51,16 +50,12 @@ final class PrivacyDashboardControllerTests: XCTestCase { let entryPoints: [PrivacyDashboardEntryPoint] = [ .dashboard, .report, - .afterTogglePrompt(category: "apple", didToggleProtectionsFixIssue: false), .toggleReport(completionHandler: { _ in }) ] for entryPoint in entryPoints { makePrivacyDashboardController(entryPoint: entryPoint) let currentURL = privacyDashboardController.webView!.url - XCTAssertEqual(currentURL?.getParameter(named: "screen"), entryPoint.screen(for: .control).rawValue) - if case .afterTogglePrompt = entryPoint { - XCTAssertEqual(currentURL?.getParameter(named: "category"), "apple") - } + XCTAssertEqual(currentURL?.getParameter(named: "screen"), entryPoint.screen.rawValue) if case .toggleReport = entryPoint { XCTAssertEqual(currentURL?.getParameter(named: "opener"), "menu") }