From baed93ebe8931c16ad9845555be8ee7630288bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 5 Nov 2024 15:42:41 -0500 Subject: [PATCH] Use Sobek for Geolocation transformation --- browser/browser_context_mapping.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/browser/browser_context_mapping.go b/browser/browser_context_mapping.go index 72cbe48a6..f36a53629 100644 --- a/browser/browser_context_mapping.go +++ b/browser/browser_context_mapping.go @@ -87,12 +87,12 @@ func mapBrowserContext(vu moduleVU, bc *common.BrowserContext) mapping { //nolin "setDefaultNavigationTimeout": bc.SetDefaultNavigationTimeout, "setDefaultTimeout": bc.SetDefaultTimeout, "setGeolocation": func(geolocation sobek.Value) (*sobek.Promise, error) { - gl := common.NewGeolocation() - if err := gl.Parse(vu.Context(), geolocation); err != nil { + gl, err := exportTo[common.Geolocation](vu.Runtime(), geolocation) + if err != nil { return nil, fmt.Errorf("parsing geo location: %w", err) } return k6ext.Promise(vu.Context(), func() (any, error) { - return nil, bc.SetGeolocation(gl) + return nil, bc.SetGeolocation(&gl) }), nil }, "setHTTPCredentials": func(httpCredentials sobek.Value) (*sobek.Promise, error) {