summaryrefslogtreecommitdiff
path: root/pkg/backend/init.go
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2020-06-18 20:42:29 +0200
committerkali kaneko (leap communications) <kali@leap.se>2020-06-26 12:17:30 +0200
commitcdb42f0d6b47a60ceb647e3ac6a6ce66352dbae4 (patch)
tree40f76de30181eb1036d44516e5dd05488c8c31dc /pkg/backend/init.go
parent4de5748e25678dce9c5a344afc5fd40508c0860f (diff)
[test] minimal qml tests
just a minimal boilerplate. the idea is to import the qml files and assert that the states/widgets change accordingly if we mock the backend status. - Closes: #300
Diffstat (limited to 'pkg/backend/init.go')
-rw-r--r--pkg/backend/init.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/backend/init.go b/pkg/backend/init.go
index 5abb05e..79efdc7 100644
--- a/pkg/backend/init.go
+++ b/pkg/backend/init.go
@@ -12,11 +12,11 @@ import (
// initializeContext initializes an empty connStatus and assigns it to the
// global ctx holder. This is expected to be called only once, so the public
// api uses the sync.Once primitive to call this.
-func initializeContext(provider, appName string) {
+func initializeContext(opts *InitOpts) {
var st status = off
ctx = &connectionCtx{
- AppName: appName,
- Provider: provider,
+ AppName: opts.AppName,
+ Provider: opts.Provider,
TosURL: config.TosURL,
HelpURL: config.HelpURL,
DonateURL: config.DonateURL,
@@ -28,7 +28,7 @@ func initializeContext(provider, appName string) {
errCh := make(chan string)
go trigger(OnStatusChanged)
go checkErrors(errCh)
- initializeBitmask(errCh)
+ initializeBitmask(errCh, opts)
}
func checkErrors(errCh chan string) {
@@ -39,14 +39,14 @@ func checkErrors(errCh chan string) {
}
}
-func initializeBitmask(errCh chan string) {
+func initializeBitmask(errCh chan string, opts *InitOpts) {
if ctx == nil {
log.Println("bug: cannot initialize bitmask, ctx is nil!")
os.Exit(1)
}
bitmask.InitializeLogger()
- b, err := bitmask.InitializeBitmask()
+ b, err := bitmask.InitializeBitmask(opts.SkipLaunch)
if err != nil {
log.Println("error: cannot initialize bitmask")
errCh <- err.Error()