Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
59f0faeb
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
59f0faeb
编写于
9月 11, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 11, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5410 【Distributeddatamgr】【master】补齐覆盖率
Merge pull request !5410 from wangxiaomeng/master
上级
d5c8de9a
1a8bbcf6
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
238 addition
and
2 deletion
+238
-2
distributeddatamgr/Pasteboardjsapitest/entry/src/main/ets/test/PasteBoeadPixelMapJsunit.test.ets
...entry/src/main/ets/test/PasteBoeadPixelMapJsunit.test.ets
+238
-2
未找到文件。
distributeddatamgr/Pasteboardjsapitest/entry/src/main/ets/test/PasteBoeadPixelMapJsunit.test.ets
浏览文件 @
59f0faeb
...
@@ -180,6 +180,242 @@ export default function pasteBoardTest(){
...
@@ -180,6 +180,242 @@ export default function pasteBoardTest(){
})
})
done();
done();
})
})
});
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_TEST_0500
* @tc.name Create PixelMap data with string type parameters;
* @tc.desc Test pasteBoard API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_TEST_0500', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_TEST_0500 start")
var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => {
var pasteData = null;
var pixelMap = "pixelMap";
try{
pasteData = pasteboard.createPixelMapData(pixelMap)
}catch(err){
console.info("Create pixleMap data fail " + err)
}
expect(pasteData == null).assertTrue();
})
done();
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_TEST_0600
* @tc.name Create PixelMap data with parameter is null;
* @tc.desc Test pasteBoard API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_TEST_0600', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_TEST_0600 start")
var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => {
var pasteData = undefined;
var pixelMap = null;
try{
pasteData = pasteboard.createPixelMapData(pixelMap)
}catch(err){
console.info("Create pixleMap data fail " + err)
}
expect(pasteData == null).assertTrue();
})
done();
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_TEST_0700
* @tc.name Create PixelMap record with string type parameters;
* @tc.desc Test pasteBoard API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_TEST_0700', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_TEST_0700 start")
var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => {
var pixelMapRecord = undefined;
var pixelMap = "pixelMap";
try{
pixelMapRecord = pasteboard.createPixelMapRecord(pixelMap)
}catch(err){
console.info("Create pixleMap data fail " + err)
}
expect(pixelMapRecord == null).assertTrue();
})
done();
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_TEST_0800
* @tc.name Create PixelMap record with parameter is null;
* @tc.desc Test pasteBoard API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_TEST_0800', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_TEST_0800 start")
var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => {
var pixelMapRecord = undefined;
var pixelMap = null;
try{
pixelMapRecord = pasteboard.createPixelMapRecord(pixelMap)
}catch(err){
console.info("Create pixleMap data fail " + err)
}
expect(pixelMapRecord == null).assertTrue();
})
done();
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_TEST_0900
* @tc.name Add a PixelMap record to pasteData with string type parameters;
* @tc.desc Test pasteBoard API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_TEST_0900', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_TEST_0900 start")
var uri = "https://www.baidu.com/"
var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => {
var pasteData = undefined;
var pixelMap = "pixelMap";
pasteData = pasteboard.createUriData(uri)
try{
pasteData.addPixelMapRecord(pixelMap)
}catch(err){
console.info("Create pixleMap data fail " + err)
}
let ret = pasteData.getRecordCount();
expect(ret).assertEqual(1);
})
done();
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_TEST_1000
* @tc.name Add a PixelMap record to pasteData with parameter is null;
* @tc.desc Test pasteBoard API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_TEST_1000', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_TEST_1000 start")
var uri = "https://www.baidu.com/"
var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => {
var pasteData = undefined;
var pixelMap = null;
pasteData = pasteboard.createUriData(uri)
try{
pasteData.addPixelMapRecord(pixelMap)
}catch(err){
console.info("Create pixleMap data fail " + err)
}
let ret = pasteData.getRecordCount();
expect(ret).assertEqual(1);
})
done();
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_TEST_1100
* @tc.name Set pasteData Property's sharOption for InApp
* @tc.desc Test pasteBoard SetProperty API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_TEST_1100', 0, async function (done) {
var pasteData = pasteboard.createHtmlData('application/xml');
console.info("SUB_PASTEBOARD_FUNCTION_ETS_TEST_1100 start")
var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => {
let prop = pasteData.getProperty();
prop.shareOption = pasteboard.ShareOption.InApp;
pasteData.setProperty(prop);
var property = pasteData.getProperty();
expect(0).assertEqual(property.shareOption)
console.info("SUB_PASTEBOARD_FUNCTION_ETS_TEST_1100 end")
})
done();
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_TEST_1200
* @tc.name Set pasteData Property's sharOption for LocalDevice
* @tc.desc Test pasteBoard SetProperty API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_TEST_1200', 0, async function (done) {
var pasteData = pasteboard.createPlainTextData("hello");
console.info("SUB_PASTEBOARD_FUNCTION_ETS_TEST_1200 start")
var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => {
let prop = pasteData.getProperty();
prop.shareOption = pasteboard.ShareOption.LocalDevice;
pasteData.setProperty(prop);
var property = pasteData.getProperty();
expect(1).assertEqual(property.shareOption)
console.info("SUB_PASTEBOARD_FUNCTION_ETS_TEST_1200 end")
})
done();
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_TEST_1300
* @tc.name Set pasteData Property's sharOption for CrossDevice
* @tc.desc Test pasteBoard SetProperty API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_TEST_1300', 0, async function (done) {
var pasteData = pasteboard.createPlainTextData("hello");
console.info("SUB_PASTEBOARD_FUNCTION_ETS_TEST_1300 start")
var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => {
let prop = pasteData.getProperty();
prop.shareOption = pasteboard.ShareOption.CrossDevice;
pasteData.setProperty(prop);
var property = pasteData.getProperty();
expect(2).assertEqual(property.shareOption)
console.info("SUB_PASTEBOARD_FUNCTION_ETS_TEST_1300 end")
})
done();
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_TEST_1400
* @tc.name Set pasteData Property's sharOption for default
* @tc.desc Test pasteBoard SetProperty API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_TEST_1400', 0, async function (done) {
var pasteData = pasteboard.createPlainTextData("hello");
console.info("SUB_PASTEBOARD_FUNCTION_ETS_TEST_1400 start")
var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => {
let prop = pasteData.getProperty();
pasteData.setProperty(prop);
var property = pasteData.getProperty();
expect(2).assertEqual(property.shareOption)
console.info("SUB_PASTEBOARD_FUNCTION_ETS_TEST_1400 end")
})
done();
})
});
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录