GODT-2221: Set DOH off by default.

This commit is contained in:
Romain Le Jeune
2023-01-04 12:08:06 +00:00
parent b10e8abde0
commit 3743e45566
5 changed files with 12 additions and 12 deletions

View File

@ -536,8 +536,8 @@ func withBridge(
mocks := bridge.NewMocks(t, v2_3_0, v2_3_0)
defer mocks.Close()
// Bridge will enable the proxy by default at startup.
mocks.ProxyCtl.EXPECT().AllowProxy()
// Bridge will disable the proxy by default at startup.
mocks.ProxyCtl.EXPECT().DisallowProxy()
// Get the path to the vault.
vaultDir, err := locator.ProvideSettingsPath()

View File

@ -119,14 +119,14 @@ func TestBridge_Settings_Proxy(t *testing.T) {
withEnv(t, func(ctx context.Context, s *server.Server, netCtl *proton.NetCtl, locator bridge.Locator, storeKey []byte) {
withBridge(ctx, t, s.GetHostURL(), netCtl, locator, storeKey, func(bridge *bridge.Bridge, mocks *bridge.Mocks) {
// By default, proxy is allowed.
require.True(t, bridge.GetProxyAllowed())
require.False(t, bridge.GetProxyAllowed())
// Disallow proxy.
mocks.ProxyCtl.EXPECT().DisallowProxy()
require.NoError(t, bridge.SetProxyAllowed(false))
mocks.ProxyCtl.EXPECT().AllowProxy()
require.NoError(t, bridge.SetProxyAllowed(true))
// Get the new setting.
require.False(t, bridge.GetProxyAllowed())
require.True(t, bridge.GetProxyAllowed())
})
})
}

View File

@ -124,13 +124,13 @@ func TestVault_Settings_ProxyAllowed(t *testing.T) {
s := newVault(t)
// Check the default proxy allowed setting.
require.Equal(t, true, s.GetProxyAllowed())
require.Equal(t, false, s.GetProxyAllowed())
// Modify the proxy allowed setting.
require.NoError(t, s.SetProxyAllowed(false))
require.NoError(t, s.SetProxyAllowed(true))
// Check the new proxy allowed setting.
require.Equal(t, false, s.GetProxyAllowed())
require.Equal(t, true, s.GetProxyAllowed())
}
func TestVault_Settings_ShowAllMail(t *testing.T) {

View File

@ -76,7 +76,7 @@ func newDefaultSettings(gluonDir string) Settings {
UpdateRollout: rand.Float64(), //nolint:gosec
ColorScheme: "",
ProxyAllowed: true,
ProxyAllowed: false,
ShowAllMail: true,
Autostart: true,
AutoUpdate: true,

View File

@ -90,8 +90,8 @@ func (t *testCtx) initBridge() (<-chan events.Event, error) {
return nil, fmt.Errorf("bridge is already started")
}
// Bridge will enable the proxy by default at startup.
t.mocks.ProxyCtl.EXPECT().AllowProxy()
// Bridge will disable the proxy by default at startup.
t.mocks.ProxyCtl.EXPECT().DisallowProxy()
// Get the path to the vault.
vaultDir, err := t.locator.ProvideSettingsPath()