From 949f9d9830cc8cffd84aa9dbae9a823dbe40c5ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 6 Nov 2024 15:24:59 -0500 Subject: [PATCH] Removes forgetten Geolocation.Parse --- common/browser_context_options.go | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/common/browser_context_options.go b/common/browser_context_options.go index b2d351b07..0dc246f8d 100644 --- a/common/browser_context_options.go +++ b/common/browser_context_options.go @@ -1,12 +1,7 @@ package common import ( - "context" "fmt" - - "github.com/grafana/sobek" - - "github.com/grafana/xk6-browser/k6ext" ) // Geolocation represents a geolocation. @@ -35,31 +30,6 @@ func (g *Geolocation) Validate() error { return nil } -// Parse parses the geolocation options. -func (g *Geolocation) Parse(ctx context.Context, sopts sobek.Value) error { //nolint:cyclop - var newgl Geolocation - - if !sobekValueExists(sopts) { - return fmt.Errorf("geolocation options are required") - } - - opts := sopts.ToObject(k6ext.Runtime(ctx)) - for _, k := range opts.Keys() { - switch k { - case "accuracy": - newgl.Accuracy = opts.Get(k).ToFloat() - case "latitude": - newgl.Latitude = opts.Get(k).ToFloat() - case "longitude": - newgl.Longitude = opts.Get(k).ToFloat() - } - } - - *g = newgl - - return nil -} - // BrowserContextOptions stores browser context options. type BrowserContextOptions struct { AcceptDownloads bool `js:"acceptDownloads"`