add print tdd

Signed-off-by: chuangda_1 <fangwanning@huawei.com>
This commit is contained in:
chuangda_1 2023-05-15 18:17:35 +08:00
parent 89d7c51622
commit ceeb5b1bb7
6 changed files with 17 additions and 8 deletions

View File

@ -17,9 +17,9 @@
#define PRINT_PAGESIZE_H
#define TDD_ENABLE 1
#include <map>
#include "napi/native_api.h"
#include "parcel.h"
#include <map>
namespace OHOS::Print {
enum PageSizeId {

View File

@ -13,15 +13,15 @@
* limitations under the License.
*/
#include <gtest/gtest.h>
#include "napi/native_api.h"
#include "print_extension_info.h"
#include <gtest/gtest.h>
using namespace testing::ext;
namespace OHOS {
namespace Print {
class PrinterInfoTest : public testing::Test {
class PrintExtensionInfoTest : public testing::Test {
public:
static void SetUpTestCase(void);
static void TearDownTestCase(void);

View File

@ -13,10 +13,10 @@
* limitations under the License.
*/
#include <gtest/gtest.h>
#include "napi/native_api.h"
#include "print_job.h"
#include "print_page_size.h"
#include <gtest/gtest.h>
using namespace testing::ext;
@ -265,6 +265,7 @@ HWTEST_F(PrintJobTest, PrintJobTest_0017, TestSize.Level1)
job.SetJobState(4);
job.SetSubState(2);
EXPECT_EQ(2, job.GetSubState());
}
/**
* @tc.name: PrintJobTest_0018

View File

@ -133,8 +133,16 @@ HWTEST_F(PrintMarginTest, PrintMarginTest_007, TestSize.Level1)
HWTEST_F(PrintMarginTest, PrintMarginTest_008, TestSize.Level1)
{
OHOS::Print::PrintMargin margin;
napi_env env = nullptr;
margin.Reset();
EXPECT_EQ(0, margin.GetRight());
OHOS::Print::PrintMargin(margin) margin_;
margin.SetTop(1);
margin.SetLeft(2);
margin.SetRight(3);
margin.SetBottom(4);
margin.ToJsObject(env);
margin.Dump();
}
} // namespace Print
} // namespace OHOS

View File

@ -200,5 +200,5 @@ HWTEST_F(NapiPrintUtilTest, NapiPrintUtilTest_0009, TestSize.Level1)
OHOS::Print::NapiPrintUtils::DecodeExtensionCid(cid, extensionId, callbackId);
OHOS::Print::NapiPrintUtils::DecodeExtensionCid(cid, extensionId_err, callbackId);
}
}// namespace Print
} // namespace Print
} // namespace OHOS

View File

@ -53,11 +53,11 @@ void PrintManagerClientTest::TearDown(void) {}
*/
HWTEST_F(PrintManagerClientTest, PrintManagerClientTest_0001, TestSize.Level1)
{
OHOS::Print::PrintManagerClient Testclient;
OHOS::Print::PrintManagerClient Testclient;
std::vector<std::string> fileList = {"datashare://data/print/a.png",
"datashare://data/print/b.png", "datashare://data/print/c.png"};
std::vector<uint32_t> fdList = {1, 2};
std::string taskId = "2";
std::string taskId = "2";
PrintExtensionInfo printExtensionInfo;
printExtensionInfo.SetExtensionId("1");
printExtensionInfo.SetVendorIcon(1);
@ -65,7 +65,7 @@ HWTEST_F(PrintManagerClientTest, PrintManagerClientTest_0001, TestSize.Level1)
printExtensionInfo.SetExtensionId("1");
printExtensionInfo.SetVendorId("1");
std::vector<PrintExtensionInfo> extensionInfos;
extensionInfos.emplace_back(printExtensionInfo);
extensionInfos.emplace_back(printExtensionInfo);
Testclient.StartPrint(fileList, fdList, taskId);
Testclient.QueryAllExtension(extensionInfos);
}