• 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 mockConvertXml() {
19  const ConvertXMLClass = class ConvertXML {
20    constructor(...args) {
21      console.warn("convertXml.ConvertXML.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.convert = function (...args) {
24        console.warn("ConvertXML.convert 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.paramObjectMock;
27      }
28     }
29  };
30
31  const ConvertXMLMock = {
32    ConvertXML : ConvertXMLClass
33  };
34
35  const ConvertOptionsMock = {
36    trim : '[PC preview] unknow trim',
37    ignoreDeclaration : '[PC preview] unknow ignoreDeclaration',
38    ignoreInstruction : '[PC preview] unknow ignoreInstruction',
39    ignoreAttributes : '[PC preview] unknow ignoreAttributes',
40    ignoreComment : '[PC preview] unknow ignoreComment',
41    ignoreCDATA : '[PC preview] unknow ignoreCDATA',
42    ignoreDoctype : '[PC preview] unknow ignoreDoctype',
43    ignoreText : '[PC preview] unknow ignoreText',
44    declarationKey : '[PC preview] unknow declarationKey',
45    instructionKey : '[PC preview] unknow instructionKey',
46    attributesKey : '[PC preview] unknow attributesKey',
47    textKey : '[PC preview] unknow textKey',
48    cdataKey : '[PC preview] unknow cdataKey',
49    doctypeKey : '[PC preview] unknow doctypeKey',
50    commentKey : '[PC preview] unknow commentKey',
51    parentKey : '[PC preview] unknow parentKey',
52    typeKey : '[PC preview] unknow typeKey',
53    nameKey : '[PC preview] unknow nameKey',
54    elementsKey : '[PC preview] unknow elementsKey'
55  };
56  return ConvertXMLMock;
57}
58