From 4d171d4474d065bfe2008abbeb0ec4275ef5593f Mon Sep 17 00:00:00 2001 From: Kenneth Shaw Date: Sun, 31 Mar 2024 07:48:53 +0700 Subject: [PATCH] Expanding channels test --- client_test.go | 37 +++++++++++++++++++++++++++++++------ go.mod | 2 +- go.sum | 2 -- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/client_test.go b/client_test.go index dedfc7f..d531986 100644 --- a/client_test.go +++ b/client_test.go @@ -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) + } + }) } } @@ -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, + } +} diff --git a/go.mod b/go.mod index e5c8f0a..1cbd6ce 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/chromedp/verhist -go 1.20 +go 1.22 require github.com/kenshaw/httplog v0.4.3 diff --git a/go.sum b/go.sum index 1c6a6c1..43c4997 100644 --- a/go.sum +++ b/go.sum @@ -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=