chromeworker_client/client_test.go
2020-11-23 18:49:37 +08:00

37 lines
882 B
Go

package cwclient
import (
"log"
"net/http"
"testing"
)
func TestPort(t *testing.T) {
cli := New("http://localhost:7123")
ltest := cli.Register("test", func(tid, content string) {
log.Println(tid, content)
})
ltest.SetContentConditionFromFile("example.js")
cli.Connect()
log.Println(ltest.Open("https://playerduo.com/api/playerDuo-service-v2/rip113?lang=en&deviceType=browser"))
log.Println(ltest.Open("https://playerduo.com/api/playerDuo-service-v2/yanngu?lang=en&deviceType=browser"))
log.Println(ltest.Open("https://playerduo.com/api/playerDuo-service-v2/rip113?lang=en&deviceType=browser"))
log.Println(ltest.Open("https://playerduo.com/api/playerDuo-service-v2/yanngu?lang=en&deviceType=browser"))
http.ListenAndServe(":42311", nil)
}
func TestChrome(t *testing.T) {
{
defer func() {
log.Println(123)
}()
log.Println(456)
}
log.Println(321)
}