@dcl/protocol 1.0.0-9079009942.commit-57ffac6 → 1.0.0-9115457439.commit-926ebd1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out-js/decentraland/kernel/apis/testing.gen.d.ts +89 -0
- package/out-js/decentraland/kernel/apis/testing.gen.js +408 -1
- package/out-js/decentraland/kernel/apis/testing.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/avatar_attach.gen.d.ts +22 -7
- package/out-js/decentraland/sdk/components/avatar_attach.gen.js +123 -33
- package/out-js/decentraland/sdk/components/avatar_attach.gen.js.map +1 -1
- package/out-ts/decentraland/kernel/apis/testing.gen.ts +511 -0
- package/out-ts/decentraland/sdk/components/avatar_attach.gen.ts +123 -33
- package/package.json +2 -2
- package/proto/decentraland/kernel/apis/testing.proto +47 -0
- package/proto/decentraland/sdk/components/avatar_attach.proto +23 -8
|
@@ -1,8 +1,95 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
+
import { Vector2, Vector3 } from "../../common/vectors.gen";
|
|
3
4
|
|
|
4
5
|
export const protobufPackage = "decentraland.kernel.apis";
|
|
5
6
|
|
|
7
|
+
/** @internal */
|
|
8
|
+
export interface TakeAndCompareScreenshotRequest {
|
|
9
|
+
/**
|
|
10
|
+
* the source path in the scene where the screenshot is stored,
|
|
11
|
+
* the snapshot taken is compared with the stored one
|
|
12
|
+
*/
|
|
13
|
+
srcStoredSnapshot: string;
|
|
14
|
+
/** the camera position where is set before and while taking the screenshot, relative to base scene */
|
|
15
|
+
cameraPosition:
|
|
16
|
+
| Vector3
|
|
17
|
+
| undefined;
|
|
18
|
+
/** the camera position where is target to before and while taking the screenshot, relative to base scene */
|
|
19
|
+
cameraTarget:
|
|
20
|
+
| Vector3
|
|
21
|
+
| undefined;
|
|
22
|
+
/** width x height screenshot size */
|
|
23
|
+
screenshotSize: Vector2 | undefined;
|
|
24
|
+
comparisonMethod?: {
|
|
25
|
+
$case: "greyPixelDiff";
|
|
26
|
+
greyPixelDiff: TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff;
|
|
27
|
+
} | undefined;
|
|
28
|
+
snapshotMode: TakeAndCompareScreenshotRequest_SnapshotMode;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export enum TakeAndCompareScreenshotRequest_SnapshotMode {
|
|
32
|
+
/** SM_3D_AND_UI - only visible 3d scene and ui scene */
|
|
33
|
+
SM_3D_AND_UI = 0,
|
|
34
|
+
/** SM_3D_ONLY - only visible 3d scene */
|
|
35
|
+
SM_3D_ONLY = 1,
|
|
36
|
+
/** SM_UI_ONLY - only visible ui scene */
|
|
37
|
+
SM_UI_ONLY = 2,
|
|
38
|
+
UNRECOGNIZED = -1,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function takeAndCompareScreenshotRequest_SnapshotModeFromJSON(
|
|
42
|
+
object: any,
|
|
43
|
+
): TakeAndCompareScreenshotRequest_SnapshotMode {
|
|
44
|
+
switch (object) {
|
|
45
|
+
case 0:
|
|
46
|
+
case "SM_3D_AND_UI":
|
|
47
|
+
return TakeAndCompareScreenshotRequest_SnapshotMode.SM_3D_AND_UI;
|
|
48
|
+
case 1:
|
|
49
|
+
case "SM_3D_ONLY":
|
|
50
|
+
return TakeAndCompareScreenshotRequest_SnapshotMode.SM_3D_ONLY;
|
|
51
|
+
case 2:
|
|
52
|
+
case "SM_UI_ONLY":
|
|
53
|
+
return TakeAndCompareScreenshotRequest_SnapshotMode.SM_UI_ONLY;
|
|
54
|
+
case -1:
|
|
55
|
+
case "UNRECOGNIZED":
|
|
56
|
+
default:
|
|
57
|
+
return TakeAndCompareScreenshotRequest_SnapshotMode.UNRECOGNIZED;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function takeAndCompareScreenshotRequest_SnapshotModeToJSON(
|
|
62
|
+
object: TakeAndCompareScreenshotRequest_SnapshotMode,
|
|
63
|
+
): string {
|
|
64
|
+
switch (object) {
|
|
65
|
+
case TakeAndCompareScreenshotRequest_SnapshotMode.SM_3D_AND_UI:
|
|
66
|
+
return "SM_3D_AND_UI";
|
|
67
|
+
case TakeAndCompareScreenshotRequest_SnapshotMode.SM_3D_ONLY:
|
|
68
|
+
return "SM_3D_ONLY";
|
|
69
|
+
case TakeAndCompareScreenshotRequest_SnapshotMode.SM_UI_ONLY:
|
|
70
|
+
return "SM_UI_ONLY";
|
|
71
|
+
case TakeAndCompareScreenshotRequest_SnapshotMode.UNRECOGNIZED:
|
|
72
|
+
default:
|
|
73
|
+
return "UNRECOGNIZED";
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff {
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** @internal */
|
|
81
|
+
export interface TakeAndCompareScreenshotResponse {
|
|
82
|
+
storedSnapshotFound: boolean;
|
|
83
|
+
comparisonMethodResult?: {
|
|
84
|
+
$case: "greyPixelDiff";
|
|
85
|
+
greyPixelDiff: TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult;
|
|
86
|
+
} | undefined;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult {
|
|
90
|
+
similarity: number;
|
|
91
|
+
}
|
|
92
|
+
|
|
6
93
|
export interface TestResult {
|
|
7
94
|
name: string;
|
|
8
95
|
ok: boolean;
|
|
@@ -51,6 +138,417 @@ export interface SetCameraTransformTestCommand_Quaternion {
|
|
|
51
138
|
export interface SetCameraTransformTestCommandResponse {
|
|
52
139
|
}
|
|
53
140
|
|
|
141
|
+
function createBaseTakeAndCompareScreenshotRequest(): TakeAndCompareScreenshotRequest {
|
|
142
|
+
return {
|
|
143
|
+
srcStoredSnapshot: "",
|
|
144
|
+
cameraPosition: undefined,
|
|
145
|
+
cameraTarget: undefined,
|
|
146
|
+
screenshotSize: undefined,
|
|
147
|
+
comparisonMethod: undefined,
|
|
148
|
+
snapshotMode: 0,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export namespace TakeAndCompareScreenshotRequest {
|
|
153
|
+
export function encode(
|
|
154
|
+
message: TakeAndCompareScreenshotRequest,
|
|
155
|
+
writer: _m0.Writer = _m0.Writer.create(),
|
|
156
|
+
): _m0.Writer {
|
|
157
|
+
if (message.srcStoredSnapshot !== "") {
|
|
158
|
+
writer.uint32(10).string(message.srcStoredSnapshot);
|
|
159
|
+
}
|
|
160
|
+
if (message.cameraPosition !== undefined) {
|
|
161
|
+
Vector3.encode(message.cameraPosition, writer.uint32(18).fork()).ldelim();
|
|
162
|
+
}
|
|
163
|
+
if (message.cameraTarget !== undefined) {
|
|
164
|
+
Vector3.encode(message.cameraTarget, writer.uint32(26).fork()).ldelim();
|
|
165
|
+
}
|
|
166
|
+
if (message.screenshotSize !== undefined) {
|
|
167
|
+
Vector2.encode(message.screenshotSize, writer.uint32(34).fork()).ldelim();
|
|
168
|
+
}
|
|
169
|
+
switch (message.comparisonMethod?.$case) {
|
|
170
|
+
case "greyPixelDiff":
|
|
171
|
+
TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff.encode(
|
|
172
|
+
message.comparisonMethod.greyPixelDiff,
|
|
173
|
+
writer.uint32(42).fork(),
|
|
174
|
+
).ldelim();
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
if (message.snapshotMode !== 0) {
|
|
178
|
+
writer.uint32(48).int32(message.snapshotMode);
|
|
179
|
+
}
|
|
180
|
+
return writer;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export function decode(input: _m0.Reader | Uint8Array, length?: number): TakeAndCompareScreenshotRequest {
|
|
184
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
185
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
186
|
+
const message = createBaseTakeAndCompareScreenshotRequest();
|
|
187
|
+
while (reader.pos < end) {
|
|
188
|
+
const tag = reader.uint32();
|
|
189
|
+
switch (tag >>> 3) {
|
|
190
|
+
case 1:
|
|
191
|
+
if (tag !== 10) {
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
message.srcStoredSnapshot = reader.string();
|
|
196
|
+
continue;
|
|
197
|
+
case 2:
|
|
198
|
+
if (tag !== 18) {
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
message.cameraPosition = Vector3.decode(reader, reader.uint32());
|
|
203
|
+
continue;
|
|
204
|
+
case 3:
|
|
205
|
+
if (tag !== 26) {
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
message.cameraTarget = Vector3.decode(reader, reader.uint32());
|
|
210
|
+
continue;
|
|
211
|
+
case 4:
|
|
212
|
+
if (tag !== 34) {
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
message.screenshotSize = Vector2.decode(reader, reader.uint32());
|
|
217
|
+
continue;
|
|
218
|
+
case 5:
|
|
219
|
+
if (tag !== 42) {
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
message.comparisonMethod = {
|
|
224
|
+
$case: "greyPixelDiff",
|
|
225
|
+
greyPixelDiff: TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff.decode(
|
|
226
|
+
reader,
|
|
227
|
+
reader.uint32(),
|
|
228
|
+
),
|
|
229
|
+
};
|
|
230
|
+
continue;
|
|
231
|
+
case 6:
|
|
232
|
+
if (tag !== 48) {
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
message.snapshotMode = reader.int32() as any;
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
reader.skipType(tag & 7);
|
|
243
|
+
}
|
|
244
|
+
return message;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export function fromJSON(object: any): TakeAndCompareScreenshotRequest {
|
|
248
|
+
return {
|
|
249
|
+
srcStoredSnapshot: isSet(object.srcStoredSnapshot) ? String(object.srcStoredSnapshot) : "",
|
|
250
|
+
cameraPosition: isSet(object.cameraPosition) ? Vector3.fromJSON(object.cameraPosition) : undefined,
|
|
251
|
+
cameraTarget: isSet(object.cameraTarget) ? Vector3.fromJSON(object.cameraTarget) : undefined,
|
|
252
|
+
screenshotSize: isSet(object.screenshotSize) ? Vector2.fromJSON(object.screenshotSize) : undefined,
|
|
253
|
+
comparisonMethod: isSet(object.greyPixelDiff)
|
|
254
|
+
? {
|
|
255
|
+
$case: "greyPixelDiff",
|
|
256
|
+
greyPixelDiff: TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff.fromJSON(object.greyPixelDiff),
|
|
257
|
+
}
|
|
258
|
+
: undefined,
|
|
259
|
+
snapshotMode: isSet(object.snapshotMode)
|
|
260
|
+
? takeAndCompareScreenshotRequest_SnapshotModeFromJSON(object.snapshotMode)
|
|
261
|
+
: 0,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export function toJSON(message: TakeAndCompareScreenshotRequest): unknown {
|
|
266
|
+
const obj: any = {};
|
|
267
|
+
message.srcStoredSnapshot !== undefined && (obj.srcStoredSnapshot = message.srcStoredSnapshot);
|
|
268
|
+
message.cameraPosition !== undefined &&
|
|
269
|
+
(obj.cameraPosition = message.cameraPosition ? Vector3.toJSON(message.cameraPosition) : undefined);
|
|
270
|
+
message.cameraTarget !== undefined &&
|
|
271
|
+
(obj.cameraTarget = message.cameraTarget ? Vector3.toJSON(message.cameraTarget) : undefined);
|
|
272
|
+
message.screenshotSize !== undefined &&
|
|
273
|
+
(obj.screenshotSize = message.screenshotSize ? Vector2.toJSON(message.screenshotSize) : undefined);
|
|
274
|
+
message.comparisonMethod?.$case === "greyPixelDiff" &&
|
|
275
|
+
(obj.greyPixelDiff = message.comparisonMethod?.greyPixelDiff
|
|
276
|
+
? TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff.toJSON(message.comparisonMethod?.greyPixelDiff)
|
|
277
|
+
: undefined);
|
|
278
|
+
message.snapshotMode !== undefined &&
|
|
279
|
+
(obj.snapshotMode = takeAndCompareScreenshotRequest_SnapshotModeToJSON(message.snapshotMode));
|
|
280
|
+
return obj;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export function create<I extends Exact<DeepPartial<TakeAndCompareScreenshotRequest>, I>>(
|
|
284
|
+
base?: I,
|
|
285
|
+
): TakeAndCompareScreenshotRequest {
|
|
286
|
+
return TakeAndCompareScreenshotRequest.fromPartial(base ?? {});
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export function fromPartial<I extends Exact<DeepPartial<TakeAndCompareScreenshotRequest>, I>>(
|
|
290
|
+
object: I,
|
|
291
|
+
): TakeAndCompareScreenshotRequest {
|
|
292
|
+
const message = createBaseTakeAndCompareScreenshotRequest();
|
|
293
|
+
message.srcStoredSnapshot = object.srcStoredSnapshot ?? "";
|
|
294
|
+
message.cameraPosition = (object.cameraPosition !== undefined && object.cameraPosition !== null)
|
|
295
|
+
? Vector3.fromPartial(object.cameraPosition)
|
|
296
|
+
: undefined;
|
|
297
|
+
message.cameraTarget = (object.cameraTarget !== undefined && object.cameraTarget !== null)
|
|
298
|
+
? Vector3.fromPartial(object.cameraTarget)
|
|
299
|
+
: undefined;
|
|
300
|
+
message.screenshotSize = (object.screenshotSize !== undefined && object.screenshotSize !== null)
|
|
301
|
+
? Vector2.fromPartial(object.screenshotSize)
|
|
302
|
+
: undefined;
|
|
303
|
+
if (
|
|
304
|
+
object.comparisonMethod?.$case === "greyPixelDiff" &&
|
|
305
|
+
object.comparisonMethod?.greyPixelDiff !== undefined &&
|
|
306
|
+
object.comparisonMethod?.greyPixelDiff !== null
|
|
307
|
+
) {
|
|
308
|
+
message.comparisonMethod = {
|
|
309
|
+
$case: "greyPixelDiff",
|
|
310
|
+
greyPixelDiff: TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff.fromPartial(
|
|
311
|
+
object.comparisonMethod.greyPixelDiff,
|
|
312
|
+
),
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
message.snapshotMode = object.snapshotMode ?? 0;
|
|
316
|
+
return message;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function createBaseTakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff(): TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff {
|
|
321
|
+
return {};
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export namespace TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff {
|
|
325
|
+
export function encode(
|
|
326
|
+
_: TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff,
|
|
327
|
+
writer: _m0.Writer = _m0.Writer.create(),
|
|
328
|
+
): _m0.Writer {
|
|
329
|
+
return writer;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export function decode(
|
|
333
|
+
input: _m0.Reader | Uint8Array,
|
|
334
|
+
length?: number,
|
|
335
|
+
): TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff {
|
|
336
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
337
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
338
|
+
const message = createBaseTakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff();
|
|
339
|
+
while (reader.pos < end) {
|
|
340
|
+
const tag = reader.uint32();
|
|
341
|
+
switch (tag >>> 3) {
|
|
342
|
+
}
|
|
343
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
346
|
+
reader.skipType(tag & 7);
|
|
347
|
+
}
|
|
348
|
+
return message;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export function fromJSON(_: any): TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff {
|
|
352
|
+
return {};
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export function toJSON(_: TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff): unknown {
|
|
356
|
+
const obj: any = {};
|
|
357
|
+
return obj;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export function create<
|
|
361
|
+
I extends Exact<DeepPartial<TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff>, I>,
|
|
362
|
+
>(base?: I): TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff {
|
|
363
|
+
return TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff.fromPartial(base ?? {});
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export function fromPartial<
|
|
367
|
+
I extends Exact<DeepPartial<TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff>, I>,
|
|
368
|
+
>(_: I): TakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff {
|
|
369
|
+
const message = createBaseTakeAndCompareScreenshotRequest_ComparisonMethodGreyPixelDiff();
|
|
370
|
+
return message;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
function createBaseTakeAndCompareScreenshotResponse(): TakeAndCompareScreenshotResponse {
|
|
375
|
+
return { storedSnapshotFound: false, comparisonMethodResult: undefined };
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export namespace TakeAndCompareScreenshotResponse {
|
|
379
|
+
export function encode(
|
|
380
|
+
message: TakeAndCompareScreenshotResponse,
|
|
381
|
+
writer: _m0.Writer = _m0.Writer.create(),
|
|
382
|
+
): _m0.Writer {
|
|
383
|
+
if (message.storedSnapshotFound === true) {
|
|
384
|
+
writer.uint32(8).bool(message.storedSnapshotFound);
|
|
385
|
+
}
|
|
386
|
+
switch (message.comparisonMethodResult?.$case) {
|
|
387
|
+
case "greyPixelDiff":
|
|
388
|
+
TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult.encode(
|
|
389
|
+
message.comparisonMethodResult.greyPixelDiff,
|
|
390
|
+
writer.uint32(18).fork(),
|
|
391
|
+
).ldelim();
|
|
392
|
+
break;
|
|
393
|
+
}
|
|
394
|
+
return writer;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
export function decode(input: _m0.Reader | Uint8Array, length?: number): TakeAndCompareScreenshotResponse {
|
|
398
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
399
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
400
|
+
const message = createBaseTakeAndCompareScreenshotResponse();
|
|
401
|
+
while (reader.pos < end) {
|
|
402
|
+
const tag = reader.uint32();
|
|
403
|
+
switch (tag >>> 3) {
|
|
404
|
+
case 1:
|
|
405
|
+
if (tag !== 8) {
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
message.storedSnapshotFound = reader.bool();
|
|
410
|
+
continue;
|
|
411
|
+
case 2:
|
|
412
|
+
if (tag !== 18) {
|
|
413
|
+
break;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
message.comparisonMethodResult = {
|
|
417
|
+
$case: "greyPixelDiff",
|
|
418
|
+
greyPixelDiff: TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult.decode(
|
|
419
|
+
reader,
|
|
420
|
+
reader.uint32(),
|
|
421
|
+
),
|
|
422
|
+
};
|
|
423
|
+
continue;
|
|
424
|
+
}
|
|
425
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
426
|
+
break;
|
|
427
|
+
}
|
|
428
|
+
reader.skipType(tag & 7);
|
|
429
|
+
}
|
|
430
|
+
return message;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
export function fromJSON(object: any): TakeAndCompareScreenshotResponse {
|
|
434
|
+
return {
|
|
435
|
+
storedSnapshotFound: isSet(object.storedSnapshotFound) ? Boolean(object.storedSnapshotFound) : false,
|
|
436
|
+
comparisonMethodResult: isSet(object.greyPixelDiff)
|
|
437
|
+
? {
|
|
438
|
+
$case: "greyPixelDiff",
|
|
439
|
+
greyPixelDiff: TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult.fromJSON(
|
|
440
|
+
object.greyPixelDiff,
|
|
441
|
+
),
|
|
442
|
+
}
|
|
443
|
+
: undefined,
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
export function toJSON(message: TakeAndCompareScreenshotResponse): unknown {
|
|
448
|
+
const obj: any = {};
|
|
449
|
+
message.storedSnapshotFound !== undefined && (obj.storedSnapshotFound = message.storedSnapshotFound);
|
|
450
|
+
message.comparisonMethodResult?.$case === "greyPixelDiff" &&
|
|
451
|
+
(obj.greyPixelDiff = message.comparisonMethodResult?.greyPixelDiff
|
|
452
|
+
? TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult.toJSON(
|
|
453
|
+
message.comparisonMethodResult?.greyPixelDiff,
|
|
454
|
+
)
|
|
455
|
+
: undefined);
|
|
456
|
+
return obj;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
export function create<I extends Exact<DeepPartial<TakeAndCompareScreenshotResponse>, I>>(
|
|
460
|
+
base?: I,
|
|
461
|
+
): TakeAndCompareScreenshotResponse {
|
|
462
|
+
return TakeAndCompareScreenshotResponse.fromPartial(base ?? {});
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
export function fromPartial<I extends Exact<DeepPartial<TakeAndCompareScreenshotResponse>, I>>(
|
|
466
|
+
object: I,
|
|
467
|
+
): TakeAndCompareScreenshotResponse {
|
|
468
|
+
const message = createBaseTakeAndCompareScreenshotResponse();
|
|
469
|
+
message.storedSnapshotFound = object.storedSnapshotFound ?? false;
|
|
470
|
+
if (
|
|
471
|
+
object.comparisonMethodResult?.$case === "greyPixelDiff" &&
|
|
472
|
+
object.comparisonMethodResult?.greyPixelDiff !== undefined &&
|
|
473
|
+
object.comparisonMethodResult?.greyPixelDiff !== null
|
|
474
|
+
) {
|
|
475
|
+
message.comparisonMethodResult = {
|
|
476
|
+
$case: "greyPixelDiff",
|
|
477
|
+
greyPixelDiff: TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult.fromPartial(
|
|
478
|
+
object.comparisonMethodResult.greyPixelDiff,
|
|
479
|
+
),
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
return message;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
function createBaseTakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult(): TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult {
|
|
487
|
+
return { similarity: 0 };
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
export namespace TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult {
|
|
491
|
+
export function encode(
|
|
492
|
+
message: TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult,
|
|
493
|
+
writer: _m0.Writer = _m0.Writer.create(),
|
|
494
|
+
): _m0.Writer {
|
|
495
|
+
if (message.similarity !== 0) {
|
|
496
|
+
writer.uint32(13).float(message.similarity);
|
|
497
|
+
}
|
|
498
|
+
return writer;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
export function decode(
|
|
502
|
+
input: _m0.Reader | Uint8Array,
|
|
503
|
+
length?: number,
|
|
504
|
+
): TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult {
|
|
505
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
506
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
507
|
+
const message = createBaseTakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult();
|
|
508
|
+
while (reader.pos < end) {
|
|
509
|
+
const tag = reader.uint32();
|
|
510
|
+
switch (tag >>> 3) {
|
|
511
|
+
case 1:
|
|
512
|
+
if (tag !== 13) {
|
|
513
|
+
break;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
message.similarity = reader.float();
|
|
517
|
+
continue;
|
|
518
|
+
}
|
|
519
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
520
|
+
break;
|
|
521
|
+
}
|
|
522
|
+
reader.skipType(tag & 7);
|
|
523
|
+
}
|
|
524
|
+
return message;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
export function fromJSON(object: any): TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult {
|
|
528
|
+
return { similarity: isSet(object.similarity) ? Number(object.similarity) : 0 };
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
export function toJSON(message: TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult): unknown {
|
|
532
|
+
const obj: any = {};
|
|
533
|
+
message.similarity !== undefined && (obj.similarity = message.similarity);
|
|
534
|
+
return obj;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
export function create<
|
|
538
|
+
I extends Exact<DeepPartial<TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult>, I>,
|
|
539
|
+
>(base?: I): TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult {
|
|
540
|
+
return TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult.fromPartial(base ?? {});
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
export function fromPartial<
|
|
544
|
+
I extends Exact<DeepPartial<TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult>, I>,
|
|
545
|
+
>(object: I): TakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult {
|
|
546
|
+
const message = createBaseTakeAndCompareScreenshotResponse_ComparisonMethodGreyPixelDiffResult();
|
|
547
|
+
message.similarity = object.similarity ?? 0;
|
|
548
|
+
return message;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
|
|
54
552
|
function createBaseTestResult(): TestResult {
|
|
55
553
|
return { name: "", ok: false, error: undefined, stack: undefined, totalFrames: 0, totalTime: 0 };
|
|
56
554
|
}
|
|
@@ -741,6 +1239,19 @@ export const TestingServiceDefinition = {
|
|
|
741
1239
|
responseStream: false,
|
|
742
1240
|
options: {},
|
|
743
1241
|
},
|
|
1242
|
+
/**
|
|
1243
|
+
* @internal
|
|
1244
|
+
* take a screenshot and compare it with a stored one
|
|
1245
|
+
* it hides the explorer hud and ui, primary player and players of avatar scenes
|
|
1246
|
+
*/
|
|
1247
|
+
takeAndCompareScreenshot: {
|
|
1248
|
+
name: "TakeAndCompareScreenshot",
|
|
1249
|
+
requestType: TakeAndCompareScreenshotRequest,
|
|
1250
|
+
requestStream: false,
|
|
1251
|
+
responseType: TakeAndCompareScreenshotResponse,
|
|
1252
|
+
responseStream: false,
|
|
1253
|
+
options: {},
|
|
1254
|
+
},
|
|
744
1255
|
},
|
|
745
1256
|
} as const;
|
|
746
1257
|
|