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_ACE_FRAMEWORKS_CORE_PIPELINE_NG_TEST_UNITTEST_MOCK_SCHEDULE_TASK_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_PIPELINE_NG_TEST_UNITTEST_MOCK_SCHEDULE_TASK_H
18 
19 #include "gmock/gmock-function-mocker.h"
20 #include "gmock/gmock.h"
21 #include "base/memory/ace_type.h"
22 #include "core/animation/schedule_task.h"
23 
24 namespace OHOS::Ace {
25 class MockScheduleTask : public ScheduleTask {
26     DECLARE_ACE_TYPE(MockScheduleTask, ScheduleTask);
27 
28 public:
OnFrame(uint64_t nanoTimestamp)29     void OnFrame(uint64_t nanoTimestamp) override
30     {
31         nanoTimestamp_ = nanoTimestamp;
32     }
33 
GetNanoTimestamp()34     uint64_t GetNanoTimestamp() const
35     {
36         return nanoTimestamp_;
37     }
38 private:
39     uint64_t nanoTimestamp_ = 0;
40 };
41 } // namespace OHOS::Ace
42 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_PIPELINE_NG_TEST_UNITTEST_MOCK_SCHEDULE_TASK_H
43