From 7f44d3915f5dd0a2e4c7a442531032228d10849e Mon Sep 17 00:00:00 2001 From: = Date: Wed, 16 Oct 2024 12:40:11 +0900 Subject: [PATCH] actually download new protocol files, fix flakey test --- v2/gcd_test.go | 32 +-- v2/gcdapi/accessibility.go | 12 +- v2/gcdapi/animation.go | 40 +++- v2/gcdapi/audits.go | 140 ++++++++---- v2/gcdapi/autofill.go | 124 +++++++++++ v2/gcdapi/bluetoothemulation.go | 112 ++++++++++ v2/gcdapi/browser.go | 29 ++- v2/gcdapi/cachestorage.go | 19 +- v2/gcdapi/css.go | 213 +++++++++++++++--- v2/gcdapi/debugger.go | 62 ++++-- v2/gcdapi/dom.go | 148 ++++++++++++- v2/gcdapi/domsnapshot.go | 2 +- v2/gcdapi/emulation.go | 229 ++++++++++++++++++- v2/gcdapi/eventbreakpoints.go | 5 + v2/gcdapi/extensions.go | 189 ++++++++++++++++ v2/gcdapi/fedcm.go | 67 +++++- v2/gcdapi/fetch.go | 6 +- v2/gcdapi/filesystem.go | 85 +++++++ v2/gcdapi/headlessexperimental.go | 2 +- v2/gcdapi/input.go | 19 +- v2/gcdapi/io.go | 4 +- v2/gcdapi/layertree.go | 2 +- v2/gcdapi/memory.go | 40 +++- v2/gcdapi/network.go | 339 ++++++++++++++++++---------- v2/gcdapi/overlay.go | 35 ++- v2/gcdapi/page.go | 251 ++++++++++++++++----- v2/gcdapi/performancetimeline.go | 2 +- v2/gcdapi/preload.go | 42 ++-- v2/gcdapi/pwa.go | 257 +++++++++++++++++++++ v2/gcdapi/runtime.go | 62 +++--- v2/gcdapi/security.go | 2 +- v2/gcdapi/serviceworker.go | 1 + v2/gcdapi/storage.go | 357 ++++++++++++++++++++++++++---- v2/gcdapi/target.go | 10 +- v2/gcdapi/webauthn.go | 68 +++++- v2/gcdapigen/gcdapigen.go | 3 + v2/gcdapigen/protocol.json | 2 +- 37 files changed, 2550 insertions(+), 462 deletions(-) create mode 100644 v2/gcdapi/autofill.go create mode 100644 v2/gcdapi/bluetoothemulation.go create mode 100644 v2/gcdapi/extensions.go create mode 100644 v2/gcdapi/filesystem.go create mode 100644 v2/gcdapi/pwa.go diff --git a/v2/gcd_test.go b/v2/gcd_test.go index ac65f5e..b4ae778 100644 --- a/v2/gcd_test.go +++ b/v2/gcd_test.go @@ -481,35 +481,13 @@ func TestConnectToInstance(t *testing.T) { testDefaultStartup(t) defer debugger.ExitProcess() - doneCh := make(chan error) - - go testTimeoutListener(doneCh, 15, "timed out waiting for remote connection") - - go func() { - remoteDebugger := NewChromeDebugger() - remoteDebugger.ConnectToInstance(debugger.host, debugger.port) - - _, err := remoteDebugger.NewTab() - if err != nil { - t.Fatalf("error creating new tab") - } + remoteDebugger := NewChromeDebugger() + t.Logf("connecting to %s:%s", debugger.host, debugger.port) + remoteDebugger.ConnectToInstance(debugger.host, debugger.port) - targets, error := remoteDebugger.GetTargets() - if error != nil { - t.Fatalf("cannot get targets: %s \n", error) - } - if len(targets) <= 0 { - t.Fatalf("invalid number of targets, got: %d\n", len(targets)) - } - for _, target := range targets { - t.Logf("page: %s\n", target.Target.Url) - } - close(doneCh) - }() - - err := <-doneCh + _, err := remoteDebugger.NewTab() if err != nil { - t.Fatal(err) + t.Fatalf("error creating new tab") } } diff --git a/v2/gcdapi/accessibility.go b/v2/gcdapi/accessibility.go index 1fffc52..a6afa66 100644 --- a/v2/gcdapi/accessibility.go +++ b/v2/gcdapi/accessibility.go @@ -16,7 +16,7 @@ type AccessibilityAXValueSource struct { Attribute string `json:"attribute,omitempty"` // The name of the relevant attribute, if any. AttributeValue *AccessibilityAXValue `json:"attributeValue,omitempty"` // The value of the relevant attribute, if any. Superseded bool `json:"superseded,omitempty"` // Whether this source is superseded by a higher priority source. - NativeSource string `json:"nativeSource,omitempty"` // The native markup source for this value, e.g. a