This repository was archived by the owner on Feb 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 436
tds override #3805
Merged
Merged
tds override #3805
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
441954b
implement tds experiment override
SabrinaTardio cdaef8d
use log
SabrinaTardio c5ad821
move managers to initialiser
SabrinaTardio 2afd356
extract tdsURLprovider
SabrinaTardio e3ae2d7
clean up
SabrinaTardio e7ef4ad
remove unwanted change
SabrinaTardio 9a88b9a
Merge branch 'main' into sabrina/tds-override
SabrinaTardio 731390e
remove unwanted code
SabrinaTardio dadd705
Merge branch 'main' into sabrina/tds-override
SabrinaTardio 683b3f3
Delete Core/PixelExperimentKitCutomMetrics.swift
SabrinaTardio 37f1892
Delete DuckDuckGo/Configuration/PixelExperimentKitCutomMetrics.swift
SabrinaTardio 894d206
update BSK dependency
SabrinaTardio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
DuckDuckGoTests/Configuration/AppConfigurationURLProviderTests.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| // | ||
| // AppConfigurationURLProviderTests.swift | ||
| // DuckDuckGo | ||
| // | ||
| // Copyright © 2025 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. | ||
| // | ||
|
|
||
| import XCTest | ||
| import BrowserServicesKit | ||
| import Configuration | ||
| @testable import DuckDuckGo | ||
|
|
||
| final class AppConfigurationURLProviderTests: XCTestCase { | ||
| private var urlProvider: AppConfigurationURLProvider! | ||
| private var mockTdsURLProvider: MockTrackerDataURLProvider! | ||
| let controlURL = "control/url.json" | ||
| let treatmentURL = "treatment/url.json" | ||
|
|
||
| override func setUp() { | ||
| super.setUp() | ||
| mockTdsURLProvider = MockTrackerDataURLProvider() | ||
| urlProvider = AppConfigurationURLProvider(trackerDataUrlProvider: mockTdsURLProvider) | ||
| } | ||
|
|
||
| override func tearDown() { | ||
| urlProvider = nil | ||
| mockTdsURLProvider = nil | ||
| super.tearDown() | ||
| } | ||
|
|
||
| func testUrlForTrackerDataIsDefaultWhenTdsUrlProviderUrlIsNil() { | ||
| // GIVEN | ||
| mockTdsURLProvider.trackerDataURL = nil | ||
|
|
||
| // WHEN | ||
| let url = urlProvider.url(for: .trackerDataSet) | ||
|
|
||
| // THEN | ||
| XCTAssertEqual(url, URL.trackerDataSet) | ||
| } | ||
|
|
||
| func testUrlForTrackerDataIsTheOneProvidedByTdsUrlProvider() { | ||
| // GIVEN | ||
| let expectedURL = URL(string: "https://someurl.com")! | ||
| mockTdsURLProvider.trackerDataURL = expectedURL | ||
|
|
||
| // WHEN | ||
| let url = urlProvider.url(for: .trackerDataSet) | ||
|
|
||
| // THEN | ||
| XCTAssertEqual(url, expectedURL) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| class MockTrackerDataURLProvider: TrackerDataURLProviding { | ||
| var trackerDataURL: URL? | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.