Skip to content

Commit

Permalink
Merge pull request #59 from wirepair/version_bump_20220331
Browse files Browse the repository at this point in the history
Version bump 20220331
  • Loading branch information
wirepair authored Mar 31, 2022
2 parents ea3da70 + 2afc90f commit 4bcadcb
Show file tree
Hide file tree
Showing 21 changed files with 425 additions and 274 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Changelog (2022)
- 2.2.5 (March 31st) Upgrade protocol.json to 100.0.4896.60

# Changelog (2021)
- 2.2.4 (November 27th) Upgrade protocol.json to 96.0.4664.45
- 2.2.3 (August 23rd) Applied patch from @camswords to allow using custom output writer for chrome process to aid in debugging.
Expand Down
2 changes: 0 additions & 2 deletions v2/chrome_target.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ type ChromeTarget struct {
// Chrome Debugger Domains
Accessibility *gcdapi.Accessibility
Animation *gcdapi.Animation
ApplicationCache *gcdapi.ApplicationCache // application cache API
Audits *gcdapi.Audits
BackgroundService *gcdapi.BackgroundService
Browser *gcdapi.Browser
Expand Down Expand Up @@ -163,7 +162,6 @@ func openChromeTarget(debugger *Gcd, target *TargetInfo, observer observer.Messa
func (c *ChromeTarget) Init() {
c.Accessibility = gcdapi.NewAccessibility(c)
c.Animation = gcdapi.NewAnimation(c)
c.ApplicationCache = gcdapi.NewApplicationCache(c)
c.Audits = gcdapi.NewAudits(c)
c.Browser = gcdapi.NewBrowser(c)
c.BackgroundService = gcdapi.NewBackgroundService(c)
Expand Down
2 changes: 1 addition & 1 deletion v2/examples/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func startTarget(debugger *gcd.Gcd) *gcd.ChromeTarget {
log.Fatalf("error getting new tab: %s\n", err)
}
ctx := context.Background()
target.DOM.Enable(ctx)
target.DOM.Enable(ctx, "false")
target.Console.Enable(ctx)
target.Page.Enable(ctx)
//target.Debugger.Enable()
Expand Down
2 changes: 1 addition & 1 deletion v2/gcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import (

var json = jsoniter.ConfigCompatibleWithStandardLibrary

var GCDVERSION = "v2.2.4"
var GCDVERSION = "v2.2.5"

var (
ErrNoTabAvailable = errors.New("no available tab found")
Expand Down
42 changes: 42 additions & 0 deletions v2/gcd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,48 @@ func TestSimpleReturnReturnsGoError(t *testing.T) {
}
}

func TestDOMEnableWithWhiteSpace(t *testing.T) {
testDefaultStartup(t)
defer debugger.ExitProcess()
ctx := context.Background()
target, err := debugger.NewTab()
if err != nil {
t.Fatalf("error getting new tab: %s\n", err)
}

page := target.Page
if _, err := page.Enable(ctx); err != nil {
t.Fatalf("failed to enable page: %s\n", err)
}

dom := target.DOM
if _, err := dom.EnableWithParams(ctx, &gcdapi.DOMEnableParams{}); err != nil {
t.Fatalf("got error enabling DOM: %s\n", err)
}

doneCh := make(chan struct{})
target.Subscribe("Page.loadEventFired", func(target *ChromeTarget, payload []byte) {

doc, err := target.DOM.GetDocument(context.Background(), -1, true)
if err != nil {
t.Fatalf("failed to get doc: %s\n", err)
}

if doc.ChildNodeCount != 2 {
t.Fatalf("failed to get 2 child nodes, got %d\n", doc.ChildNodeCount)
}
doneCh <- struct{}{}
})

navParams := &gcdapi.PageNavigateParams{Url: testServerAddr + "cookie.html", TransitionType: "typed"}
_, _, _, err = target.Page.NavigateWithParams(testCtx, navParams)
if err != nil {
t.Fatalf("failed to load test page: %s\n", err)
}

<-doneCh
}

// Tests that the ctx canceled doesn't cause the wsconn to get stuck in a loop in windows
func TestCtxCancel(t *testing.T) {
testDefaultStartup(t, WithEventDebugging(), WithEventDebugging())
Expand Down
6 changes: 1 addition & 5 deletions v2/gcdapi/accessibility.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ func (c *Accessibility) GetPartialAXTree(ctx context.Context, nodeId int, backen
type AccessibilityGetFullAXTreeParams struct {
// The maximum depth at which descendants of the root node should be retrieved. If omitted, the full tree is returned.
Depth int `json:"depth,omitempty"`
// Deprecated. This parameter has been renamed to `depth`. If depth is not provided, max_depth will be used.
Max_depth int `json:"max_depth,omitempty"`
// The frame for whose document the AX tree should be retrieved. If omited, the root frame is used.
FrameId string `json:"frameId,omitempty"`
}
Expand Down Expand Up @@ -195,13 +193,11 @@ func (c *Accessibility) GetFullAXTreeWithParams(ctx context.Context, v *Accessib

// GetFullAXTree - Fetches the entire accessibility tree for the root Document
// depth - The maximum depth at which descendants of the root node should be retrieved. If omitted, the full tree is returned.
// max_depth - Deprecated. This parameter has been renamed to `depth`. If depth is not provided, max_depth will be used.
// frameId - The frame for whose document the AX tree should be retrieved. If omited, the root frame is used.
// Returns - nodes -
func (c *Accessibility) GetFullAXTree(ctx context.Context, depth int, max_depth int, frameId string) ([]*AccessibilityAXNode, error) {
func (c *Accessibility) GetFullAXTree(ctx context.Context, depth int, frameId string) ([]*AccessibilityAXNode, error) {
var v AccessibilityGetFullAXTreeParams
v.Depth = depth
v.Max_depth = max_depth
v.FrameId = frameId
return c.GetFullAXTreeWithParams(ctx, &v)
}
Expand Down
189 changes: 0 additions & 189 deletions v2/gcdapi/applicationcache.go

This file was deleted.

Loading

0 comments on commit 4bcadcb

Please sign in to comment.