mirror of
https://gitee.com/openharmony/print_print_fwk
synced 2024-12-11 11:04:40 +00:00
添加tdd测试用例 Signed-off-by:xiongqiao3@huawei.com
Signed-off-by: xiongqiao <xiongqiao3@huawei.com>
This commit is contained in:
parent
0f4d48e684
commit
9982ded81a
@ -2546,37 +2546,5 @@ HWTEST_F(PrintServiceAbilityTest, PrintServiceAbilityTest_0130, TestSize.Level1)
|
||||
int result = PrintServiceAbility::GetInstance()->StartPrint(fileList, fdList, taskId);
|
||||
EXPECT_EQ(result, E_PRINT_NO_PERMISSION);
|
||||
}
|
||||
|
||||
HWTEST_F(PrintServiceAbilityTest, PrintServiceAbilityTest_0131, TestSize.Level1)
|
||||
{
|
||||
PrintAttributes printAttributes;
|
||||
printAttributes.SetCopyNumber(1);
|
||||
OHOS::Print::PrintRange range;
|
||||
range.SetStartPage(1);
|
||||
printAttributes.SetPageRange(range);
|
||||
printAttributes.SetIsSequential(true);
|
||||
OHOS::Print::PrintPageSize pageSize;
|
||||
pageSize.SetId("1");
|
||||
printAttributes.SetPageSize(pageSize);
|
||||
printAttributes.SetIsLandscape(true);
|
||||
printAttributes.SetDirectionMode(1);
|
||||
printAttributes.SetColorMode(1);
|
||||
printAttributes.SetDuplexMode(1);
|
||||
OHOS::Print::PrintMargin margin;
|
||||
margin.SetTop(1);
|
||||
printAttributes.SetMargin(margin);
|
||||
printAttributes.SetOption("1");
|
||||
|
||||
auto service = std::make_shared<PrintServiceAbility>(PRINT_SERVICE_ID, true);
|
||||
EXPECT_NE(service, nullptr);
|
||||
auto helper = CreatePrintServiceHelper(true, true, false, true);
|
||||
service->SetHelper(helper);
|
||||
|
||||
std::string jobName = "123.pdf";
|
||||
std::string taskId = "";
|
||||
sptr<IRemoteObject> token = helper -> GetBundleMgr();
|
||||
service->PrintByAdapter(jobName, printAttributes, taskId, token);
|
||||
helper = nullptr;
|
||||
}
|
||||
} // namespace Print
|
||||
} // namespace OHOS
|
||||
|
Loading…
Reference in New Issue
Block a user