• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
16 #ifndef FOUNDATION_APPEXECFWK_KITS_APPKIT_TEST_MOCK_INCLUDE_MOCK_ABILITY_TOKEN_H
17 #define FOUNDATION_APPEXECFWK_KITS_APPKIT_TEST_MOCK_INCLUDE_MOCK_ABILITY_TOKEN_H
18 
19 #include "nocopyable.h"
20 #include "iremote_broker.h"
21 #include "iremote_object.h"
22 #include "iremote_proxy.h"
23 #include "iremote_stub.h"
24 
25 namespace OHOS {
26 namespace AppExecFwk {
27 
28 class IAbilityToken : public IRemoteBroker {
29 public:
30     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.AbilityToken");
31 };
32 
33 class MockAbilityToken : public IRemoteStub<IAbilityToken> {
34 public:
35     MockAbilityToken() = default;
36     virtual ~MockAbilityToken() = default;
37 
OnRemoteRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)38     virtual int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
39     {
40         return 0;
41     }
42 
43 private:
44     DISALLOW_COPY_AND_MOVE(MockAbilityToken);
45 };
46 
47 class AbilityTokenProxy : public IRemoteProxy<IAbilityToken> {
48 public:
AbilityTokenProxy(const sptr<IRemoteObject> & impl)49     explicit AbilityTokenProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<IAbilityToken>(impl)
50     {}
51 
52     virtual ~AbilityTokenProxy() = default;
53 
54 private:
55     DISALLOW_COPY_AND_MOVE(AbilityTokenProxy);
56 };
57 
58 DECLARE_INTERFACE_DESCRIPTOR(u"IAbilityToken");
59 
60 }  // namespace AppExecFwk
61 }  // namespace OHOS
62 #endif  // FOUNDATION_APPEXECFWK_KITS_APPKIT_TEST_MOCK_INCLUDE_MOCK_ABILITY_TOKEN_H
63