1 /*
2 * Copyright (c) 2023 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 <gtest/gtest.h>
17 #include "print_security_guard_manager.h"
18 #include "print_constant.h"
19 #include "print_log.h"
20
21 using namespace testing::ext;
22
23 namespace OHOS {
24 namespace Print {
25 class PrintSecurityGuardManagerTest : public testing::Test {
26 public:
27 static void SetUpTestCase(void);
28 static void TearDownTestCase(void);
29 void SetUp();
30 void TearDown();
31 };
32
SetUpTestCase(void)33 void PrintSecurityGuardManagerTest::SetUpTestCase(void) {}
34
TearDownTestCase(void)35 void PrintSecurityGuardManagerTest::TearDownTestCase(void) {}
36
SetUp(void)37 void PrintSecurityGuardManagerTest::SetUp(void) {}
38
TearDown(void)39 void PrintSecurityGuardManagerTest::TearDown(void) {}
40
41 /**
42 * @tc.name: PrintSecurityGuardManagerTest_0001
43 * @tc.desc: receiveBaseInfo
44 * @tc.type: FUNC
45 * @tc.require:
46 */
47 HWTEST_F(PrintSecurityGuardManagerTest, PrintSecurityGuardManagerTest_0001, TestSize.Level1)
48 {
49 PrintSecurityGuardManager printSerPrintSecurityGuardManager;
50 std::vector<std::string> fileList;
51 PrinterInfo printerInfo;
52 PrintJob printJob;
53 printSerPrintSecurityGuardManager.receiveBaseInfo("jobId-1", "callerPkg-1", fileList);
54 printSerPrintSecurityGuardManager.receiveJobStateUpdate("jobId-2", printerInfo, printJob);
55 }
56
57 /**
58 * @tc.name: PrintSecurityGuardManagerTest_0002
59 * @tc.desc: receiveBaseInfo
60 * @tc.type: FUNC
61 * @tc.require:
62 */
63 HWTEST_F(PrintSecurityGuardManagerTest, PrintSecurityGuardManagerTest_0002, TestSize.Level1)
64 {
65 PrintSecurityGuardManager printSerPrintSecurityGuardManager;
66 std::vector<std::string> fileList;
67 PrinterInfo printerInfo;
68 PrintJob printJob;
69 printSerPrintSecurityGuardManager.receiveBaseInfo("jobId-1", "callerPkg-1", fileList);
70 printSerPrintSecurityGuardManager.receiveJobStateUpdate("jobId-1", printerInfo, printJob);
71 }
72 } // namespace Print
73 } // namespace OHOS
74