blob: 7698de33b323838bb7129be1d5357932443bceac [file] [log] [blame]
Hongguang600a6ae2021-07-08 18:51:51 -07001/*
2 * Copyright 2021 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <aidl/android/hardware/tv/tuner/DemuxCapabilities.h>
20#include <aidl/android/hardware/tv/tuner/IDemux.h>
21#include <aidl/android/hardware/tv/tuner/IFilter.h>
22#include <aidl/android/hardware/tv/tuner/ITuner.h>
23
24#include <gtest/gtest.h>
25#include <log/log.h>
26
27using ::testing::AssertionResult;
28
29using namespace aidl::android::hardware::tv::tuner;
30
31class DemuxTests {
32 public:
33 void setService(std::shared_ptr<ITuner> tuner) { mService = tuner; }
34
35 AssertionResult openDemux(std::shared_ptr<IDemux>& demux, int32_t& demuxId);
36 AssertionResult setDemuxFrontendDataSource(int32_t frontendId);
37 AssertionResult getAvSyncId(std::shared_ptr<IFilter> filter, int32_t& avSyncHwId);
38 AssertionResult getAvSyncTime(int32_t avSyncId);
39 AssertionResult getDemuxCaps(DemuxCapabilities& demuxCaps);
40 AssertionResult closeDemux();
41
42 protected:
43 static AssertionResult failure() { return ::testing::AssertionFailure(); }
44
45 static AssertionResult success() { return ::testing::AssertionSuccess(); }
46
47 std::shared_ptr<ITuner> mService;
48 std::shared_ptr<IDemux> mDemux;
49};