• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16import { paramMock } from "../utils"
17
18export function mockUtil() {
19  const TextDecoderClass = class TextDecoder {
20    constructor(...args) {
21      console.warn("util.TextDecoder.constructor interface mocked in the Previewer. How this interface works on the Previewer" +
22        " may be different from that on a real device.");
23      this.decode = function (...args) {
24        console.warn("TextDecoder.decode interface mocked in the Previewer. How this interface works on the Previewer" +
25          " may be different from that on a real device.");
26        return paramMock.paramStringMock;
27      };
28      this.decodeWithStream = function (...args) {
29        console.warn("TextDecoder.decodeWithStream interface mocked in the Previewer. How this interface works on the Previewer" +
30          " may be different from that on a real device.");
31        return paramMock.paramStringMock;
32      };
33      this.encoding = "[PC preview] unknow encoding";
34      this.fatal = "[PC preview] unknow fatal";
35      this.ignoreBOM = "[PC preview] unknow ignoreBOM"
36    }
37  };
38
39  const TextEncoderClass = class TextEncoder {
40    constructor(...args) {
41      console.warn("util.TextEncoder.constructor interface mocked in the Previewer. How this interface works on the Previewer" +
42        " may be different from that on a real device.");
43      this.encode = function (...args) {
44        console.warn("TextEncoder.encode interface mocked in the Previewer. How this interface works on the Previewer" +
45          " may be different from that on a real device.");
46        const arr = new Uint8Array()
47        return arr;
48      };
49      this.encodeInto = function (...args) {
50        console.warn("TextEncoder.encodeInto interface mocked in the Previewer. How this interface works on the Previewer" +
51          " may be different from that on a real device.");
52        return paramMock.paramObjectMock;
53      };
54      this.encoding = "[PC preview] unknow encoding"
55    }
56  };
57
58  const RationalNumberClass = class RationalNumber {
59    constructor(...args) {
60      console.warn("util.RationalNumber.constructor interface mocked in the Previewer. How this interface works on the Previewer" +
61        " may be different from that on a real device.");
62      this.compareTo = function (...args) {
63        console.warn("RationalNumber.compareTo​ interface mocked in the Previewer. How this interface works on the Previewer" +
64          " may be different from that on a real device.");
65        return paramMock.paramNumberMock;
66      };
67      this.equals = function (...args) {
68        console.warn("RationalNumber.equals​ interface mocked in the Previewer. How this interface works on the Previewer" +
69          " may be different from that on a real device.");
70        return paramMock.paramBooleanMock;
71      };
72      this.valueOf = function (...args) {
73        console.warn("RationalNumber.valueOf interface mocked in the Previewer. How this interface works on the Previewer" +
74          " may be different from that on a real device.");
75        return paramMock.paramNumberMock;
76      };
77      this.getDenominator = function (...args) {
78        console.warn("RationalNumber.getDenominator​ interface mocked in the Previewer. How this interface works on the Previewer" +
79          " may be different from that on a real device.");
80        return paramMock.paramNumberMock;
81      };
82      this.getNumerator = function (...args) {
83        console.warn("RationalNumber.getNumerator​ interface mocked in the Previewer. How this interface works on the Previewer" +
84          " may be different from that on a real device.");
85        return paramMock.paramNumberMock;
86      };
87      this.isFinite = function (...args) {
88        console.warn("RationalNumber.isFinite​ interface mocked in the Previewer. How this interface works on the Previewer" +
89          " may be different from that on a real device.");
90        return paramMock.paramBooleanMock;
91      };
92      this.isNaN = function (...args) {
93        console.warn("RationalNumber.isNaN​ interface mocked in the Previewer. How this interface works on the Previewer" +
94          " may be different from that on a real device.");
95        return paramMock.paramBooleanMock;
96      };
97      this.isZero = function (...args) {
98        console.warn("RationalNumber.isZero​ interface mocked in the Previewer. How this interface works on the Previewer" +
99          " may be different from that on a real device.");
100        return paramMock.paramBooleanMock;
101      };
102      this.toString = function (...args) {
103        console.warn("RationalNumber.toString interface mocked in the Previewer. How this interface works on the Previewer" +
104          "may be different from that on a real device.");
105        return paramMock.paramStringMock;
106      }
107    }
108  };
109
110  RationalNumberClass.getCommonDivisor = function (...args) {
111    console.warn("RationalNumber.getDenominator​ interface mocked in the Previewer. How this interface works on the Previewer" +
112      " may be different from that on a real device.");
113    return paramMock.paramNumberMock;
114  };
115
116  RationalNumberClass.createRationalFromString = function (...args) {
117    console.warn("RationalNumber.createRationalFromString​ interface mocked in the Previewer. How this interface works on the Previewer" +
118      " may be different from that on a real device.");
119    return new RationalNumberClass();
120  };
121
122  const LruBufferClass = class LruBuffer {
123    constructor(...args) {
124      console.warn("util.LruBuffer.constructor interface mocked in the Previewer. How this interface works on the Previewer" +
125        " may be different from that on a real device.");
126      this.updateCapacity = function (...args) {
127        console.warn("LruBuffer.updateCapacity interface mockecd in the Previewer. How this interface works on the Previewer" +
128          "may be different from that on a real device.");
129      };
130      this.toString = function (...args) {
131        console.warn("LruBuffer.toString interface mockecd in the Previewer. How this interface works on the Previewer" +
132          "may be different from that on a real device.");
133        return paramMock.paramStringMock;
134      };
135      this.getCapacity = function (...args) {
136        console.warn("LruBuffer.getCapacity interface mockecd in the Previewer. How this interface works on the Previewer" +
137          "may be different from that on a real device.");
138        return paramMock.paramNumberMock;
139      };
140      this.clear = function (...args) {
141        console.warn("LruBuffer.clear interface mockecd in the Previewer. How this interface works on the Previewer" +
142          "may be different from that on a real device.");
143      };
144      this.getCreateCount = function (...args) {
145        console.warn("LruBuffer.getCreateCount interface mockecd in the Previewer. How this interface works on the Previewer" +
146          "may be different from that on a real device.");
147        return paramMock.paramNumberMock;
148      };
149      this.getMissCount = function (...args) {
150        console.warn("LruBuffer.getMissCount interface mockecd in the Previewer. How this interface works on the Previewer" +
151          "may be different from that on a real device.");
152        return paramMock.paramNumberMock;
153      };
154      this.getRemovalCount = function (...args) {
155        console.warn("LruBuffer.getRemovalCount interface mockecd in the Previewer. How this interface works on the Previewer" +
156          "may be different from that on a real device.");
157        return paramMock.paramNumberMock;
158      };
159      this.getMatchCount = function (...args) {
160        console.warn("LruBuffer.getMatchCount interface mockecd in the Previewer. How this interface works on the Previewer" +
161          "may be different from that on a real device.");
162        return paramMock.paramNumberMock;
163      };
164      this.getPutCount = function (...args) {
165        console.warn("LruBuffer.getPutCount interface mockecd in the Previewer. How this interface works on the Previewer" +
166          "may be different from that on a real device.");
167        return paramMock.paramNumberMock;
168      };
169      this.isEmpty = function (...args) {
170        console.warn("LruBuffer.isEmpty​ interface mockecd in the Previewer. How this interface works on the Previewer" +
171          "may be different from that on a real device.");
172        return paramMock.paramBooleanMock;
173      };
174      this.get = function (...args) {
175        console.warn("LruBuffer.get interface mockecd in the Previewer. How this interface works on the Previewer" +
176          "may be different from that on a real device.");
177        return paramMock.paramObjectMock;
178      };
179      this.put = function (...args) {
180        console.warn("LruBuffer.put interface mockecd in the Previewer. How this interface works on the Previewer" +
181          "may be different from that on a real device.");
182        return paramMock.paramObjectMock;
183      };
184      this.values = function (...args) {
185        console.warn("LruBuffer.values interface mockecd in the Previewer. How this interface works on the Previewer" +
186          "may be different from that on a real device.");
187        return paramMock.paramArrayMock;
188      };
189      this.keys = function (...args) {
190        console.warn("LruBuffer.keys​ interface mockecd in the Previewer. How this interface works on the Previewer" +
191          "may be different from that on a real device.");
192        return paramMock.paramArrayMock;
193      };
194      this.remove = function (...args) {
195        console.warn("LruBuffer.remove interface mockecd in the Previewer. How this interface works on the Previewer" +
196          "may be different from that on a real device.");
197        return paramMock.paramObjectMock;
198      };
199      this.afterRemoval = function (...args) {
200        console.warn("LruBuffer.afterRemoval interface mockecd in the Previewer. How this interface works on the Previewer" +
201          "may be different from that on a real device.");
202      };
203      this.contains = function (...args) {
204        console.warn("LruBuffer.contains​ interface mockecd in the Previewer. How this interface works on the Previewer" +
205          "may be different from that on a real device.");
206        return paramMock.paramBooleanMock;
207      };
208      this.createDefault = function (...args) {
209        console.warn("LruBuffer.createDefault​ interface mockecd in the Previewer. How this interface works on the Previewer" +
210          "may be different from that on a real device.");
211        return paramMock.paramObjectMock;
212      };
213      this.entries = function (...args) {
214        console.warn("LruBuffer.entries interface mockecd in the Previewer. How this interface works on the Previewer" +
215          "may be different from that on a real device.");
216        return paramMock.paramArrayMock;
217      };
218      this[Symbol.iterator] = function (...args) {
219        console.warn("LruBuffer.[Symbol.iterator] interface mockecd in the Previewer. How this interface works on the Previewer" +
220          "may be different from that on a real device.");
221        return paramMock.paramArrayMock;
222      };
223      this.length = "[PC preview] unknow length"
224    }
225  };
226
227  const ScopeComparableMock = {
228    compareTo: function(...args) {
229      console.warn("ScopeComparable.compareTo interface mocked in the Previewer. How this interface works on the Previewer" +
230        " may be different from that on a real device.");
231      return paramMock.paramBooleanMock;
232    }
233  };
234
235  const ScopeType = "[PC preview] unknow ScopeType";
236
237  const ScopeClass = class Scope {
238    constructor(...args) {
239      console.warn("util.Scope.constructor interface mocked in the Previewer. How this interface works on the Previewer" +
240        " may be different from that on a real device.");
241      this.toString = function (...args) {
242        console.warn("Scope.toString interface mockecd in the Previewer. How this interface works on the Previewer" +
243          "may be different from that on a real device.");
244        return paramMock.paramStringMock;
245      };
246      this.intersect = function (...args) {
247        console.warn("Scope.intersect interface mockecd in the Previewer. How this interface works on the Previewer" +
248          "may be different from that on a real device.");
249        return new ScopeClass();
250      };
251      this.getUpper = function (...args) {
252        console.warn("Scope.getUpper interface mockecd in the Previewer. How this interface works on the Previewer" +
253          "may be different from that on a real device.");
254        return ScopeType;
255      };
256      this.getLower = function (...args) {
257        console.warn("Scope.getLower interface mockecd in the Previewer. How this interface works on the Previewer" +
258          "may be different from that on a real device.");
259        return ScopeType;
260      };
261      this.expand = function (...args) {
262        console.warn("Scope.expand interface mockecd in the Previewer. How this interface works on the Previewer" +
263          "may be different from that on a real device.");
264        return new ScopeClass();
265      };
266      this.contains = function (...args) {
267        console.warn("Scope.contains interface mockecd in the Previewer. How this interface works on the Previewer" +
268          "may be different from that on a real device.");
269        return paramMock.paramBooleanMock;
270      };
271      this.clamp = function (...args) {
272        console.warn("Scope.clamp interface mockecd in the Previewer. How this interface works on the Previewer" +
273          "may be different from that on a real device.");
274        return ScopeType;
275      }
276    }
277  };
278
279  const Base64Class = class Base64 {
280    constructor(...args) {
281      console.warn("util.Base64.constructor interface mocked in the Previewer. How this interface works on the Previewer" +
282        " may be different from that on a real device.");
283      this.encodeSync = function (...args) {
284        console.warn("Base64.encodeSync interface mocked in the Previewer. How this interface works on the Previewer" +
285          " may be different from that on a real device.");
286        const arr = new Uint8Array()
287        return arr;
288      };
289      this.encodeToStringSync = function (...args) {
290        console.warn("Base64.encodeToStringSync interface mocked in the Previewer. How this interface works on the Previewer" +
291          " may be different from that on a real device.");
292        return paramMock.paramStringMock;
293      };
294      this.decodeSync = function (...args) {
295        console.warn("Base64.decodeSync interface mocked in the Previewer. How this interface works on the Previewer" +
296          " may be different from that on a real device.");
297        const arr = new Uint8Array()
298        return arr;
299      };
300      this.encode = function (...args) {
301        console.warn("Base64.encode interface mocked in the Previewer. How this interface works on the Previewer" +
302          " may be different from that on a real device.");
303        const arr = new Uint8Array()
304        return new Promise((resolve, reject) => {
305          resolve(arr);
306        })
307      };
308      this.encodeToString = function (...args) {
309        console.warn("Base64.encodeToString interface mocked in the Previewer. How this interface works on the Previewer" +
310          " may be different from that on a real device.");
311        return new Promise((resolve, reject) => {
312          resolve(paramMock.paramStringMock);
313        })
314      };
315      this.decode = function (...args) {
316        console.warn("Base64.decode interface mocked in the Previewer. How this interface works on the Previewer" +
317          " may be different from that on a real device.");
318        const arr = new Uint8Array()
319        return new Promise((resolve, reject) => {
320          resolve(arr);
321        })
322      }
323    }
324  };
325
326  const typesClass = class types {
327    constructor(...args) {
328      console.warn("util.types.constructor interface mocked in the Previewer. How this interface works on the Previewer" +
329        " may be different from that on a real device.");
330      this.isAnyArrayBuffer = function (...args) {
331        console.warn("types.isAnyArrayBuffer interface mocked in the Previewer. How this interface works on the Previewer" +
332          " may be different from that on a real device.");
333        return paramMock.paramBooleanMock;
334      };
335      this.isArrayBufferView = function (...args) {
336        console.warn("types.isArrayBufferView interface mocked in the Previewer. How this interface works on the Previewer" +
337          " may be different from that on a real device.");
338        return paramMock.paramBooleanMock;
339      };
340      this.isArgumentsObject = function (...args) {
341        console.warn("types.isArgumentsObject interface mocked in the Previewer. How this interface works on the Previewer" +
342          " may be different from that on a real device.");
343        return paramMock.paramBooleanMock;
344      };
345      this.isArrayBuffer = function (...args) {
346        console.warn("types.isArrayBuffer interface mocked in the Previewer. How this interface works on the Previewer" +
347          " may be different from that on a real device.");
348        return paramMock.paramBooleanMock;
349      };
350      this.isAsyncFunction = function (...args) {
351        console.warn("types.isAsyncFunction interface mocked in the Previewer. How this interface works on the Previewer" +
352          " may be different from that on a real device.");
353        return paramMock.paramBooleanMock;
354      };
355      this.isBigInt64Array = function (...args) {
356        console.warn("types.isBigInt64Array interface mocked in the Previewer. How this interface works on the Previewer" +
357          " may be different from that on a real device.");
358        return paramMock.paramBooleanMock;
359      };
360      this.isBigUint64Array = function (...args) {
361        console.warn("types.isBigUint64Array interface mocked in the Previewer. How this interface works on the Previewer" +
362          " may be different from that on a real device.");
363        return paramMock.paramBooleanMock;
364      };
365      this.isBooleanObject = function (...args) {
366        console.warn("types.isBooleanObject interface mocked in the Previewer. How this interface works on the Previewer" +
367          " may be different from that on a real device.");
368        return paramMock.paramBooleanMock;
369      };
370      this.isBoxedPrimitive = function (...args) {
371        console.warn("types.isBoxedPrimitive interface mocked in the Previewer. How this interface works on the Previewer" +
372          " may be different from that on a real device.");
373        return paramMock.paramBooleanMock;
374      };
375      this.isDataView = function (...args) {
376        console.warn("types.isDataView interface mocked in the Previewer. How this interface works on the Previewer" +
377          " may be different from that on a real device.");
378        return paramMock.paramBooleanMock;
379      };
380      this.isDate = function (...args) {
381        console.warn("types.isDate interface mocked in the Previewer. How this interface works on the Previewer" +
382          " may be different from that on a real device.");
383        return paramMock.paramBooleanMock;
384      };
385      this.isExternal = function (...args) {
386        console.warn("types.isExternal interface mocked in the Previewer. How this interface works on the Previewer" +
387          " may be different from that on a real device.");
388        return paramMock.paramBooleanMock;
389      };
390      this.isFloat32Array = function (...args) {
391        console.warn("types.isFloat32Array interface mocked in the Previewer. How this interface works on the Previewer" +
392          " may be different from that on a real device.");
393        return paramMock.paramBooleanMock;
394      };
395      this.isFloat64Array = function (...args) {
396        console.warn("types.isFloat64Array interface mocked in the Previewer. How this interface works on the Previewer" +
397          " may be different from that on a real device.");
398        return paramMock.paramBooleanMock;
399      };
400      this.isGeneratorFunction = function (...args) {
401        console.warn("types.isGeneratorFunction interface mocked in the Previewer. How this interface works on the Previewer" +
402          " may be different from that on a real device.");
403        return paramMock.paramBooleanMock;
404      };
405      this.isGeneratorObject = function (...args) {
406        console.warn("types.isGeneratorObject interface mocked in the Previewer. How this interface works on the Previewer" +
407          " may be different from that on a real device.");
408        return paramMock.paramBooleanMock;
409      };
410      this.isInt8Array = function (...args) {
411        console.warn("types.isInt8Array interface mocked in the Previewer. How this interface works on the Previewer" +
412          " may be different from that on a real device.");
413        return paramMock.paramBooleanMock;
414      };
415      this.isInt16Array = function (...args) {
416        console.warn("types.isInt16Array interface mocked in the Previewer. How this interface works on the Previewer" +
417          " may be different from that on a real device.");
418        return paramMock.paramBooleanMock;
419      };
420      this.isInt32Array = function (...args) {
421        console.warn("types.isInt32Array interface mocked in the Previewer. How this interface works on the Previewer" +
422          " may be different from that on a real device.");
423        return paramMock.paramBooleanMock;
424      };
425      this.isMap = function (...args) {
426        console.warn("types.isMap interface mocked in the Previewer. How this interface works on the Previewer" +
427          " may be different from that on a real device.");
428        return paramMock.paramBooleanMock;
429      };
430      this.isMapIterator = function (...args) {
431        console.warn("types.isMapIterator interface mocked in the Previewer. How this interface works on the Previewer" +
432          " may be different from that on a real device.");
433        return paramMock.paramBooleanMock;
434      };
435      this.isModuleNamespaceObject = function (...args) {
436        console.warn("types.isModuleNamespaceObject interface mocked in the Previewer. How this interface works on the Previewer" +
437          " may be different from that on a real device.");
438        return paramMock.paramBooleanMock;
439      };
440      this.isNativeError = function (...args) {
441        console.warn("types.isNativeError interface mocked in the Previewer. How this interface works on the Previewer" +
442          " may be different from that on a real device.");
443        return paramMock.paramBooleanMock;
444      };
445      this.isNumberObject = function (...args) {
446        console.warn("types.isNumberObject interface mocked in the Previewer. How this interface works on the Previewer" +
447          " may be different from that on a real device.");
448        return paramMock.paramBooleanMock;
449      };
450      this.isPromise = function (...args) {
451        console.warn("types.isPromise interface mocked in the Previewer. How this interface works on the Previewer" +
452          " may be different from that on a real device.");
453        return paramMock.paramBooleanMock;
454      };
455      this.isProxy = function (...args) {
456        console.warn("types.isProxy interface mocked in the Previewer. How this interface works on the Previewer" +
457          " may be different from that on a real device.");
458        return paramMock.paramBooleanMock;
459      };
460      this.isRegExp = function (...args) {
461        console.warn("types.isRegExp interface mocked in the Previewer. How this interface works on the Previewer" +
462          " may be different from that on a real device.");
463        return paramMock.paramBooleanMock;
464      };
465      this.isSet = function (...args) {
466        console.warn("types.isSet interface mocked in the Previewer. How this interface works on the Previewer" +
467          " may be different from that on a real device.");
468        return paramMock.paramBooleanMock;
469      };
470      this.isSetIterator = function (...args) {
471        console.warn("types.isSetIterator interface mocked in the Previewer. How this interface works on the Previewer" +
472          " may be different from that on a real device.");
473        return paramMock.paramBooleanMock;
474      };
475      this.isSharedArrayBuffer = function (...args) {
476        console.warn("types.isSharedArrayBuffer interface mocked in the Previewer. How this interface works on the Previewer" +
477          " may be different from that on a real device.");
478        return paramMock.paramBooleanMock;
479      };
480      this.isStringObject = function (...args) {
481        console.warn("types.isStringObject interface mocked in the Previewer. How this interface works on the Previewer" +
482          " may be different from that on a real device.");
483        return paramMock.paramBooleanMock;
484      };
485      this.isSymbolObject = function (...args) {
486        console.warn("types.isSymbolObject interface mocked in the Previewer. How this interface works on the Previewer" +
487          " may be different from that on a real device.");
488        return paramMock.paramBooleanMock;
489      };
490      this.isTypedArray = function (...args) {
491        console.warn("types.isTypedArray interface mocked in the Previewer. How this interface works on the Previewer" +
492          " may be different from that on a real device.");
493        return paramMock.paramBooleanMock;
494      };
495      this.isUint8Array = function (...args) {
496        console.warn("types.isUint8Array interface mocked in the Previewer. How this interface works on the Previewer" +
497          " may be different from that on a real device.");
498        return paramMock.paramBooleanMock;
499      };
500      this.isUint8ClampedArray = function (...args) {
501        console.warn("types.isUint8ClampedArray interface mocked in the Previewer. How this interface works on the Previewer" +
502          " may be different from that on a real device.");
503        return paramMock.paramBooleanMock;
504      };
505      this.isUint16Array = function (...args) {
506        console.warn("types.isUint16Array interface mocked in the Previewer. How this interface works on the Previewer" +
507          " may be different from that on a real device.");
508        return paramMock.paramBooleanMock;
509      };
510      this.isUint32Array = function (...args) {
511        console.warn("types.isUint32Array interface mocked in the Previewer. How this interface works on the Previewer" +
512          " may be different from that on a real device.");
513        return paramMock.paramBooleanMock;
514      };
515      this.isWeakMap = function (...args) {
516        console.warn("types.isWeakMap interface mocked in the Previewer. How this interface works on the Previewer" +
517          " may be different from that on a real device.");
518        return paramMock.paramBooleanMock;
519      };
520      this.isWeakSet = function (...args) {
521        console.warn("types.isWeakSet interface mocked in the Previewer. How this interface works on the Previewer" +
522          " may be different from that on a real device.");
523        return paramMock.paramBooleanMock;
524      }
525    }
526  };
527
528  const utilMock = {
529    TextDecoder : TextDecoderClass,
530    TextEncoder : TextEncoderClass,
531    RationalNumber : RationalNumberClass,
532    LruBuffer : LruBufferClass,
533    Scope : ScopeClass,
534    Base64 : Base64Class,
535    types : typesClass,
536    printf: function (...args) {
537      console.warn("util.printf interface mocked in the Previewer. How this interface works on the Previewer" +
538        " may be different from that on a real device.");
539      return paramMock.paramStringMock;
540    },
541    getErrorString: function (...args) {
542      console.warn("util.getErrorString interface mocked in the Previewer. How this interface works on the Previewer" +
543        " may be different from that on a real device.");
544      return paramMock.paramStringMock;
545    },
546    callbackWrapper: function (...args) {
547      console.warn("util.callbackWrapper interface mocked in the Previewer. How this interface works on the Previewer" +
548        " may be different from that on a real device.");
549    },
550    promiseWrapper: function (...args) {
551      console.warn("util.promiseWrapper interface mocked in the Previewer. How this interface works on the Previewer" +
552        " may be different from that on a real device.");
553      return paramMock.paramObjectMock;
554    },
555    promisify: function (...args) {
556      console.warn("util.promisify interface mocked in the Previewer. How this interface works on the Previewer" +
557        " may be different from that on a real device.");
558      return paramMock.paramObjectMock;
559    },
560    randomUUID: function (...args) {
561      console.warn("util.randomUUID interface mocked in the Previewer. How this interface works on the Previewer" +
562        " may be different from that on a real device.");
563      return paramMock.paramStringMock;
564    },
565    randomBinaryUUID: function (...args) {
566      console.warn("util.randomBinaryUUID interface mocked in the Previewer. How this interface works on the Previewer" +
567        " may be different from that on a real device.");
568      return paramMock.paramArrayMock;
569    },
570    parseUUID: function (...args) {
571      console.warn("util.parseUUID interface mocked in the Previewer. How this interface works on the Previewer" +
572        " may be different from that on a real device.");
573      return paramMock.paramArrayMock;
574    }
575  };
576  return utilMock;
577}
578