blob: c28d6ca5246a8cdc974c86ae653253daee1740e0 [file] [log] [blame]
Amy Zhang45cc57a2020-07-09 22:56:25 -07001/*
2 * Copyright 2020 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#include <android-base/logging.h>
18#include <android/hardware/tv/tuner/1.0/IDemux.h>
19#include <android/hardware/tv/tuner/1.0/types.h>
20#include <android/hardware/tv/tuner/1.1/IFilter.h>
21#include <android/hardware/tv/tuner/1.1/ITuner.h>
22#include <binder/MemoryDealer.h>
23#include <gtest/gtest.h>
24#include <hidl/ServiceManagement.h>
25#include <hidl/Status.h>
26#include <hidlmemory/FrameworkUtils.h>
27#include <utils/Condition.h>
28#include <utils/Mutex.h>
29#include <map>
30
31using android::sp;
32using android::hardware::Return;
33using android::hardware::Void;
34using android::hardware::tv::tuner::V1_0::IDemux;
35using android::hardware::tv::tuner::V1_0::IFilter;
36using android::hardware::tv::tuner::V1_0::Result;
37using android::hardware::tv::tuner::V1_1::ITuner;
38
39using ::testing::AssertionResult;
40
41class DemuxTests {
42 public:
43 void setService(sp<ITuner> tuner) { mService = tuner; }
44
45 AssertionResult openDemux(sp<IDemux>& demux, uint32_t& demuxId);
46 AssertionResult setDemuxFrontendDataSource(uint32_t frontendId);
Amy Zhang45cc57a2020-07-09 22:56:25 -070047 AssertionResult closeDemux();
48
49 protected:
50 static AssertionResult failure() { return ::testing::AssertionFailure(); }
51
52 static AssertionResult success() { return ::testing::AssertionSuccess(); }
53
54 sp<ITuner> mService;
55 sp<IDemux> mDemux;
56};