• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 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 #include "media_sync_manager_unittest.h"
17 
18 namespace OHOS {
19 namespace Media {
20 namespace Pipeline {
21 using namespace std;
22 using namespace testing;
23 using namespace testing::ext;
24 
SetUpTestCase(void)25 void MediaSyncManagerUnitTest::SetUpTestCase(void)
26 {
27 }
28 
TearDownTestCase(void)29 void MediaSyncManagerUnitTest::TearDownTestCase(void)
30 {
31 }
32 
SetUp(void)33 void MediaSyncManagerUnitTest::SetUp(void)
34 {
35     manager_ = std::make_shared<MediaSyncManager>();
36 }
37 
TearDown(void)38 void MediaSyncManagerUnitTest::TearDown(void)
39 {
40     manager_ = nullptr;
41 }
42 
43 /**
44  * @tc.name  : Test GetLastVideoBufferAbsPts
45  * @tc.number: GetLastVideoBufferAbsPts_001
46  * @tc.desc  : Test SetInitialVideoFrameRate
47  *             Test ReportEos
48  *             Test GetLastVideoBufferAbsPts
49  */
50 HWTEST_F(MediaSyncManagerUnitTest, GetLastVideoBufferAbsPts_001, TestSize.Level0)
51 {
52     ASSERT_NE(manager_, nullptr);
53     // Test SetInitialVideoFrameRate
54     manager_->SetInitialVideoFrameRate(1);
55     // Test ReportEos
56     manager_->ReportEos(nullptr);
57     // Test GetLastVideoBufferAbsPts
58     auto ret = manager_->GetLastVideoBufferAbsPts();
59     EXPECT_EQ(ret, HST_TIME_NONE);
60 }
61 
62 } // namespace Pipeline
63 } // namespace Media
64 } // namespace OHOS