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 expected 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 #include "device_manager_test.h"
16
SetUpTestCase(void)17 void UtestDeviceManagerTest::SetUpTestCase(void){}
TearDownTestCase(void)18 void UtestDeviceManagerTest::TearDownTestCase(void){}
SetUp(void)19 void UtestDeviceManagerTest::SetUp(void)
20 {
21 if (display_ == nullptr)
22 display_ = std::make_shared<TestDisplay>();
23 display_->FBInit();
24 display_->Init();
25 }
TearDown(void)26 void UtestDeviceManagerTest::TearDown(void)
27 {
28 display_->Close();
29 }
30
31 /**
32 * @tc.name: Check device manager.
33 * @tc.desc: 请求GBM/ION buffer命令,参数正常,通过Display模块申请buffer申请buffer成功。
34 * @tc.level: Level2
35 * @tc.size: MediumTest
36 * @tc.type: Function
37 */
TEST_F(UtestDeviceManagerTest,camera_devMan_0001)38 TEST_F(UtestDeviceManagerTest, camera_devMan_0001)
39 {
40 std::cout << "==========[test log] Preview stream, expected success." << std::endl;
41 // 获取流管理器
42 display_->AchieveStreamOperator();
43 // 启流
44 display_->intents = {Camera::PREVIEW};
45 display_->StartStream(display_->intents);
46 // 获取预览图
47 display_->StartCapture(display_->streamId_preview, display_->captureId_preview, false, true);
48 // 释放流
49 display_->captureIds = {display_->captureId_preview};
50 display_->streamIds = {display_->streamId_preview};
51 display_->StopStream(display_->captureIds, display_->streamIds);
52 }