mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 04:36:43 +00:00
feat(BRIDGE-119): added support for Feature Flags
This commit is contained in:
@ -149,6 +149,11 @@ func (t *testCtx) initBridge() (<-chan events.Event, error) {
|
||||
}
|
||||
|
||||
rt := t.netCtl.NewRoundTripper(&tls.Config{InsecureSkipVerify: true})
|
||||
|
||||
// We store the round tripper in the testing context so we can cancel the connection
|
||||
// when we're turning it down/up
|
||||
t.rt = &rt
|
||||
|
||||
if isBlack() {
|
||||
// GODT-1602 make sure we don't time out test server
|
||||
t, ok := rt.(*http.Transport)
|
||||
|
||||
@ -21,6 +21,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/smtp"
|
||||
"net/url"
|
||||
"regexp"
|
||||
@ -164,6 +165,8 @@ type testCtx struct {
|
||||
|
||||
imapServerStarted bool
|
||||
smtpServerStarted bool
|
||||
|
||||
rt *http.RoundTripper
|
||||
}
|
||||
|
||||
type imapClient struct {
|
||||
|
||||
@ -59,11 +59,19 @@ func (s *scenario) itFailsWithError(wantErr string) error {
|
||||
|
||||
func (s *scenario) internetIsTurnedOff() error {
|
||||
s.t.netCtl.SetCanDial(false)
|
||||
t, ok := (*s.t.rt).(*http.Transport)
|
||||
if ok {
|
||||
t.CloseIdleConnections()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *scenario) internetIsTurnedOn() error {
|
||||
s.t.netCtl.SetCanDial(true)
|
||||
t, ok := (*s.t.rt).(*http.Transport)
|
||||
if ok {
|
||||
t.CloseIdleConnections()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user