diff --git a/DuckDuckGo/DuckPlayer/YoutubeOverlayUserScript.swift b/DuckDuckGo/DuckPlayer/YoutubeOverlayUserScript.swift index 951d041a13..1ec899ca54 100644 --- a/DuckDuckGo/DuckPlayer/YoutubeOverlayUserScript.swift +++ b/DuckDuckGo/DuckPlayer/YoutubeOverlayUserScript.swift @@ -76,6 +76,7 @@ final class YoutubeOverlayUserScript: NSObject, Subfeature { static let openDuckPlayer = "openDuckPlayer" static let sendDuckPlayerPixel = "sendDuckPlayerPixel" static let initialSetup = "initialSetup" + static let openInfo = "openInfo" } weak var broker: UserScriptMessageBroker? @@ -108,6 +109,8 @@ final class YoutubeOverlayUserScript: NSObject, Subfeature { return handleSendJSPixel case Handlers.initialSetup: return duckPlayer.initialSetupOverlay + case Handlers.openInfo: + return duckPlayer.openDuckPlayerInfo default: assertionFailure("YoutubeOverlayUserScript: Failed to parse User Script message: \(methodName)") // TODO: Send pixel here diff --git a/DuckDuckGoTests/YoutublePlayerNavigationHandlerTests.swift b/DuckDuckGoTests/YoutublePlayerNavigationHandlerTests.swift index 2b19d9b41d..1bf0672f35 100644 --- a/DuckDuckGoTests/YoutublePlayerNavigationHandlerTests.swift +++ b/DuckDuckGoTests/YoutublePlayerNavigationHandlerTests.swift @@ -100,6 +100,7 @@ class DuckPlayerNavigationHandlerTests: XCTestCase { // MARK: - Decide policyFor Tests + @MainActor func testDecidePolicyForVideoWasAlreadyHandled() { @@ -108,7 +109,7 @@ class DuckPlayerNavigationHandlerTests: XCTestCase { let expectation = self.expectation(description: "Completion handler called") let playerSettings = MockDuckPlayerSettings(appSettings: mockAppSettings, privacyConfigManager: mockPrivacyConfig) let player = MockDuckPlayer(settings: playerSettings) - let handler = DuckPlayerNavigationHandler(duckPlayer: player) + let handler = DuckPlayerNavigationHandler(duckPlayer: player, featureFlagger: featureFlagger) var navigationPolicy: WKNavigationActionPolicy? handler.lastHandledVideoID = "abc123"