Updating to latest protocol.json

This commit is contained in:
Kenneth Shaw 2017-10-07 08:22:18 +07:00
parent 457ad699ce
commit e46fa029e1
6 changed files with 124 additions and 28 deletions

View File

@ -125,6 +125,7 @@ const (
CommandOverlayHideHighlight MethodType = "Overlay.hideHighlight"
CommandOverlayGetHighlightObjectForTest MethodType = "Overlay.getHighlightObjectForTest"
EventEmulationVirtualTimeBudgetExpired MethodType = "Emulation.virtualTimeBudgetExpired"
EventEmulationVirtualTimeAdvanced MethodType = "Emulation.virtualTimeAdvanced"
EventEmulationVirtualTimePaused MethodType = "Emulation.virtualTimePaused"
CommandEmulationSetDeviceMetricsOverride MethodType = "Emulation.setDeviceMetricsOverride"
CommandEmulationClearDeviceMetricsOverride MethodType = "Emulation.clearDeviceMetricsOverride"
@ -662,6 +663,8 @@ func (t *MethodType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = CommandOverlayGetHighlightObjectForTest
case EventEmulationVirtualTimeBudgetExpired:
*t = EventEmulationVirtualTimeBudgetExpired
case EventEmulationVirtualTimeAdvanced:
*t = EventEmulationVirtualTimeAdvanced
case EventEmulationVirtualTimePaused:
*t = EventEmulationVirtualTimePaused
case CommandEmulationSetDeviceMetricsOverride:

View File

@ -325,6 +325,9 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) {
case cdp.EventEmulationVirtualTimeBudgetExpired:
v = new(emulation.EventVirtualTimeBudgetExpired)
case cdp.EventEmulationVirtualTimeAdvanced:
v = new(emulation.EventVirtualTimeAdvanced)
case cdp.EventEmulationVirtualTimePaused:
v = new(emulation.EventVirtualTimePaused)

View File

@ -1187,7 +1187,74 @@ func (v *EventVirtualTimeBudgetExpired) UnmarshalJSON(data []byte) error {
func (v *EventVirtualTimeBudgetExpired) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation14(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation15(in *jlexer.Lexer, out *ClearGeolocationOverrideParams) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation15(in *jlexer.Lexer, out *EventVirtualTimeAdvanced) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "virtualTimeElapsed":
out.VirtualTimeElapsed = int64(in.Int64())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation15(out *jwriter.Writer, in EventVirtualTimeAdvanced) {
out.RawByte('{')
first := true
_ = first
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"virtualTimeElapsed\":")
out.Int64(int64(in.VirtualTimeElapsed))
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v EventVirtualTimeAdvanced) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation15(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v EventVirtualTimeAdvanced) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation15(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *EventVirtualTimeAdvanced) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation15(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EventVirtualTimeAdvanced) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation15(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation16(in *jlexer.Lexer, out *ClearGeolocationOverrideParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -1216,7 +1283,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation15(in *jlexer.Lexer,
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation15(out *jwriter.Writer, in ClearGeolocationOverrideParams) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation16(out *jwriter.Writer, in ClearGeolocationOverrideParams) {
out.RawByte('{')
first := true
_ = first
@ -1226,27 +1293,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation15(out *jwriter.Write
// MarshalJSON supports json.Marshaler interface
func (v ClearGeolocationOverrideParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation15(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation16(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ClearGeolocationOverrideParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation15(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation16(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ClearGeolocationOverrideParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation15(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation16(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ClearGeolocationOverrideParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation15(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation16(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation16(in *jlexer.Lexer, out *ClearDeviceMetricsOverrideParams) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation17(in *jlexer.Lexer, out *ClearDeviceMetricsOverrideParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -1275,7 +1342,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation16(in *jlexer.Lexer,
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation16(out *jwriter.Writer, in ClearDeviceMetricsOverrideParams) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation17(out *jwriter.Writer, in ClearDeviceMetricsOverrideParams) {
out.RawByte('{')
first := true
_ = first
@ -1285,27 +1352,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation16(out *jwriter.Write
// MarshalJSON supports json.Marshaler interface
func (v ClearDeviceMetricsOverrideParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation16(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation17(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ClearDeviceMetricsOverrideParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation16(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation17(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ClearDeviceMetricsOverrideParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation16(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation17(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ClearDeviceMetricsOverrideParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation16(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation17(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation17(in *jlexer.Lexer, out *CanEmulateReturns) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation18(in *jlexer.Lexer, out *CanEmulateReturns) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -1336,7 +1403,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation17(in *jlexer.Lexer,
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation17(out *jwriter.Writer, in CanEmulateReturns) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation18(out *jwriter.Writer, in CanEmulateReturns) {
out.RawByte('{')
first := true
_ = first
@ -1354,27 +1421,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation17(out *jwriter.Write
// MarshalJSON supports json.Marshaler interface
func (v CanEmulateReturns) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation17(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation18(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v CanEmulateReturns) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation17(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation18(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *CanEmulateReturns) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation17(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation18(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *CanEmulateReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation17(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation18(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation18(in *jlexer.Lexer, out *CanEmulateParams) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation19(in *jlexer.Lexer, out *CanEmulateParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -1403,7 +1470,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation18(in *jlexer.Lexer,
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation18(out *jwriter.Writer, in CanEmulateParams) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation19(out *jwriter.Writer, in CanEmulateParams) {
out.RawByte('{')
first := true
_ = first
@ -1413,23 +1480,23 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation18(out *jwriter.Write
// MarshalJSON supports json.Marshaler interface
func (v CanEmulateParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation18(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation19(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v CanEmulateParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation18(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation19(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *CanEmulateParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation18(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation19(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *CanEmulateParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation18(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation19(l, v)
}

View File

@ -10,6 +10,12 @@ import (
// budget for the current VirtualTimePolicy has run out.
type EventVirtualTimeBudgetExpired struct{}
// EventVirtualTimeAdvanced notification sent after the virtual time has
// advanced.
type EventVirtualTimeAdvanced struct {
VirtualTimeElapsed int64 `json:"virtualTimeElapsed"` // The amount of virtual time that has elapsed in milliseconds since virtual time was first enabled.
}
// EventVirtualTimePaused notification sent after the virtual time has
// paused.
type EventVirtualTimePaused struct {
@ -19,5 +25,6 @@ type EventVirtualTimePaused struct {
// EventTypes all event types in the domain.
var EventTypes = []cdp.MethodType{
cdp.EventEmulationVirtualTimeBudgetExpired,
cdp.EventEmulationVirtualTimeAdvanced,
cdp.EventEmulationVirtualTimePaused,
}

View File

@ -346,7 +346,8 @@ func (t FrameScheduledNavigationReason) String() string {
// FrameScheduledNavigationReason values.
const (
FrameScheduledNavigationReasonFormSubmission FrameScheduledNavigationReason = "formSubmission"
FrameScheduledNavigationReasonFormSubmissionGet FrameScheduledNavigationReason = "formSubmissionGet"
FrameScheduledNavigationReasonFormSubmissionPost FrameScheduledNavigationReason = "formSubmissionPost"
FrameScheduledNavigationReasonHTTPHeaderRefresh FrameScheduledNavigationReason = "httpHeaderRefresh"
FrameScheduledNavigationReasonScriptInitiated FrameScheduledNavigationReason = "scriptInitiated"
FrameScheduledNavigationReasonMetaTagRefresh FrameScheduledNavigationReason = "metaTagRefresh"
@ -367,8 +368,10 @@ func (t FrameScheduledNavigationReason) MarshalJSON() ([]byte, error) {
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *FrameScheduledNavigationReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch FrameScheduledNavigationReason(in.String()) {
case FrameScheduledNavigationReasonFormSubmission:
*t = FrameScheduledNavigationReasonFormSubmission
case FrameScheduledNavigationReasonFormSubmissionGet:
*t = FrameScheduledNavigationReasonFormSubmissionGet
case FrameScheduledNavigationReasonFormSubmissionPost:
*t = FrameScheduledNavigationReasonFormSubmissionPost
case FrameScheduledNavigationReasonHTTPHeaderRefresh:
*t = FrameScheduledNavigationReasonHTTPHeaderRefresh
case FrameScheduledNavigationReasonScriptInitiated:

View File

@ -1501,7 +1501,8 @@
"type": "string",
"experimental": true,
"enum": [
"formSubmission",
"formSubmissionGet",
"formSubmissionPost",
"httpHeaderRefresh",
"scriptInitiated",
"metaTagRefresh",
@ -2318,6 +2319,18 @@
"experimental": true,
"description": "Notification sent after the virtual time budget for the current VirtualTimePolicy has run out."
},
{
"name": "virtualTimeAdvanced",
"experimental": true,
"parameters": [
{
"name": "virtualTimeElapsed",
"type": "integer",
"description": "The amount of virtual time that has elapsed in milliseconds since virtual time was first enabled."
}
],
"description": "Notification sent after the virtual time has advanced."
},
{
"name": "virtualTimePaused",
"experimental": true,