-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
539 changed files
with
9,735 additions
and
13,257 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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
117 changes: 82 additions & 35 deletions
117
android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/data/DummyRelayItems.kt
This file contains 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 |
---|---|---|
@@ -1,61 +1,108 @@ | ||
package net.mullvad.mullvadvpn.compose.data | ||
|
||
import net.mullvad.mullvadvpn.model.CustomListName | ||
import net.mullvad.mullvadvpn.model.PortRange | ||
import net.mullvad.mullvadvpn.model.RelayEndpointData | ||
import net.mullvad.mullvadvpn.model.RelayList | ||
import net.mullvad.mullvadvpn.model.RelayListCity | ||
import net.mullvad.mullvadvpn.model.RelayListCountry | ||
import net.mullvad.mullvadvpn.model.WireguardEndpointData | ||
import net.mullvad.mullvadvpn.model.WireguardRelayEndpointData | ||
import net.mullvad.mullvadvpn.relaylist.RelayItem | ||
import net.mullvad.mullvadvpn.relaylist.toRelayCountries | ||
import net.mullvad.mullvadvpn.lib.model.CustomList | ||
import net.mullvad.mullvadvpn.lib.model.CustomListId | ||
import net.mullvad.mullvadvpn.lib.model.CustomListName | ||
import net.mullvad.mullvadvpn.lib.model.GeoLocationId | ||
import net.mullvad.mullvadvpn.lib.model.Ownership | ||
import net.mullvad.mullvadvpn.lib.model.PortRange | ||
import net.mullvad.mullvadvpn.lib.model.Provider | ||
import net.mullvad.mullvadvpn.lib.model.ProviderId | ||
import net.mullvad.mullvadvpn.lib.model.RelayItem | ||
import net.mullvad.mullvadvpn.lib.model.RelayList | ||
import net.mullvad.mullvadvpn.lib.model.WireguardEndpointData | ||
|
||
private val DUMMY_RELAY_1 = | ||
net.mullvad.mullvadvpn.model.Relay( | ||
hostname = "Relay host 1", | ||
RelayItem.Location.Relay( | ||
id = | ||
GeoLocationId.Hostname( | ||
city = GeoLocationId.City(GeoLocationId.Country("RCo1"), "Relay City 1"), | ||
"Relay host 1" | ||
), | ||
active = true, | ||
endpointData = RelayEndpointData.Wireguard(WireguardRelayEndpointData), | ||
owned = true, | ||
provider = "PROVIDER" | ||
provider = | ||
Provider( | ||
providerId = ProviderId("PROVIDER RENTED"), | ||
ownership = Ownership.Rented, | ||
) | ||
) | ||
private val DUMMY_RELAY_2 = | ||
net.mullvad.mullvadvpn.model.Relay( | ||
hostname = "Relay host 2", | ||
RelayItem.Location.Relay( | ||
id = | ||
GeoLocationId.Hostname( | ||
city = GeoLocationId.City(GeoLocationId.Country("RCo2"), "Relay City 2"), | ||
"Relay host 2" | ||
), | ||
active = true, | ||
endpointData = RelayEndpointData.Wireguard(WireguardRelayEndpointData), | ||
owned = true, | ||
provider = "PROVIDER" | ||
provider = | ||
Provider(providerId = ProviderId("PROVIDER OWNED"), ownership = Ownership.MullvadOwned) | ||
) | ||
private val DUMMY_RELAY_CITY_1 = | ||
RelayItem.Location.City( | ||
name = "Relay City 1", | ||
id = GeoLocationId.City(countryCode = GeoLocationId.Country("RCo1"), cityCode = "RCi1"), | ||
relays = listOf(DUMMY_RELAY_1), | ||
expanded = false | ||
) | ||
private val DUMMY_RELAY_CITY_2 = | ||
RelayItem.Location.City( | ||
name = "Relay City 2", | ||
id = GeoLocationId.City(countryCode = GeoLocationId.Country("RCo2"), cityCode = "RCi2"), | ||
relays = listOf(DUMMY_RELAY_2), | ||
expanded = false | ||
) | ||
private val DUMMY_RELAY_CITY_1 = RelayListCity("Relay City 1", "RCi1", arrayListOf(DUMMY_RELAY_1)) | ||
private val DUMMY_RELAY_CITY_2 = RelayListCity("Relay City 2", "RCi2", arrayListOf(DUMMY_RELAY_2)) | ||
private val DUMMY_RELAY_COUNTRY_1 = | ||
RelayListCountry("Relay Country 1", "RCo1", arrayListOf(DUMMY_RELAY_CITY_1)) | ||
RelayItem.Location.Country( | ||
name = "Relay Country 1", | ||
id = GeoLocationId.Country("RCo1"), | ||
expanded = false, | ||
cities = listOf(DUMMY_RELAY_CITY_1) | ||
) | ||
private val DUMMY_RELAY_COUNTRY_2 = | ||
RelayListCountry("Relay Country 2", "RCo2", arrayListOf(DUMMY_RELAY_CITY_2)) | ||
RelayItem.Location.Country( | ||
name = "Relay Country 2", | ||
id = GeoLocationId.Country("RCo2"), | ||
expanded = false, | ||
cities = listOf(DUMMY_RELAY_CITY_2) | ||
) | ||
|
||
private val DUMMY_WIREGUARD_PORT_RANGES = ArrayList<PortRange>() | ||
private val DUMMY_WIREGUARD_ENDPOINT_DATA = WireguardEndpointData(DUMMY_WIREGUARD_PORT_RANGES) | ||
|
||
val DUMMY_RELAY_COUNTRIES = | ||
val DUMMY_RELAY_COUNTRIES = listOf(DUMMY_RELAY_COUNTRY_1, DUMMY_RELAY_COUNTRY_2) | ||
|
||
val DUMMY_RELAY_LIST = | ||
RelayList( | ||
arrayListOf(DUMMY_RELAY_COUNTRY_1, DUMMY_RELAY_COUNTRY_2), | ||
DUMMY_WIREGUARD_ENDPOINT_DATA, | ||
) | ||
.toRelayCountries() | ||
DUMMY_RELAY_COUNTRIES, | ||
DUMMY_WIREGUARD_ENDPOINT_DATA, | ||
) | ||
|
||
val DUMMY_CUSTOM_LISTS = | ||
val DUMMY_RELAY_ITEM_CUSTOM_LISTS = | ||
listOf( | ||
RelayItem.CustomList( | ||
CustomListName.fromString("First list"), | ||
false, | ||
"1", | ||
customListName = CustomListName.fromString("First list"), | ||
expanded = false, | ||
id = CustomListId("1"), | ||
locations = DUMMY_RELAY_COUNTRIES | ||
), | ||
RelayItem.CustomList( | ||
CustomListName.fromString("Empty list"), | ||
customListName = CustomListName.fromString("Empty list"), | ||
expanded = false, | ||
"2", | ||
id = CustomListId("2"), | ||
locations = emptyList() | ||
) | ||
) | ||
|
||
val DUMMY_CUSTOM_LISTS = | ||
listOf( | ||
CustomList( | ||
name = CustomListName.fromString("First list"), | ||
id = CustomListId("1"), | ||
locations = DUMMY_RELAY_COUNTRIES.map { it.id } | ||
), | ||
CustomList( | ||
name = CustomListName.fromString("Empty list"), | ||
id = CustomListId("2"), | ||
locations = emptyList() | ||
) | ||
) |
This file contains 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 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
Oops, something went wrong.