( t testing.TB, mockConn *agentconnmock.MockAgentConn, geometry workspacesdk.DesktopGeometry, times int, screenshotPNG string, )
| 1020 | } |
| 1021 | |
| 1022 | func recordDesktopActions( |
| 1023 | t testing.TB, |
| 1024 | mockConn *agentconnmock.MockAgentConn, |
| 1025 | geometry workspacesdk.DesktopGeometry, |
| 1026 | times int, |
| 1027 | screenshotPNG string, |
| 1028 | ) *[]workspacesdk.DesktopAction { |
| 1029 | t.Helper() |
| 1030 | actions := make([]workspacesdk.DesktopAction, 0, times) |
| 1031 | mockConn.EXPECT().ExecuteDesktopAction( |
| 1032 | gomock.Any(), |
| 1033 | gomock.AssignableToTypeOf(workspacesdk.DesktopAction{}), |
| 1034 | ).DoAndReturn(func(_ context.Context, action workspacesdk.DesktopAction) (workspacesdk.DesktopActionResponse, error) { |
| 1035 | actions = append(actions, action) |
| 1036 | if action.Action == "screenshot" { |
| 1037 | return workspacesdk.DesktopActionResponse{ |
| 1038 | Output: "screenshot", |
| 1039 | ScreenshotData: screenshotPNG, |
| 1040 | ScreenshotWidth: geometry.DeclaredWidth, |
| 1041 | ScreenshotHeight: geometry.DeclaredHeight, |
| 1042 | }, nil |
| 1043 | } |
| 1044 | return workspacesdk.DesktopActionResponse{Output: action.Action + " performed"}, nil |
| 1045 | }).Times(times) |
| 1046 | return &actions |
| 1047 | } |
| 1048 | |
| 1049 | func assertDesktopActionScaled( |
| 1050 | t testing.TB, |
no test coverage detected