Skip to content

Commit

Permalink
Expanding channels test
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshaw committed Mar 31, 2024
1 parent eadf847 commit 4d171d4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
37 changes: 31 additions & 6 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@ func TestChannels(t *testing.T) {
if os.Getenv("VERBOSE") != "" {
opts = append(opts, WithLogf(t.Logf))
}
channels, err := Channels(context.Background(), All, opts...)
if err != nil {
t.Fatalf("expected no error, got: %v", err)
}
for _, channel := range channels {
t.Logf("name: %s channel: %s", channel.Name, channel.ChannelType)
for _, typ := range platforms() {
t.Run(typ.String(), func(t *testing.T) {
t.Parallel()
channels, err := Channels(context.Background(), typ, opts...)
if err != nil {
t.Fatalf("expected no error, got: %v", err)
}
for _, channel := range channels {
t.Logf("name: %s channel: %s", channel.Name, channel.ChannelType)
}
})
}
}

Expand Down Expand Up @@ -79,3 +84,23 @@ func TestUserAgent(t *testing.T) {
}
t.Logf("user agent: %v", userAgent)
}

func platforms() []PlatformType {
return []PlatformType{
All,
Android,
ChromeOS,
Fuchsia,
IOS,
LacrosARM32,
LacrosARM64,
Lacros,
Linux,
MacARM64,
Mac,
Webview,
Windows64,
WindowsARM64,
Windows,
}
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/chromedp/verhist

go 1.20
go 1.22

require github.com/kenshaw/httplog v0.4.3
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
github.com/kenshaw/httplog v0.4.2 h1:Qw/IDzAYY4xjWbWem7TLA5XGOOypXBvA+XLt20QSME8=
github.com/kenshaw/httplog v0.4.2/go.mod h1:4nLFROmXyILSgXwWTq/+5GwwQe8N4+RoUobEjcuKoro=
github.com/kenshaw/httplog v0.4.3 h1:NEnC9epPyekZjABkyUOuDwXyM8bTG6zed9IXsY0IfIw=
github.com/kenshaw/httplog v0.4.3/go.mod h1:4nLFROmXyILSgXwWTq/+5GwwQe8N4+RoUobEjcuKoro=

0 comments on commit 4d171d4

Please sign in to comment.