Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
4ed3e297
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看板
未验证
提交
4ed3e297
编写于
7月 25, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4534 杂散新增用例
Merge pull request !4534 from 高曦/OpenHarmony-3.1-Release
上级
9a5d158d
2e73e5a2
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
556 addition
and
24 deletion
+556
-24
miscservices/BUILD.gn
miscservices/BUILD.gn
+1
-0
miscservices/InputMethodTest_ets/entry/src/main/ets/MainAbility/test/RequestDownloadTaskJsunit.test.ets
...n/ets/MainAbility/test/RequestDownloadTaskJsunit.test.ets
+171
-0
miscservices/InputMethodTest_ets/entry/src/main/ets/MainAbility/test/RequestJsunit.test.ets
...ntry/src/main/ets/MainAbility/test/RequestJsunit.test.ets
+43
-0
miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.test.js
...Test_js/src/main/js/default/test/SystemTimeJsunit.test.js
+242
-23
miscservices/actspasteboardjsapitest/entry/src/main/js/default/test/List.test.js
...oardjsapitest/entry/src/main/js/default/test/List.test.js
+2
-1
miscservices/actspasteboardjsapitest/entry/src/main/js/default/test/PasteBoard2Jsunit.test.js
.../entry/src/main/js/default/test/PasteBoard2Jsunit.test.js
+97
-0
未找到文件。
miscservices/BUILD.gn
浏览文件 @
4ed3e297
...
...
@@ -20,6 +20,7 @@ group("miscservices") {
"TimeTest_js:ActsTimeJSApiTest",
"TimerTest_js:ActsTimerJSApiTest",
"actspasteboardjsapitest:ActsPasteBoardJSApiTest",
"screenlock_js:ActsScreenLockJSApiTest",
"wallpaper_js:ActsWallpaperJSApiTest",
]
}
miscservices/InputMethodTest_ets/entry/src/main/ets/MainAbility/test/RequestDownloadTaskJsunit.test.ets
浏览文件 @
4ed3e297
...
...
@@ -335,5 +335,176 @@ export default function requestDownloadJsunit() {
done();
});
/**
* @tc.number requestDownload_test_015
* @tc.name Test The request DownloadTask
* @tc.desc Function test
*/
it('requestDownload_test_015', 0, async function (done) {
console.info("requestDownload_test_015 start")
request.download(downloadConfig, (downloadTask) => {
console.info("downloadConfig result:" + JSON.stringify(downloadTask))
downloadTask.remove().then((result) => {
if (result) {
expect(result != null).assertTrue();
console.info('Download task removed.');
} else {
console.info('Failed to remove the download task.');
}
}).catch((err) => {
expect(true).assertTrue();
console.info('Failed to remove the download task.');
});
});
console.info("requestDownload_test_015 end")
done();
});
/**
* @tc.number requestDownload_test_016
* @tc.name Test The request UploadTask
* @tc.desc Function test
*/
it('requestDownload_test_016', 0, async function (done) {
console.info("requestDownload_test_016 start")
request.download(downloadConfig, (downloadTask) => {
console.info("downloadConfig result:" + JSON.stringify(downloadTask))
downloadTask.pause().then((result) => {
if (result) {
expect(result != null).assertTrue();
console.info('Download task paused. ');
} else {
console.info('Failed to pause the download task. Cause:' + JSON.stringify(result));
}
}).catch((err) => {
expect(true).assertTrue();
console.info('Failed to pause the download task. Cause:' + JSON.stringify(err));
});
});
console.info("requestDownload_test_016 end")
done();
});
/**
* @tc.number requestDownload_test_017
* @tc.name Test The request UploadTask
* @tc.desc Function test
*/
it('requestDownload_test_017', 0, async function (done) {
console.info("requestDownload_test_017 start")
request.download(downloadConfig, (downloadTask) => {
console.info("downloadConfig result:" + JSON.stringify(downloadTask))
downloadTask.pause((err, result)=>{
if(err) {
console.info('Failed to pause the download task. Cause:' + JSON.stringify(err));
expect(true).assertTrue();
return;
}
if (result) {
console.info('Download task paused. ');
expect(result != null).assertTrue();
} else {
console.info('Failed to pause the download task. Cause:' + JSON.stringify(result));
}
});
});
console.info("requestDownload_test_017 end")
done();
});
/**
* @tc.number requestDownload_test_018
* @tc.name Test The request UploadTask
* @tc.desc Function test
*/
it('requestDownload_test_018', 0, async function (done) {
console.info("requestDownload_test_018 start")
request.download(downloadConfig, (downloadTask) => {
console.info("downloadConfig result:" + JSON.stringify(downloadTask))
downloadTask.resume().then((result) => {
if (result) {
expect(result != null).assertTrue();
console.info('Download task resumed.')
} else {
console.error('Failed to resume the download task. ');
}
console.info('Download task resumed.')
}).catch((err) => {
expect(true).assertEqual(true);
console.error('Failed to resume the download task. Cause:' + err);
});
});
console.info("requestDownload_test_018 end")
done();
});
/**
* @tc.number requestDownload_test_019
* @tc.name Test The request UploadTask
* @tc.desc Function test
*/
it('requestDownload_test_019', 0, async function (done) {
console.info("requestDownload_test_019 start")
request.download(downloadConfig, (downloadTask) => {
console.info("downloadConfig result:" + JSON.stringify(downloadTask))
downloadTask.resume((err, result)=>{
if (err) {
expect(true).assertEqual(true);
console.info('Failed to resume the download task. Cause:' + err);
return;
}
if (result) {
expect(result != null).assertTrue();
console.info('Download task resumed.');
} else {
console.info('Failed to resume the download task.');
}
});
});
console.info("requestDownload_test_019 end")
done();
});
/**
* @tc.number requestDownload_test_020
* @tc.name Test The request UploadTask
* @tc.desc Function test
*/
it('requestDownload_test_020', 0, async function (done) {
console.info("requestDownload_test_020 start")
request.download(downloadConfig, (downloadTask) => {
console.info("downloadConfig result:" + JSON.stringify(downloadTask))
downloadTask.query().then((downloadInfo) => {
expect(downloadInfo != null).assertTrue();
console.info('Download task queried. Data:' + JSON.stringify(downloadInfo))
}) .catch((err) => {
expect(true).assertEqual(true);
console.info('Failed to query the download task. Cause:' + err)
});
});
console.info("requestDownload_test_020 end")
done();
});
/**
* @tc.number requestDownload_test_021
* @tc.name Test The request UploadTask
* @tc.desc Function test
*/
it('requestDownload_test_021', 0, async function (done) {
console.info("requestDownload_test_021 start")
request.download(downloadConfig, (downloadTask) => {
console.info("downloadConfig result:" + JSON.stringify(downloadTask))
downloadTask.queryMimeType().then((data) => {
expect(data != null).assertTrue();
console.info('Download task queried. Data:' + JSON.stringify(data));
}).catch((err) => {
expect(true).assertEqual(true);
console.error('Failed to query the download MimeType. Cause:' + JSON.stringify(err))
});
});
console.info("requestDownload_test_021 end")
done();
});
})
}
miscservices/InputMethodTest_ets/entry/src/main/ets/MainAbility/test/RequestJsunit.test.ets
浏览文件 @
4ed3e297
...
...
@@ -196,6 +196,49 @@ export default function requestJsunit() {
console.log("-----------------------request_upload_0006 end-----------------------");
done();
})
/**
* @tc.name: ohos.request_request_upload
* @tc.desc: request_upload Method detection
* @tc.author: kangyuntao
*/
it('request_upload_0007', 0, async function (done) {
console.log("-----------------------Request_test_0006 is starting-----------------------");
console.log("request_upload_0007 getUploadConfig() " + getUploadConfig());
request.upload(getUploadConfig(), (err, uploadTask) => {
uploadTask.remove().then((result) => {
if (result) {
console.info('Upload task removed successfully. ');
} else {
console.error('Failed to remove the upload task. ');
}
}).catch((err) => {
expect(true).assertEqual(true);
console.error('Failed to remove the upload task. Cause: ' + JSON.stringify(err));
});
})
console.log("-----------------------request_upload_0007 end-----------------------");
done();
})
/**
* @tc.name: ohos.request_request_upload
* @tc.desc: request_upload Method detection
* @tc.author: kangyuntao
*/
it('request_upload_0008', 0, async function (done) {
console.log("-----------------------request_upload_0008 is starting-----------------------");
let uploadTask;
request.upload(getUploadConfig()).then((data) => {
uploadTask = data;
expect(uploadTask != null).assertTrue();
}).catch((err) => {
expect(true).assertTrue();
console.info('Failed to request the upload. Cause: ' + JSON.stringify(err));
})
console.log("-----------------------request_upload_0008 end-----------------------");
done();
})
})
function getUploadConfig() {
...
...
miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.test.js
浏览文件 @
4ed3e297
...
...
@@ -22,11 +22,12 @@ import {
afterAll
,
it
,
expect
,
}
from
"
deccjsunit/index
"
;
import
systemTime
from
"
@ohos.systemTime
"
;
describe
(
"
TimeTest
"
,
function
()
{
console
.
log
(
"
start################################start
"
);
}
from
"
deccjsunit/index
"
;
import
systemTime
from
"
@ohos.systemTime
"
;
import
request
from
'
@system.request
'
;
describe
(
"
TimeTest
"
,
function
()
{
console
.
log
(
"
start################################start
"
);
/**
* @tc.number SUB_systemTime_getRealActiveTime_JS_API_0100
* @tc.name Test systemTime.getRealActiveTime
...
...
@@ -36,16 +37,16 @@ import {
* @tc.level : Level 0
*/
it
(
"
systemTime_getRealActiveTime_test1
"
,
0
,
async
function
(
done
)
{
console
.
log
(
"
SUB_systemTime_getRealActiveTime_JS_API_0100 start
"
);
systemTime
.
getRealActiveTime
().
then
((
data
)
=>
{
console
.
log
(
"
f_ActiveTime1: getRealActiveTime data =
"
+
data
);
});
expect
(
true
).
assertTrue
();
console
.
log
(
"
SUB_systemTime_getRealActiveTime_JS_API_0100 end
"
);
done
();
console
.
log
(
"
SUB_systemTime_getRealActiveTime_JS_API_0100 start
"
);
systemTime
.
getRealActiveTime
().
then
((
data
)
=>
{
console
.
log
(
"
f_ActiveTime1: getRealActiveTime data =
"
+
data
);
});
expect
(
true
).
assertTrue
();
console
.
log
(
"
SUB_systemTime_getRealActiveTime_JS_API_0100 end
"
);
done
();
});
/**
* @tc.number SUB_systemTime_getRealTime_JS_API_0100
* @tc.name Test systemTime.getRealTime
...
...
@@ -55,14 +56,232 @@ import {
* @tc.level : Level 0
*/
it
(
"
systemTime_getRealTime_test1
"
,
0
,
async
function
(
done
)
{
console
.
log
(
"
SUB_systemTime_getRealTime_JS_API_0100 start
"
);
systemTime
.
getRealTime
().
then
((
data
)
=>
{
console
.
log
(
"
f_RealTime1: getRealTime data =
"
+
data
);
});
expect
(
true
).
assertTrue
();
console
.
log
(
"
SUB_systemTime_getRealTime_JS_API_0100 end
"
);
done
();
console
.
log
(
"
SUB_systemTime_getRealTime_JS_API_0100 start
"
);
systemTime
.
getRealTime
().
then
((
data
)
=>
{
console
.
log
(
"
f_RealTime1: getRealTime data =
"
+
data
);
});
expect
(
true
).
assertTrue
();
console
.
log
(
"
SUB_systemTime_getRealTime_JS_API_0100 end
"
);
done
();
});
/**
* @tc.number SUB_systemTime_getCurrentTime_JS_API_0100
* @tc.name Test systemTime.getCurrentTime Invalid value
* @tc.desc Test systemTime_getCurrentTime API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
systemTime_getCurrentTime_test1
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
SUB_systemTime_getCurrentTime_JS_API_0100 start
"
);
systemTime
.
getCurrentTime
().
then
((
data
)
=>
{
expect
(
data
!=
null
).
assertTrue
();
console
.
info
(
`systemTime.getCurrentTime success data : `
+
JSON
.
stringify
(
data
));
}).
catch
((
error
)
=>
{
expect
(
true
).
assertTrue
();
console
.
info
(
`failed to systemTime.getCurrentTime because `
+
JSON
.
stringify
(
error
));
});
done
();
});
/**
* @tc.number SUB_systemTime_getCurrentTime_JS_API_0200
* @tc.name Test systemTime.getCurrentTime Invalid value
* @tc.desc Test systemTime_getCurrentTime API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
systemTime_getCurrentTime_test2
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
SUB_systemTime_getCurrentTime_JS_API_0200 start
"
);
systemTime
.
getCurrentTime
(
true
,
(
error
,
data
)
=>
{
if
(
error
)
{
expect
(
true
).
assertTrue
();
console
.
info
(
`failed to systemTime.getCurrentTime because `
+
JSON
.
stringify
(
error
));
return
;
}
expect
(
data
!=
null
).
assertTrue
();
console
.
info
(
`systemTime.getCurrentTime success data : `
+
JSON
.
stringify
(
data
));
});
done
();
});
/**
* @tc.number SUB_systemTime_getCurrentTime_JS_API_0200
* @tc.name Test systemTime.getCurrentTime Invalid value
* @tc.desc Test systemTime_getCurrentTime API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
systemTime_getDate_test1
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
SUB_systemTime_getDate_JS_API_0100 start
"
);
systemTime
.
getDate
((
error
,
data
)
=>
{
if
(
error
)
{
expect
(
true
).
assertTrue
();
console
.
info
(
`failed to systemTime.getDate because `
+
JSON
.
stringify
(
error
));
return
;
}
expect
(
data
!=
null
).
assertTrue
();
console
.
info
(
`systemTime.getDate success data : `
+
JSON
.
stringify
(
data
));
});
done
();
});
/**
* @tc.number SUB_systemTime_getCurrentTime_JS_API_0200
* @tc.name Test systemTime.getCurrentTime Invalid value
* @tc.desc Test systemTime_getCurrentTime API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
systemTime_getDate_test2
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
SUB_systemTime_getDate_JS_API_0200 start
"
);
systemTime
.
getDate
().
then
((
data
)
=>
{
expect
(
data
!=
null
).
assertTrue
();
console
.
log
(
`systemTime.getDate success data : `
+
JSON
.
stringify
(
data
));
}).
catch
((
error
)
=>
{
expect
(
true
).
assertTrue
();
console
.
error
(
`failed to systemTime.getDate because `
+
JSON
.
stringify
(
error
));
});
done
();
});
/**
* @tc.number SUB_systemTime_getTimezone_JS_API_0200
* @tc.name Test systemTime.getTimezone Invalid value
* @tc.desc Test systemTime_getTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
systemTime_getTimezon_test1
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
SUB_systemTime_getTimezon_JS_API_0100 start
"
);
systemTime
.
getTimezone
((
error
,
data
)
=>
{
if
(
error
)
{
expect
(
true
).
assertTrue
();
console
.
error
(
`failed to systemTime.getTimezone because `
+
JSON
.
stringify
(
error
));
return
;
}
expect
(
data
!=
null
).
assertTrue
();
console
.
log
(
`systemTime.getTimezone success data : `
+
JSON
.
stringify
(
data
));
});
done
();
});
/**
* @tc.number SUB_systemTime_getTimezone_JS_API_0200
* @tc.name Test systemTime.getTimezone Invalid value
* @tc.desc Test systemTime_getTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
systemTime_getTimezon_test2
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
SUB_systemTime_getTimezon_JS_API_0200 start
"
);
systemTime
.
getTimezone
().
then
((
data
)
=>
{
expect
(
data
!=
null
).
assertTrue
();
console
.
info
(
`systemTime.getTimezone success data : `
+
JSON
.
stringify
(
data
));
}).
catch
((
error
)
=>
{
expect
(
true
).
assertTrue
();
console
.
info
(
`failed to systemTime.getTimezone because `
+
JSON
.
stringify
(
error
));
});
done
();
});
/**
* @tc.number SystemRequest_upload_test01
* @tc.name Test SystemRequest_upload Invalid value
* @tc.desc Test SystemRequest_upload API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SystemRequest_upload_test01
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
SystemRequest_upload_test01 start
"
);
request
.
upload
({
url
:
'
http://www.path.com
'
,
files
:
[
{
uri
:
'
internal://cache/path/to/file.txt
'
,
name
:
'
file
'
,
filename
:
'
file.txt
'
,
},
],
data
:
[
{
name
:
'
name1
'
,
value
:
'
value
'
,
},
],
success
:
function
(
data
)
{
expect
(
data
!=
null
).
assertTrue
();
console
.
info
(
'
upload success, code:
'
+
data
.
code
);
console
.
info
(
'
upload success, code:
'
+
data
.
data
);
console
.
info
(
'
upload success, code:
'
+
data
.
headers
);
},
fail
:
function
()
{
expect
(
true
).
assertTrue
();
console
.
info
(
'
upload fail
'
);
},
complete
:
null
});
done
();
});
/**
* @tc.number SystemRequest_download_test01
* @tc.name Test SystemRequest_download Invalid value
* @tc.desc Test SystemRequest_download API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SystemRequest_download_test01
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
SystemRequest_download_test01 start
"
);
request
.
download
({
url
:
'
http://www.path.com
'
,
success
:
function
(
data
)
{
expect
(
data
!=
null
).
assertTrue
();
console
.
info
(
'
call success callback success:
'
+
data
.
token
);
},
fail
:
function
(
data
,
code
)
{
console
.
info
(
'
handling fail
'
);
},
filename
:
"
文件名
"
,
header
:
null
,
description
:
"
描述
"
,
complete
:
null
});
done
();
});
/**
* @tc.number SystemRequest_onDownloadComplete_test01
* @tc.name Test SystemRequest_onDownloadComplete Invalid value
* @tc.desc Test SystemRequest_onDownloadComplete API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SystemRequest_onDownloadComplete_test01
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
SystemRequest_onDownloadComplete_test01 start
"
);
request
.
onDownloadComplete
({
token
:
'
token-index
'
,
success
:
function
(
data
)
{
expect
(
data
!=
null
).
assertTrue
();
console
.
info
(
'
download success, uri:
'
+
data
.
uri
);
},
fail
:
function
(
data
,
code
)
{
expect
(
true
).
assertTrue
();
console
.
info
(
'
download fail
'
);
},
complete
:
null
});
done
();
});
});
});
\ No newline at end of file
miscservices/actspasteboardjsapitest/entry/src/main/js/default/test/List.test.js
浏览文件 @
4ed3e297
...
...
@@ -13,4 +13,5 @@
* limitations under the License.
*/
require
(
'
./PasteBoardJsunit.test.js
'
)
\ No newline at end of file
require
(
'
./PasteBoardJsunit.test.js
'
)
require
(
'
./PasteBoard2Jsunit.test.js
'
)
\ No newline at end of file
miscservices/actspasteboardjsapitest/entry/src/main/js/default/test/PasteBoard2Jsunit.test.js
0 → 100644
浏览文件 @
4ed3e297
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// @ts-nocheck
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
pasteboard
from
'
@ohos.pasteboard
'
describe
(
'
PasteBoardTest2
'
,
function
()
{
console
.
log
(
'
start################################start
'
);
/**
* @tc.number SUB_pasteBoard_function_JS_API_7100
* @tc.name 复制文本、uri格式
* @tc.desc Test pasteBoard API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
pasteboard_function_test71
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
SUB_pasteBoard_function_JS_API_7100 start
'
)
var
record
=
pasteboard
.
createUriRecord
(
"
dataability:///com.example.myapplication1?user.txt
"
);
record
.
convertToText
((
err
,
data
)
=>
{
if
(
err
)
{
expect
(
true
).
assertTrue
();
console
.
info
(
'
convertToText failed because
'
+
JSON
.
stringify
(
err
));
return
;
}
expect
(
data
!=
null
).
assertTrue
();
console
.
info
(
'
convertToText success data :
'
+
JSON
.
stringify
(
data
));
});
console
.
info
(
'
SUB_pasteBoard_function_JS_API_7100 end
'
);
done
();
})
/**
* @tc.number SUB_pasteBoard_function_JS_API_7200
* @tc.name 复制文本、uri格式
* @tc.desc Test pasteBoard API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
pasteboard_function_test72
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
SUB_pasteBoard_function_JS_API_7200 start
'
)
var
html
=
"
<!DOCTYPE html>
\n
"
+
"
<html>
\n
"
+
"
<head>
\n
"
+
"
<meta charset=
\"
utf-8
\"
>
\n
"
+
"
<title>HTML-PASTEBOARD_HTML</title>
\n
"
+
"
</head>
\n
"
+
"
<body>
\n
"
+
"
<h1>HEAD</h1>
\n
"
+
"
<p></p>
\n
"
+
"
</body>
\n
"
+
"
</html>
"
;
var
pasteData
=
pasteboard
.
createHtmlData
(
html
);
var
htmlText
=
pasteData
.
getPrimaryHtml
();
expect
(
htmlText
!=
null
).
assertTrue
();
console
.
info
(
'
SUB_pasteBoard_function_JS_API_7200 end
'
);
done
();
})
/**
* @tc.number SUB_pasteBoard_function_JS_API_7300
* @tc.name 复制文本、uri格式
* @tc.desc Test pasteBoard API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
pasteboard_function_test73
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
SUB_pasteBoard_function_JS_API_7300 start
'
)
var
record
=
pasteboard
.
createUriRecord
(
"
dataability:///com.example.myapplication1?user.txt
"
);
record
.
convertToText
().
then
((
data
)
=>
{
expect
(
data
!=
null
).
assertTrue
();
console
.
info
(
'
convertToText success data :
'
+
JSON
.
stringify
(
data
));
}).
catch
((
error
)
=>
{
expect
(
true
).
assertTrue
();
console
.
info
(
'
convertToText failed because
'
+
JSON
.
stringify
(
error
));
});
console
.
info
(
'
SUB_pasteBoard_function_JS_API_7300 end
'
);
done
();
})
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录