Skip to content

Commit

Permalink
update tests and setup experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
brindy committed Mar 13, 2024
1 parent 1d38dc9 commit e3e6756
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 135 deletions.
4 changes: 4 additions & 0 deletions Core/DefaultVariantManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ public struct VariantIOS: Variant {
VariantIOS(name: "sc", weight: doNotAllocate, isIncluded: When.always, features: []),
VariantIOS(name: "sd", weight: doNotAllocate, isIncluded: When.always, features: []),
VariantIOS(name: "se", weight: doNotAllocate, isIncluded: When.always, features: []),

VariantIOS(name: "mc", weight: 1, isIncluded: When.always, features: []),
VariantIOS(name: "md", weight: 1, isIncluded: When.always, features: [.history]),

returningUser
]

Expand Down
4 changes: 1 addition & 3 deletions Core/HistoryManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ public class HistoryManager: HistoryManaging {
}

func isHistoryFeatureEnabled() -> Bool {
// TODO change this before merging
#warning("this should be changed before merging")
return true // privacyConfigManager.privacyConfig.isEnabled(featureKey: .history) && variantManager.isSupported(feature: .history)
return privacyConfigManager.privacyConfig.isEnabled(featureKey: .history) && variantManager.isSupported(feature: .history)
}

public func removeAllHistory() async {
Expand Down
12 changes: 0 additions & 12 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,6 @@
85DFEDF724CB1CAB00973FE7 /* ShareSheet.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 85DFEDF624CB1CAB00973FE7 /* ShareSheet.xcassets */; };
85DFEDF924CF3D0E00973FE7 /* TabsBarCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85DFEDF824CF3D0E00973FE7 /* TabsBarCell.swift */; };
85E242172AB1B54D000F3E28 /* ReturnUserMeasurement.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85E242162AB1B54D000F3E28 /* ReturnUserMeasurement.swift */; };
85E5603026541D9E00F4DC44 /* AutocompleteRequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85E5602E26541D1D00F4DC44 /* AutocompleteRequestTests.swift */; };
85E58C2C28FDA94F006A801A /* FavoritesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85E58C2B28FDA94F006A801A /* FavoritesViewController.swift */; };
85EE7F55224667DD000FE757 /* WebContainer.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 85EE7F54224667DD000FE757 /* WebContainer.storyboard */; };
85EE7F572246685B000FE757 /* WebContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85EE7F562246685B000FE757 /* WebContainerViewController.swift */; };
Expand Down Expand Up @@ -1618,7 +1617,6 @@
85DFEDF624CB1CAB00973FE7 /* ShareSheet.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = ShareSheet.xcassets; sourceTree = "<group>"; };
85DFEDF824CF3D0E00973FE7 /* TabsBarCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabsBarCell.swift; sourceTree = "<group>"; };
85E242162AB1B54D000F3E28 /* ReturnUserMeasurement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReturnUserMeasurement.swift; sourceTree = "<group>"; };
85E5602E26541D1D00F4DC44 /* AutocompleteRequestTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutocompleteRequestTests.swift; sourceTree = "<group>"; };
85E58C2B28FDA94F006A801A /* FavoritesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavoritesViewController.swift; sourceTree = "<group>"; };
85EE7F54224667DD000FE757 /* WebContainer.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = WebContainer.storyboard; sourceTree = "<group>"; };
85EE7F562246685B000FE757 /* WebContainerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebContainerViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4132,14 +4130,6 @@
name = iPad;
sourceTree = "<group>";
};
85E5602D26541D0900F4DC44 /* AutoComplete */ = {
isa = PBXGroup;
children = (
85E5602E26541D1D00F4DC44 /* AutocompleteRequestTests.swift */,
);
name = AutoComplete;
sourceTree = "<group>";
};
85EE7F53224667C3000FE757 /* WebContainer */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -5007,7 +4997,6 @@
F17669A21E411D63003D3222 /* Application */,
026F08B629B7DC130079B9DF /* AppTrackingProtection */,
981FED7222045FFA008488D7 /* AutoClear */,
85E5602D26541D0900F4DC44 /* AutoComplete */,
1E1D8B5B2994FF7800C96994 /* Autoconsent */,
F40F843228C92B1C0081AE75 /* Autofill */,
98559FD0267099F400A83094 /* ContentBlocker */,
Expand Down Expand Up @@ -7047,7 +7036,6 @@
31C138B227A4097800FFD4B2 /* DownloadTestsHelper.swift in Sources */,
1E1D8B5D2994FFE100C96994 /* AutoconsentMessageProtocolTests.swift in Sources */,
85C11E532090B23A00BFFEB4 /* UserDefaultsHomeRowReminderStorageTests.swift in Sources */,
85E5603026541D9E00F4DC44 /* AutocompleteRequestTests.swift in Sources */,
F1DA2F7D1EBCF23700313F51 /* ExternalUrlSchemeTests.swift in Sources */,
F198D78E1E39762C0088DA8A /* StringExtensionTests.swift in Sources */,
31B1FA87286EFC5C00CA3C1C /* XCTestCaseExtension.swift in Sources */,
Expand Down
106 changes: 0 additions & 106 deletions DuckDuckGoTests/AutocompleteRequestTests.swift

This file was deleted.

14 changes: 0 additions & 14 deletions DuckDuckGoTests/HistoryCaptureTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,6 @@ final class HistoryCaptureTests: XCTestCase {
XCTAssertEqual([URL.example], mockHistoryCoordinator.addVisitCalls)
}

func test_whenURLIsDDGQuery_ThenOnlyQueryIsStored() {
let capture = makeCapture()
capture.webViewDidCommit(url: URL.makeSearchURL(query: "test")!)
XCTAssertEqual(1, mockHistoryCoordinator.addVisitCalls.count)
XCTAssertEqual("https://duckduckgo.com?q=test", mockHistoryCoordinator.addVisitCalls[0].absoluteString)
}

func test_whenURLIsDDGQueryWithExtraParams_ThenOnlyQueryIsStored() {
let capture = makeCapture()
capture.webViewDidCommit(url: URL.makeSearchURL(query: "test")!.appendingParameter(name: "ia", value: "web"))
XCTAssertEqual(1, mockHistoryCoordinator.addVisitCalls.count)
XCTAssertEqual("https://duckduckgo.com?q=test", mockHistoryCoordinator.addVisitCalls[0].absoluteString)
}

func test_whenTitleIsUpdatedForMatchingURL_ThenTitleIsSaved() {
let capture = makeCapture()
capture.webViewDidCommit(url: URL.example)
Expand Down

0 comments on commit e3e6756

Please sign in to comment.