Skip to content

Commit

Permalink
Merge pull request #4865 from andydotxyz/fix/4863
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed May 23, 2024
2 parents fb1b46b + e17fd84 commit f84c1dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 2 additions & 5 deletions canvas/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import (
"testing"

"fyne.io/fyne/v2/canvas"
intRepo "fyne.io/fyne/v2/internal/repository"
"fyne.io/fyne/v2/storage"
"fyne.io/fyne/v2/storage/repository"
_ "fyne.io/fyne/v2/test"

"github.com/stretchr/testify/assert"
)
Expand Down Expand Up @@ -78,9 +77,6 @@ func TestNewImageFromURI_File(t *testing.T) {
}

func TestNewImageFromURI_HTTP(t *testing.T) {
h := intRepo.NewHTTPRepository()
repository.Register("http", h)

pwd, _ := os.Getwd()
path := filepath.Join(filepath.Dir(pwd), "theme", "icons", "fyne.png")
f, _ := os.ReadFile(path)
Expand All @@ -96,6 +92,7 @@ func TestNewImageFromURI_HTTP(t *testing.T) {
}))
defer ts.Close()

// http is mounted in Fyne test handlers by default
url, _ := storage.ParseURI(ts.URL)
img := canvas.NewImageFromURI(url)
assert.NotNil(t, img)
Expand Down
4 changes: 4 additions & 0 deletions test/testdriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ func NewDriver() fyne.Driver {
drv := &testDriver{windowsMutex: sync.RWMutex{}}
repository.Register("file", intRepo.NewFileRepository())

httpHandler := intRepo.NewHTTPRepository()
repository.Register("http", httpHandler)
repository.Register("https", httpHandler)

// make a single dummy window for rendering tests
drv.CreateWindow("")

Expand Down

0 comments on commit f84c1dc

Please sign in to comment.