Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
156c479e
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看板
提交
156c479e
编写于
6月 24, 2022
作者:
G
gaoxi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add testcase
Signed-off-by:
N
gaoxi
<
gaoxi785@huawei.com
>
上级
7461aa2f
变更
18
显示空白变更内容
内联
并排
Showing
18 changed file
with
481 addition
and
249 deletion
+481
-249
miscservices/InputMethodTest_ets/.idea/.deveco/project.cache.json
...ices/InputMethodTest_ets/.idea/.deveco/project.cache.json
+6
-0
miscservices/InputMethodTest_ets/.idea/.gitignore
miscservices/InputMethodTest_ets/.idea/.gitignore
+3
-0
miscservices/InputMethodTest_ets/.idea/InputMethodTest_ets.iml
...ervices/InputMethodTest_ets/.idea/InputMethodTest_ets.iml
+8
-0
miscservices/InputMethodTest_ets/.idea/modules.xml
miscservices/InputMethodTest_ets/.idea/modules.xml
+8
-0
miscservices/InputMethodTest_ets/.idea/vcs.xml
miscservices/InputMethodTest_ets/.idea/vcs.xml
+6
-0
miscservices/InputMethodTest_ets/entry/src/main/ets/test/InputRequestJsunit.test.ets
...t_ets/entry/src/main/ets/test/InputRequestJsunit.test.ets
+3
-1
miscservices/InputMethodTest_ets/entry/src/main/ets/test/InputmethodEngineJsunit.test.ets
.../entry/src/main/ets/test/InputmethodEngineJsunit.test.ets
+46
-7
miscservices/InputMethodTest_ets/local.properties
miscservices/InputMethodTest_ets/local.properties
+10
-0
miscservices/InputMethodTest_ets/package-lock.json
miscservices/InputMethodTest_ets/package-lock.json
+3
-0
miscservices/actspasteboardjsapitest/.idea/.deveco/project.cache.json
.../actspasteboardjsapitest/.idea/.deveco/project.cache.json
+6
-0
miscservices/actspasteboardjsapitest/.idea/.gitignore
miscservices/actspasteboardjsapitest/.idea/.gitignore
+3
-0
miscservices/actspasteboardjsapitest/.idea/actspasteboardjsapitest.iml
...actspasteboardjsapitest/.idea/actspasteboardjsapitest.iml
+8
-0
miscservices/actspasteboardjsapitest/.idea/modules.xml
miscservices/actspasteboardjsapitest/.idea/modules.xml
+8
-0
miscservices/actspasteboardjsapitest/.idea/vcs.xml
miscservices/actspasteboardjsapitest/.idea/vcs.xml
+6
-0
miscservices/actspasteboardjsapitest/entry/src/main/js/default/test/PasteBoardJsunit.test.js
...t/entry/src/main/js/default/test/PasteBoardJsunit.test.js
+338
-241
miscservices/actspasteboardjsapitest/local.properties
miscservices/actspasteboardjsapitest/local.properties
+10
-0
miscservices/actspasteboardjsapitest/package-lock.json
miscservices/actspasteboardjsapitest/package-lock.json
+3
-0
miscservices/wallpaper_js/src/main/js/Test/Wallpaper/WallpaperJsunit.test.js
...per_js/src/main/js/Test/Wallpaper/WallpaperJsunit.test.js
+6
-0
未找到文件。
miscservices/InputMethodTest_ets/.idea/.deveco/project.cache.json
0 → 100644
浏览文件 @
156c479e
{
"BuildOptions"
:{},
"CommonInfo"
:{
"project.ide.version"
:
"3.0.0.900"
}
}
\ No newline at end of file
miscservices/InputMethodTest_ets/.idea/.gitignore
0 → 100644
浏览文件 @
156c479e
# Default ignored files
/shelf/
/workspace.xml
miscservices/InputMethodTest_ets/.idea/InputMethodTest_ets.iml
0 → 100644
浏览文件 @
156c479e
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"EMPTY_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
>
<content
url=
"file://$MODULE_DIR$"
/>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
</module>
\ No newline at end of file
miscservices/InputMethodTest_ets/.idea/modules.xml
0 → 100644
浏览文件 @
156c479e
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectModuleManager"
>
<modules>
<module
fileurl=
"file://$PROJECT_DIR$/.idea/InputMethodTest_ets.iml"
filepath=
"$PROJECT_DIR$/.idea/InputMethodTest_ets.iml"
/>
</modules>
</component>
</project>
\ No newline at end of file
miscservices/InputMethodTest_ets/.idea/vcs.xml
0 → 100644
浏览文件 @
156c479e
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"$PROJECT_DIR$/../.."
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
miscservices/InputMethodTest_ets/entry/src/main/ets/test/InputRequestJsunit.test.ets
浏览文件 @
156c479e
...
...
@@ -29,11 +29,13 @@ export default function inputRequestJsunit() {
let caseName: string = "inputRequest_DownloadConfig_Test_001";
console.log(`==========> ${caseName} Test start ==========>`);
let downloadConfig = {
header: "HTTP",
url: "www.testdownload.com",
enableMetered: false,
enableRoaming: false,
description: "test download",
title: ""
title: "",
networkType: "",
};
try {
let promise = request.download(downloadConfig);
...
...
miscservices/InputMethodTest_ets/entry/src/main/ets/test/InputmethodEngineJsunit.test.ets
浏览文件 @
156c479e
...
...
@@ -64,12 +64,20 @@ export default function inputMethodEngineJsunit() {
});
mKeyboardDelegate = inputMethodEngine.createKeyboardDelegate();
mKeyboardDelegate.on('keyDown', (keyEvent) => {
console.
log("inputMethodEngine beforeEach keyDown:" + keyEvent
);
console.
info("inputMethodEngine beforeEach keyDown:" + keyEvent.keyCode
);
expect(keyEvent.keyCode).assertEqual('1');
console.info("inputMethodEngine beforeEach keyDown:" + keyEvent.keyAction);
expect(keyEvent.keyAction).assertEqual('1');
});
mKeyboardDelegate.on('keyUp', (keyEvent) => {
console.
log
("inputMethodEngine beforeEach keyUp:" + keyEvent.keyCode);
console.
info
("inputMethodEngine beforeEach keyUp:" + keyEvent.keyCode);
expect(keyEvent.keyCode).assertEqual('1');
console.info("inputMethodEngine beforeEach keyDown:" + keyEvent.keyAction);
expect(keyEvent.keyAction).assertEqual('0');
});
mKeyboardDelegate.on('cursorContextChange', (x, y, height) => {
console.log("inputMethodEngine beforeEach cursorContextChange x:" + x);
...
...
@@ -271,9 +279,12 @@ export default function inputMethodEngineJsunit() {
});
it('inputMethodEngine_test_027', 0, async function (done) {
let rect = await Utils.getComponentRect('TextInput')
console.info("[inputMethodEngine_test_027] rectInfo is " + rect);
console.info("[inputMethodEngine_test_027] rectInfo is " + JSON.stringify(rect));
let x_value = rect.left + (rect.right - rect.left) / 10
let y_value = rect.top + (rect.bottom - rect.top) / 10
console.info("[inputMethodEngine_test_027] onTouch location is: " + "[x]=== " + x_value + " [y]===" + y_value);
let point: TouchObject = {
...
...
@@ -433,7 +444,7 @@ export default function inputMethodEngineJsunit() {
expect(textInputClient == null).assertEqual(true);
} else {
textInputClient.getEditorAttribute(1, (editorAttribute) => {
console.log("inputMethodEngine_test_03
6
getEditorAttribute:" + value);
console.log("inputMethodEngine_test_03
8
getEditorAttribute:" + value);
expect(editorAttribute.inputPattern).assertEqual(1);
expect(editorAttribute.enterKeyType).assertEqual(1);
});
...
...
@@ -447,11 +458,11 @@ export default function inputMethodEngineJsunit() {
} else {
let promise = textInputClient.getEditorAttribute();
promise.then(res => {
console.info("inputMethodEngine_test_03
7
getEditorAttribute promise result-----" + JSON.stringify(res));
console.info("inputMethodEngine_test_03
9
getEditorAttribute promise result-----" + JSON.stringify(res));
expect(res.inputPattern).assertEqual(1);
expect(res.enterKeyType).assertEqual(1);
}).catch(err => {
console.info("inputMethodEngine_test_03
7
getEditorAttribute promise error----" + JSON.stringify(err));
console.info("inputMethodEngine_test_03
9
getEditorAttribute promise error----" + JSON.stringify(err));
expect().assertFail();
});
}
...
...
@@ -476,10 +487,38 @@ export default function inputMethodEngineJsunit() {
} else {
let promise = kbController.hideKeyboard();
promise.then(res => {
console.info("inputMethodEngine_test_0
37
hideKeyboard promise result-----" + JSON.stringify(res));
console.info("inputMethodEngine_test_0
41
hideKeyboard promise result-----" + JSON.stringify(res));
expect(1 == 1).assertTrue();
}).catch(err => {
console.info("inputMethodEngine_test_037 hideKeyboard promise error----" + JSON.stringify(err));
console.info("inputMethodEngine_test_041 hideKeyboard promise error----" + JSON.stringify(err));
expect().assertFail();
});
}
done();
});
it('inputMethodEngine_test_042', 0, async function (done) {
if (textInputClient == null) {
expect(textInputClient == null).assertEqual(true);
} else {
textInputClient.getBackward(1, (value) => {
console.info("inputMethodEngine_test_042 getBackward:" + value);
expect(value).assertEqual(true);
});
}
done();
});
it('inputMethodEngine_test_043', 0, async function (done) {
if (textInputClient == null) {
expect(textInputClient == null).assertEqual(true);
} else {
let promise = textInputClient.getBackward(1);
promise.then(res => {
console.info("inputMethodEngine_test_043 getBackward promise result-----" + JSON.stringify(res));
expect(res).assertEqual(true);
}).catch(err => {
console.info("inputMethodEngine_test_043 getBackward promise error----" + JSON.stringify(err));
expect().assertFail();
});
}
...
...
miscservices/InputMethodTest_ets/local.properties
0 → 100644
浏览文件 @
156c479e
# This file is automatically generated by DevEco Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file should *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# For customization when using a Version Control System, please read the header note.
sdk.dir
=
C:/Users/lwx1095534/AppData/Local/OpenHarmony/Sdk
nodejs.dir
=
D:/DevEco Studio/tools/nodejs
npm.dir
=
D:/DevEco Studio/tools/nodejs
\ No newline at end of file
miscservices/InputMethodTest_ets/package-lock.json
0 → 100644
浏览文件 @
156c479e
{
"lockfileVersion"
:
1
}
miscservices/actspasteboardjsapitest/.idea/.deveco/project.cache.json
0 → 100644
浏览文件 @
156c479e
{
"BuildOptions"
:{},
"CommonInfo"
:{
"project.ide.version"
:
"3.0.0.900"
}
}
\ No newline at end of file
miscservices/actspasteboardjsapitest/.idea/.gitignore
0 → 100644
浏览文件 @
156c479e
# Default ignored files
/shelf/
/workspace.xml
miscservices/actspasteboardjsapitest/.idea/actspasteboardjsapitest.iml
0 → 100644
浏览文件 @
156c479e
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"EMPTY_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
>
<content
url=
"file://$MODULE_DIR$"
/>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
</module>
\ No newline at end of file
miscservices/actspasteboardjsapitest/.idea/modules.xml
0 → 100644
浏览文件 @
156c479e
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectModuleManager"
>
<modules>
<module
fileurl=
"file://$PROJECT_DIR$/.idea/actspasteboardjsapitest.iml"
filepath=
"$PROJECT_DIR$/.idea/actspasteboardjsapitest.iml"
/>
</modules>
</component>
</project>
\ No newline at end of file
miscservices/actspasteboardjsapitest/.idea/vcs.xml
0 → 100644
浏览文件 @
156c479e
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"$PROJECT_DIR$/../.."
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
miscservices/actspasteboardjsapitest/entry/src/main/js/default/test/PasteBoardJsunit.test.js
浏览文件 @
156c479e
...
...
@@ -49,6 +49,11 @@ describe('PasteBoardTest', function() {
console
.
log
(
'
f_test1: systemPasteboard.hasPasteData promise data =
'
+
data
);
expect
(
data
===
true
||
data
===
false
).
assertTrue
();
var
types
=
pasteData
.
getMimeTypes
();
console
.
info
(
'
f_test1: getMimeTypes =
'
+
types
);
console
.
info
(
'
f_test1: getMimeTypes =
'
+
typeof
(
types
));
expect
(
"
text/plain
"
).
assertEqual
(
types
[
0
]);
console
.
log
(
'
f_test1: Checks the number of records
'
);
systemPasteboard
.
getPasteData
().
then
((
data
)
=>
{
console
.
log
(
'
f_test1: systemPasteboard.getPasteData data =
'
+
JSON
.
stringify
(
data
));
...
...
@@ -59,6 +64,15 @@ describe('PasteBoardTest', function() {
var
primaryText
=
pasteData1
.
getPrimaryText
()
console
.
log
(
'
f_test1: primaryText =
'
+
primaryText
);
console
.
info
(
'
Checks pasteboard MAX_RECORD_NUM
'
+
pasteboard
.
MAX_RECORD_NUM
);
expect
(
pasteboard
.
MAX_RECORD_NUM
==
128
).
assertTrue
();
console
.
info
(
'
Checks PasteDataProperty.localOnly
'
)
var
pasteDataProperty
=
pasteData1
.
getProperty
()
console
.
info
(
'
Checks: localOnly =
'
+
pasteDataProperty
.
localOnly
)
console
.
log
(
'
Checks there is a MIMETYPE_TEXT_PLAIN MIME type of data
'
+
pasteboard
.
MIMETYPE_TEXT_PLAIN
);
console
.
log
(
'
f_test1: getPrimaryMimeType =
'
+
pasteData1
.
getPrimaryMimeType
());
...
...
@@ -310,6 +324,11 @@ describe('PasteBoardTest', function() {
var
pasteData1
=
data
;
expect
(
pasteData1
.
getRecordCount
()
==
1
).
assertTrue
();
console
.
info
(
'
f_test6: Checks the pasteboard content
'
);
var
primaryHtml
=
pasteData1
.
getPrimaryHtml
()
console
.
info
(
'
f_test6: getPrimaryHtml =
'
+
primaryHtml
);
expect
(
primaryHtml
==
htmlText
).
assertTrue
();
console
.
log
(
'
Checks there is a MIMETYPE_TEXT_HTML MIME type of data
'
+
pasteboard
.
MIMETYPE_TEXT_HTML
);
expect
(
pasteData1
.
hasMimeType
(
pasteboard
.
MIMETYPE_TEXT_HTML
)
===
true
||
pasteData1
.
hasMimeType
(
pasteboard
.
MIMETYPE_TEXT_HTML
)
===
false
).
assertTrue
();
...
...
@@ -448,6 +467,11 @@ describe('PasteBoardTest', function() {
var
pasteData1
=
data
;
expect
(
pasteData1
.
getRecordCount
()
==
1
).
assertTrue
();
console
.
info
(
'
f_test9: Checks the pasteboard content
'
);
var
primaryUri
=
pasteData1
.
getPrimaryUri
()
console
.
info
(
'
f_test9: getPrimaryUri =
'
+
primaryUri
);
expect
(
primaryUri
==
uriText
).
assertTrue
();
console
.
log
(
'
Checks there is a MIMETYPE_TEXT_URI MIME type of data
'
+
pasteboard
.
MIMETYPE_TEXT_URI
);
expect
(
pasteData1
.
hasMimeType
(
pasteboard
.
MIMETYPE_TEXT_URI
)
===
true
||
pasteData1
.
hasMimeType
(
pasteboard
.
MIMETYPE_TEXT_URI
)
===
false
).
assertTrue
();
...
...
@@ -569,9 +593,15 @@ describe('PasteBoardTest', function() {
bundleName
:
"
com.example.myapplication8
"
,
abilityName
:
"
com.example.myapplication8.MainAbility
"
}
console
.
log
(
'
f_test12: createWantData want =
'
+
want
);
console
.
info
(
'
f_test12: createWantData want.bundleName =
'
+
want
.
bundleName
);
console
.
info
(
'
f_test12: createWantData want.bundleName =
'
+
want
.
abilityName
);
var
pasteData
=
pasteboard
.
createWantData
(
want
);
console
.
log
(
'
f_test12: createWantData pasteData =
'
+
JSON
.
stringify
(
pasteData
));
console
.
info
(
'
f_test12: createWantData pasteData =
'
+
pasteData
);
console
.
info
(
'
f_test12: createWantData pasteData =
'
+
JSON
.
stringify
(
pasteData
));
console
.
log
(
'
f_test12: Writes PasteData to the pasteboard
'
);
systemPasteboard
.
setPasteData
(
pasteData
).
then
(()
=>
{
...
...
@@ -588,6 +618,13 @@ describe('PasteBoardTest', function() {
var
pasteData1
=
data
;
expect
(
pasteData1
.
getRecordCount
()
==
1
).
assertTrue
();
console
.
info
(
'
f_test12: Checks the pasteboard content
'
);
var
primaryWant
=
pasteData1
.
getPrimaryWant
()
console
.
info
(
'
f_test12: createWantData want.bundleName =
'
+
primaryWant
.
bundleName
);
console
.
info
(
'
f_test12: createWantData want.bundleName =
'
+
primaryWant
.
abilityName
);
expect
(
want
.
bundleName
).
assertEqual
(
primaryWant
.
bundleName
);
expect
(
want
.
abilityName
).
assertEqual
(
primaryWant
.
abilityName
);
console
.
log
(
'
Checks there is a MIMETYPE_TEXT_WANT MIME type of data
'
+
pasteboard
.
MIMETYPE_TEXT_WANT
);
expect
(
pasteData1
.
hasMimeType
(
pasteboard
.
MIMETYPE_TEXT_WANT
)
===
true
||
pasteData1
.
hasMimeType
(
pasteboard
.
MIMETYPE_TEXT_WANT
)
===
false
).
assertTrue
();
...
...
@@ -880,6 +917,14 @@ describe('PasteBoardTest', function() {
console
.
log
(
'
f_test18: addUriRecord =
'
+
uriText
)
pasteData
.
addUriRecord
(
uriText
)
var
want
=
{
bundleName
:
"
com.example.myapplication8
"
,
abilityName
:
"
com.example.myapplication8.MainAbility
"
}
console
.
info
(
'
f_test18: addWantRecord =
'
+
want
)
pasteData
.
addWantRecord
(
want
)
console
.
log
(
'
f_test18: Writes PasteData to the pasteboard
'
);
systemPasteboard
.
setPasteData
(
pasteData
).
then
(()
=>
{
console
.
log
(
'
f_test18: systemPasteboard.setPasteData promise
'
);
...
...
@@ -893,7 +938,7 @@ describe('PasteBoardTest', function() {
systemPasteboard
.
getPasteData
().
then
((
data
)
=>
{
console
.
log
(
'
f_test18: systemPasteboard.getPasteData data =
'
+
JSON
.
stringify
(
data
));
var
pasteData1
=
data
;
expect
(
pasteData1
.
getRecordCount
()
==
3
).
assertTrue
();
expect
(
pasteData1
.
getRecordCount
()
==
4
).
assertTrue
();
console
.
log
(
'
SUB_pasteBoard_function_JS_API_1800 end
'
);
done
();
...
...
@@ -1725,42 +1770,42 @@ describe('PasteBoardTest', function() {
* @tc.level : Level 0
*/
it
(
'
pasteboard_function_test33
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
SUB_pasteBoard_function_JS_API_3300 start
'
)
console
.
info
(
'
SUB_pasteBoard_function_JS_API_3300 start
'
)
var
systemPasteboard
=
pasteboard
.
getSystemPasteboard
();
systemPasteboard
.
clear
().
then
(()
=>
{
console
.
log
(
'
f_test33: systemPasteboard.clear promise
'
);
console
.
info
(
'
f_test33: systemPasteboard.clear promise
'
);
var
textData0
=
'
Hello World!
'
;
console
.
log
(
'
f_test33: createPlainTextData textData =
'
+
textData0
);
console
.
info
(
'
f_test33: createPlainTextData textData =
'
+
textData0
);
var
pasteData
=
pasteboard
.
createPlainTextData
(
textData0
);
console
.
log
(
'
f_test33: createPlainTextData pasteData =
'
+
JSON
.
stringify
(
pasteData
));
console
.
info
(
'
f_test33: createPlainTextData pasteData =
'
+
JSON
.
stringify
(
pasteData
));
var
textData
=
''
for
(
var
i
=
1
;
i
<
2
;
i
++
)
{
textData
=
'
Hello World
'
textData
=
textData
+
i
console
.
log
(
'
f_test33: addTextRecord =
'
+
textData
)
console
.
info
(
'
f_test33: addTextRecord =
'
+
textData
)
pasteData
.
addTextRecord
(
textData
)
}
console
.
log
(
'
f_test33: Writes PasteData to the pasteboard
'
);
console
.
info
(
'
f_test33: Writes PasteData to the pasteboard
'
);
systemPasteboard
.
setPasteData
(
pasteData
).
then
(()
=>
{
console
.
log
(
'
f_test33: systemPasteboard.setPasteData promise
'
);
console
.
info
(
'
f_test33: systemPasteboard.setPasteData promise
'
);
console
.
log
(
'
f_test33: Checks there is content in the pasteboard
'
)
console
.
info
(
'
f_test33: Checks there is content in the pasteboard
'
)
systemPasteboard
.
hasPasteData
().
then
((
data
)
=>
{
console
.
log
(
'
f_test33: systemPasteboard.hasPasteData promise data =
'
+
data
);
console
.
info
(
'
f_test33: systemPasteboard.hasPasteData promise data =
'
+
data
);
expect
(
data
===
true
||
data
===
false
).
assertTrue
();
console
.
log
(
'
f_test33: Checks the number of records
'
);
console
.
info
(
'
f_test33: Checks the number of records
'
);
systemPasteboard
.
getPasteData
().
then
((
data
)
=>
{
console
.
log
(
'
f_test33: systemPasteboard.getPasteData data =
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
f_test33: systemPasteboard.getPasteData data =
'
+
JSON
.
stringify
(
data
));
var
pasteData1
=
data
;
expect
(
pasteData1
.
getRecordCount
()
==
2
).
assertTrue
();
console
.
log
(
'
SUB_pasteBoard_function_
JS_API_3300 end
'
);
console
.
info
(
'
SUB_pasteBoard_function_.
'
+
'
JS_API_3300 end
'
);
done
();
})
});
...
...
@@ -3438,6 +3483,8 @@ describe('PasteBoardTest', function() {
console
.
log
(
'
f_test66 Converts the PlainTextData to text
'
)
var
pasteDataRecord
=
pasteData1
.
getRecordAt
(
0
)
console
.
info
(
'
checks pasteDataRecord.mimeType =
'
+
pasteDataRecord
.
mimeType
)
console
.
log
(
'
f_test66 pasteDataRecord.convertToText =
'
+
pasteDataRecord
.
convertToText
);
console
.
log
(
'
f_test66 SUB_pasteBoard_function_JS_API_6600 end
'
);
...
...
@@ -3592,10 +3639,60 @@ describe('PasteBoardTest', function() {
});
})
/**
* @tc.number SUB_pasteBoard_function_JS_API_7000
* @tc.name 复制文本、uri格式
* @tc.desc Test pasteBoard API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
pasteboard_function_test70
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
SUB_pasteBoard_function_JS_API_7000 start
'
)
var
systemPasteboard
=
pasteboard
.
getSystemPasteboard
();
systemPasteboard
.
clear
().
then
(()
=>
{
var
textData0
=
'
Hello World0
'
console
.
info
(
'
f_test70: createPlainTextData =
'
+
textData0
)
var
pasteData
=
pasteboard
.
createPlainTextData
(
textData0
)
console
.
info
(
'
f_test70: createPlainTextData =
'
+
JSON
.
stringify
(
pasteData
))
var
uriText
=
pasteboard
.
createUriRecord
(
"
https://www.baidu.com/
"
);
pasteData
.
addRecord
(
uriText
);
console
.
info
(
'
f_test70: addRecord(uriText) =
'
+
pasteData
)
console
.
info
(
'
f_test70: addRecord(uriText) =
'
+
JSON
.
stringify
(
pasteData
))
systemPasteboard
.
setPasteData
(
pasteData
).
then
(()
=>
{
console
.
info
(
'
---------------------------->1
'
)
systemPasteboard
.
hasPasteData
().
then
((
data
)
=>
{
console
.
info
(
'
f_test70: systemPasteboard.hasPasteData promise data =
'
+
data
);
expect
(
data
===
true
||
data
===
false
).
assertTrue
();
systemPasteboard
.
getPasteData
().
then
((
data
)
=>
{
console
.
info
(
'
f_test70: systemPasteboard.getPasteData data =
'
+
JSON
.
stringify
(
data
));
var
pasteData1
=
data
;
var
recordCount
=
pasteData1
.
getRecordCount
();
console
.
info
(
'
f_test70: recordCount=
'
+
recordCount
);
expect
(
pasteData1
.
getRecordCount
()
==
2
).
assertTrue
();
console
.
info
(
'
SUB_pasteBoard_function_JS_API_7000 end
'
);
done
();
})
});
});
});
})
/**
* The callback function is used for pasteboard content changes
*/
function
contentChanges
()
{
console
.
log
(
'
#EVENT: The content is changed in the pasteboard
'
)
}
})
})
;
miscservices/actspasteboardjsapitest/local.properties
0 → 100644
浏览文件 @
156c479e
# This file is automatically generated by DevEco Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file should *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# For customization when using a Version Control System, please read the header note.
sdk.dir
=
C:/Users/lwx1095534/AppData/Local/OpenHarmony/Sdk
nodejs.dir
=
D:/DevEco Studio/tools/nodejs
npm.dir
=
D:/DevEco Studio/tools/nodejs
\ No newline at end of file
miscservices/actspasteboardjsapitest/package-lock.json
0 → 100644
浏览文件 @
156c479e
{
"lockfileVersion"
:
1
}
miscservices/wallpaper_js/src/main/js/Test/Wallpaper/WallpaperJsunit.test.js
浏览文件 @
156c479e
...
...
@@ -74,6 +74,12 @@ describe('WallpaperJsunitTest', function () {
await
wallpaper
.
getColors
(
WALLPAPER_SYSTEM
,
function
(
err
,
data
)
{
console
.
info
(
'
wallpaperXTS ===> testGetColorsCallbackSystem err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
wallpaperXTS ===> testGetColorsCallbackSystem data :
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
wallpaperXTS ===> testGetColorsCallbackSystem data :
'
+
data
[
0
][
0
]);
console
.
info
(
'
wallpaperXTS ===> testGetColorsCallbackSystem data :
'
+
data
[
0
][
1
]);
console
.
info
(
'
wallpaperXTS ===> testGetColorsCallbackSystem data :
'
+
data
[
0
][
2
]);
console
.
info
(
'
wallpaperXTS ===> testGetColorsCallbackSystem data :
'
+
data
[
0
][
3
]);
if
(
err
)
{
expect
(
null
).
assertFail
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录