Skip to content

Commit d9a77c7

Browse files
masnwilliamsCursor Agent
andauthored
Add Resize method to FakeProcessService (#83)
The BrowserProcessService interface now includes a Resize method from the kernel-go-sdk. This adds the matching implementation to the test fake to satisfy the interface. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > <sup>[Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) is generating a summary for commit a532aa4. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor Agent <cursor-agent@onkernel.com>
1 parent 500235f commit d9a77c7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

cmd/browsers_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ func (f *FakeFSService) WriteFile(ctx context.Context, id string, contents io.Re
590590
type FakeProcessService struct {
591591
ExecFunc func(ctx context.Context, id string, body kernel.BrowserProcessExecParams, opts ...option.RequestOption) (*kernel.BrowserProcessExecResponse, error)
592592
KillFunc func(ctx context.Context, processID string, params kernel.BrowserProcessKillParams, opts ...option.RequestOption) (*kernel.BrowserProcessKillResponse, error)
593+
ResizeFunc func(ctx context.Context, processID string, params kernel.BrowserProcessResizeParams, opts ...option.RequestOption) (*kernel.BrowserProcessResizeResponse, error)
593594
SpawnFunc func(ctx context.Context, id string, body kernel.BrowserProcessSpawnParams, opts ...option.RequestOption) (*kernel.BrowserProcessSpawnResponse, error)
594595
StatusFunc func(ctx context.Context, processID string, query kernel.BrowserProcessStatusParams, opts ...option.RequestOption) (*kernel.BrowserProcessStatusResponse, error)
595596
StdinFunc func(ctx context.Context, processID string, params kernel.BrowserProcessStdinParams, opts ...option.RequestOption) (*kernel.BrowserProcessStdinResponse, error)
@@ -632,6 +633,12 @@ func (f *FakeProcessService) StdoutStreamStreaming(ctx context.Context, processI
632633
}
633634
return makeStream([]kernel.BrowserProcessStdoutStreamResponse{{Stream: kernel.BrowserProcessStdoutStreamResponseStreamStdout, DataB64: "aGVsbG8=", Event: ""}, {Event: "exit", ExitCode: 0}})
634635
}
636+
func (f *FakeProcessService) Resize(ctx context.Context, processID string, params kernel.BrowserProcessResizeParams, opts ...option.RequestOption) (*kernel.BrowserProcessResizeResponse, error) {
637+
if f.ResizeFunc != nil {
638+
return f.ResizeFunc(ctx, processID, params, opts...)
639+
}
640+
return &kernel.BrowserProcessResizeResponse{Ok: true}, nil
641+
}
635642

636643
type FakeLogService struct {
637644
StreamFunc func(ctx context.Context, id string, query kernel.BrowserLogStreamParams, opts ...option.RequestOption) *ssestream.Stream[shared.LogEvent]

0 commit comments

Comments
 (0)