From d778fb453abf2748384a669b40a34a164f95ce13 Mon Sep 17 00:00:00 2001 From: yuanyulu Date: Tue, 26 Sep 2023 16:14:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=93=E5=8D=B0=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=20Signed?= =?UTF-8?q?-off-by:yuanyulu@huawei.com?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuanyulu --- .../print_service_ability_test.cpp | 88 ------------------- 1 file changed, 88 deletions(-) diff --git a/test/unittest/service_test/print_service_ability_test.cpp b/test/unittest/service_test/print_service_ability_test.cpp index 9b02c819..7f2ea9da 100644 --- a/test/unittest/service_test/print_service_ability_test.cpp +++ b/test/unittest/service_test/print_service_ability_test.cpp @@ -2456,93 +2456,5 @@ HWTEST_F(PrintServiceAbilityTest, PrintServiceAbilityTest_0124, TestSize.Level1) service -> QueryPrinterCapabilityByUri(printerUri, printerCaps); } - -HWTEST_F(PrintServiceAbilityTest, PrintServiceAbilityTest_0125, TestSize.Level1) -{ - auto service = std::make_shared(PRINT_SERVICE_ID, true); - EXPECT_NE(service, nullptr); - auto helper = CreatePrintServiceHelper(true, true, true, true); - service->SetHelper(helper); - - std::vector infoList; - EXPECT_EQ(service->QueryAllExtension(infoList), E_PRINT_NONE); - - std::vector extensionIds; - extensionIds.emplace_back(GetExtensionId(TYPE_DEFAULT)); - EXPECT_EQ(service->StartDiscoverPrinter(extensionIds), E_PRINT_NONE); - EXPECT_CALL(*helper, IsSyncMode()).WillRepeatedly(Return(false)); - - service->LoadExtSuccess(GetExtensionId(TYPE_DEFAULT)); - helper = nullptr; -} - -HWTEST_F(PrintServiceAbilityTest, PrintServiceAbilityTest_0126, TestSize.Level1) -{ - auto service = CreateService(); - EXPECT_NE(service, nullptr); - auto helper = CreatePrintServiceHelper(true, true, true, true); - service->SetHelper(helper); - - EXPECT_CALL(*helper, IsSyncMode()).WillRepeatedly(Return(false)); - service->StopDiscoverPrinter(); - helper = nullptr; -} - -HWTEST_F(PrintServiceAbilityTest, PrintServiceAbilityTest_0127, TestSize.Level1) -{ - auto service = CreateService(); - EXPECT_NE(service, nullptr); - service->SetHelper(CreatePrintServiceHelper(true, true, true, true)); - - std::vector printerInfos; - InitExtPrinterList(printerInfos, 1); - EXPECT_EQ(service->AddPrinters(printerInfos), E_PRINT_NONE); -} - -HWTEST_F(PrintServiceAbilityTest, PrintServiceAbilityTest_0128, TestSize.Level1) -{ - auto service = CreateService(); - EXPECT_NE(service, nullptr); - auto helper = CreatePrintServiceHelper(true, true, true, true); - service->SetHelper(helper); - - std::vector printerInfos; - InitExtPrinterList(printerInfos, 1); - EXPECT_EQ(service->AddPrinters(printerInfos), E_PRINT_NONE); - - PrintJob testJob; - testJob.SetJobId(GetDefaultJobId()); - testJob.SetPrinterId(GetDefaultPrinterId()); - EXPECT_EQ(service->StartPrintJob(testJob), E_PRINT_NONE); - - EXPECT_CALL(*helper, IsSyncMode()).WillRepeatedly(Return(false)); - service->CancelPrintJob(GetDefaultJobId()); - helper = nullptr; -} - -HWTEST_F(PrintServiceAbilityTest, PrintServiceAbilityTest_0129, TestSize.Level1) -{ - auto service = CreateService(); - EXPECT_NE(service, nullptr); - auto helper = CreatePrintServiceHelper(true, true, true, true); - service->SetHelper(helper); - - std::vector printerInfos; - InitExtPrinterList(printerInfos, 1); - EXPECT_EQ(service->AddPrinters(printerInfos), E_PRINT_NONE); - - std::string printerId = GetDefaultPrinterId(); - EXPECT_CALL(*helper, IsSyncMode()).WillRepeatedly(Return(false)); - service->QueryPrinterCapability(printerId); - helper = nullptr; -} -HWTEST_F(PrintServiceAbilityTest, PrintServiceAbilityTest_0130, TestSize.Level1) -{ - std::vector fileList = {}; - std::vector fdList = {}; - std::string taskId = ""; - int result = PrintServiceAbility::GetInstance()->StartPrint(fileList, fdList, taskId); - EXPECT_EQ(result, E_PRINT_NO_PERMISSION); -} } // namespace Print } // namespace OHOS -- Gitee