• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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: The GBM/ION buffer command is requested, the parameters are normal,
34   * and the buffer application through the Display module is successful.
35   * @tc.level: Level2
36   * @tc.size: MediumTest
37   * @tc.type: Function
38   */
TEST_F(UtestDeviceManagerTest,camera_devMan_0001)39 TEST_F(UtestDeviceManagerTest, camera_devMan_0001)
40 {
41     std::cout << "==========[test log] Preview stream, expected success." << std::endl;
42     // Get the stream manager
43     display_->AchieveStreamOperator();
44     // start stream
45     display_->intents = {PREVIEW};
46     display_->StartStream(display_->intents);
47     // Get preview
48     display_->StartCapture(display_->streamId_preview, display_->captureId_preview, false, true);
49     // release stream
50     display_->captureIds = {display_->captureId_preview};
51     display_->streamIds = {display_->streamId_preview};
52     display_->StopStream(display_->captureIds, display_->streamIds);
53 }