Skip to content

Commit

Permalink
Fix webviewsettings calls. Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leaanthony committed Aug 30, 2023
1 parent 386f2c3 commit 7ef8cdf
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/edge/ICoreWebView2Settings2.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (i *ICoreWebView2Settings2) AddRef() uintptr {
return refCounter
}

func (i *ICoreWebView2) GetICoreWebView2Settings2() *ICoreWebView2Settings2 {
func (i *ICoreWebViewSettings) GetICoreWebView2Settings2() *ICoreWebView2Settings2 {
var result *ICoreWebView2Settings2

iidICoreWebView2Settings2 := NewGUID("{ee9a0f68-f46c-4e32-ac23-ef8cac224d2a}")
Expand Down
2 changes: 1 addition & 1 deletion pkg/edge/ICoreWebView2Settings3.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (i *ICoreWebView2Settings3) AddRef() uintptr {
return refCounter
}

func (i *ICoreWebView2) GetICoreWebView2Settings3() *ICoreWebView2Settings3 {
func (i *ICoreWebViewSettings) GetICoreWebView2Settings3() *ICoreWebView2Settings3 {
var result *ICoreWebView2Settings3

iidICoreWebView2Settings3 := NewGUID("{fdb5ab74-af33-4854-84f0-0a631deb5eba}")
Expand Down
2 changes: 1 addition & 1 deletion pkg/edge/ICoreWebView2Settings4.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (i *ICoreWebView2Settings4) AddRef() uintptr {
return refCounter
}

func (i *ICoreWebView2) GetICoreWebView2Settings4() *ICoreWebView2Settings4 {
func (i *ICoreWebViewSettings) GetICoreWebView2Settings4() *ICoreWebView2Settings4 {
var result *ICoreWebView2Settings4

iidICoreWebView2Settings4 := NewGUID("{cb56846c-4168-4d53-b04f-03b6d6796ff2}")
Expand Down
2 changes: 1 addition & 1 deletion pkg/edge/ICoreWebView2Settings5.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (i *ICoreWebView2Settings5) AddRef() uintptr {
return refCounter
}

func (i *ICoreWebView2) GetICoreWebView2Settings5() *ICoreWebView2Settings5 {
func (i *ICoreWebViewSettings) GetICoreWebView2Settings5() *ICoreWebView2Settings5 {
var result *ICoreWebView2Settings5

iidICoreWebView2Settings5 := NewGUID("{183e7052-1d03-43a0-ab99-98e043b66b39}")
Expand Down
24 changes: 24 additions & 0 deletions pkg/edge/capabilities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,30 @@ func Test_hasCapability(t *testing.T) {
},
want: false,
},
{
name: "should support SwipeNavigation if version is equal to minimum",
args: args{
webview2RuntimeVersion: "94.0.992.31",
capability: SwipeNavigation,
},
want: true,
},
{
name: "should support SwipeNavigation if version is above minimum",
args: args{
webview2RuntimeVersion: "115.0.1901.177",
capability: SwipeNavigation,
},
want: true,
},
{
name: "should not support SwipeNavigation if version is below minimum",
args: args{
webview2RuntimeVersion: "93.0.992.31",
capability: SwipeNavigation,
},
want: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 7ef8cdf

Please sign in to comment.