1/* 2 * Copyright (c) 2021 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 { AbilityStageContextClass } from "./application/AbilityStageContext" 17import { paramMock } from "../utils" 18 19export function mockAbilityStage() { 20 const AbilityStageClass = class AbilityStage { 21 constructor() { 22 console.warn('application.AbilityStage.constructor interface mocked in the Previewer. How this interface works on' + 23 ' the Previewer may be different from that on a real device.'); 24 this.context = new AbilityStageContextClass(); 25 this.onCreate = function () { 26 console.warn("application.AbilityStage.onCreate interface mocked in the Previewer. How this interface works on the Previewer" + 27 " may be different from that on a real device.") 28 }; 29 this.onAcceptWant = function (...args) { 30 console.warn("application.AbilityStage.onAcceptWant interface mocked in the Previewer. How this interface works on the Previewer" + 31 " may be different from that on a real device.") 32 return paramMock.paramStringMock; 33 }; 34 this.onConfigurationUpdated = function (...args) { 35 console.warn("application.AbilityStage.onConfigurationUpdated interface mocked in the Previewer. How this interface works on the Previewer" + 36 " may be different from that on a real device.") 37 }; 38 this.onMemoryLevel = function (...args) { 39 console.warn("application.AbilityStage.onMemoryLevel interface mocked in the Previewer. How this interface works on the Previewer" + 40 " may be different from that on a real device.") 41 }; 42 } 43 } 44 return new AbilityStageClass(); 45}