Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
12f49a2d
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
12f49a2d
编写于
3月 16, 2022
作者:
W
weier
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Signed-off-by: weier <duanlinrang@huawei.com>
Changes to be committed:
上级
d6a5ed6d
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
682 addition
and
0 deletion
+682
-0
miscservices/RequestTest_js/BUILD.gn
miscservices/RequestTest_js/BUILD.gn
+30
-0
miscservices/RequestTest_js/Test.json
miscservices/RequestTest_js/Test.json
+23
-0
miscservices/RequestTest_js/entry/src/main/config.json
miscservices/RequestTest_js/entry/src/main/config.json
+56
-0
miscservices/RequestTest_js/entry/src/main/js/Test/List.test.js
...rvices/RequestTest_js/entry/src/main/js/Test/List.test.js
+16
-0
miscservices/RequestTest_js/entry/src/main/js/Test/Publicfunction.js
...s/RequestTest_js/entry/src/main/js/Test/Publicfunction.js
+121
-0
miscservices/RequestTest_js/entry/src/main/js/Test/UploadCallbackXTSJsunit.test.js
...js/entry/src/main/js/Test/UploadCallbackXTSJsunit.test.js
+296
-0
miscservices/RequestTest_js/entry/src/main/js/default/app.js
miscservices/RequestTest_js/entry/src/main/js/default/app.js
+23
-0
miscservices/RequestTest_js/entry/src/main/js/default/i18n/en-US.json
.../RequestTest_js/entry/src/main/js/default/i18n/en-US.json
+6
-0
miscservices/RequestTest_js/entry/src/main/js/default/i18n/zh-CN.json
.../RequestTest_js/entry/src/main/js/default/i18n/zh-CN.json
+6
-0
miscservices/RequestTest_js/entry/src/main/js/default/pages/index/index.css
...stTest_js/entry/src/main/js/default/pages/index/index.css
+46
-0
miscservices/RequestTest_js/entry/src/main/js/default/pages/index/index.hml
...stTest_js/entry/src/main/js/default/pages/index/index.hml
+5
-0
miscservices/RequestTest_js/entry/src/main/js/default/pages/index/index.js
...estTest_js/entry/src/main/js/default/pages/index/index.js
+42
-0
miscservices/RequestTest_js/entry/src/main/resources/base/element/string.json
...Test_js/entry/src/main/resources/base/element/string.json
+12
-0
miscservices/RequestTest_js/entry/src/main/resources/base/media/icon.png
...questTest_js/entry/src/main/resources/base/media/icon.png
+0
-0
miscservices/RequestTest_js/signature/openharmony_sx.p7b
miscservices/RequestTest_js/signature/openharmony_sx.p7b
+0
-0
未找到文件。
miscservices/RequestTest_js/BUILD.gn
0 → 100644
浏览文件 @
12f49a2d
# 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.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("miscservices_request_js_test") {
hap_profile = "./entry/src/main/config.json"
deps = [
":request_js_assets",
":request_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "MiscservicesRequestJSApiTest"
}
ohos_js_assets("request_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("request_js_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
miscservices/RequestTest_js/Test.json
0 → 100644
浏览文件 @
12f49a2d
{
"description"
:
"Configuration for MiscservicesRequestJSApiTest js api Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"4200000"
,
"package"
:
"com.example.myapplication.hmservice"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"MiscservicesRequestJSApiTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"mkdir -p /data/accounts/account_0/appdata/com.example.myapplication.hmservice/cache"
,
"echo
\"
123456
\"
> /data/accounts/account_0/appdata/com.example.myapplication.hmservice/cache/test.txt"
]
}
]
}
miscservices/RequestTest_js/entry/src/main/config.json
0 → 100644
浏览文件 @
12f49a2d
{
"app"
:
{
"bundleName"
:
"com.example.myapplication.hmservice"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
6
,
"target"
:
6
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.myapplication.hmservice"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
"com.example.myapplication.hmservice.MainAbility"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
true
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.myapplication.hmservice.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
,
"visible"
:
true
,
"isVisible"
:
"true"
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
}
}
]
}
}
miscservices/RequestTest_js/entry/src/main/js/Test/List.test.js
0 → 100644
浏览文件 @
12f49a2d
/*
* 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.
*/
require
(
'
./UploadCallbackXTSJsunit.test.js
'
)
miscservices/RequestTest_js/entry/src/main/js/Test/Publicfunction.js
0 → 100644
浏览文件 @
12f49a2d
/*
* 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.
*/
import
{
describe
,
it
,
expect
}
from
'
deccjsunit/index
'
import
request
from
'
@ohos.request
'
let
RequestData
=
[{
name
:
''
,
// Represents the name of the form element.
value
:
''
// Represents the value of the form element.
}]
let
RequestDataArray
=
new
Array
();
function
sleep
(
ms
)
{
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
ms
));
}
function
getUploadConfig
(
fileurl
){
let
File
=
{
filename
:
'
test
'
,
// When multipart is submitted, the file name in the request header.
name
:
'
test
'
,
// When multipart is submitted, the name of the form item. The default is file.
uri
:
'
internal://cache/test.txt
'
,
//The local storage path of the file (please refer to the storage directory definition for path usage).
type
:
'
txt
'
//The content type of the file is obtained by default according to the suffix of the file name or path.
}
let
FileArray
=
new
Array
();
FileArray
[
0
]
=
File
;
let
header_http
=
{
headers
:
'
http
'
}
let
UploadConfig
=
{
url
:
'
http://192.168.112.124/upload_test/
'
,
// Resource address.
header
:
header_http
,
// Adds an HTTP or HTTPS header to be included with the upload request.
method
:
'
POST
'
,
// Request method: POST, PUT. The default POST.
files
:
FileArray
,
// A list of files to be uploaded. Please use multipart/form-data to submit.
data
:
RequestData
// The requested form data.
}
return
UploadConfig
}
//upload公共方法
function
publicupload
(
UploadConfig
){
console
.
log
(
`Testupdate UploadConfig
${
JSON
.
stringify
(
UploadConfig
)}
`
)
return
new
Promise
(
function
(
resolve
,
reject
)
{
request
.
upload
(
UploadConfig
,
(
err
,
data
)
=>
{
console
.
log
(
"
Testupdate publiconprogress Updatetask =
"
+
JSON
.
stringify
(
data
));
resolve
(
data
);
})
})
}
//onprogress公共方法
function
publiconprogress
(
Updatetask
,
Type
){
return
new
Promise
(
function
(
resolve
,
reject
)
{
Updatetask
.
on
(
Type
,
function
(
data1
,
data2
){
let
progress
=
{
uploadedSize
:
data1
,
totalSize
:
data2
}
console
.
log
(
"
Testupdate publiconprogress uploadedSize =
"
+
data1
);
console
.
log
(
"
Testupdate publiconprogress totalSize =
"
+
data2
);
resolve
(
progress
);
})
})
}
//offprogress公共方法
function
publicoffprogress
(
Updatetask
,
Type
){
return
new
Promise
(
function
(
resolve
,
reject
)
{
Updatetask
.
off
(
Type
,
function
(
data1
,
data2
){
let
progress
=
{
uploadedSize
:
data1
,
totalSize
:
data2
}
console
.
log
(
"
Testupdate publicoffprogress uploadedSize =
"
+
data1
);
console
.
log
(
"
Testupdate publicoffprogress totalSize =
"
+
data2
);
resolve
(
progress
);
})
})
}
//其他on公共方法
function
publicon
(
Updatetask
,
Type
){
return
new
Promise
(
function
(
resolve
,
reject
)
{
Updatetask
.
on
(
Type
,
function
(
data
){
console
.
log
(
"
Testupdate publicon =
"
+
data
);
resolve
(
data
);
})
})
}
//其他off公共方法
function
publicoff
(
Updatetask
,
Type
){
return
new
Promise
(
function
(
resolve
,
reject
)
{
Updatetask
.
off
(
Type
,
function
(
data
){
console
.
log
(
"
Testupdate publicoff =
"
+
data
);
resolve
(
data
);
})
})
}
//remove公共方法
function
publicremove
(
Updatetask
,
Type
){
return
new
Promise
(
function
(
resolve
,
reject
)
{
Updatetask
.
remove
((
err
,
data
)
=>
{
console
.
log
(
"
Testupdate publicremove =
"
+
data
);
resolve
(
data
);
})
})
}
export
{
publicupload
,
publicon
,
publicoff
,
publicremove
,
publiconprogress
,
publicoffprogress
,
getUploadConfig
,
sleep
}
\ No newline at end of file
miscservices/RequestTest_js/entry/src/main/js/Test/UploadCallbackXTSJsunit.test.js
0 → 100644
浏览文件 @
12f49a2d
/*
* 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.
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
request
from
'
@ohos.request
'
;
import
*
as
pubfun
from
'
./Publicfunction.js
'
var
type_progress
=
'
progress
'
;
var
type_HeaderReceive
=
'
headerReceive
'
;
var
type_Fail
=
'
fail
'
;
let
uploadTask
;
let
file7url
=
'
internal://cache/test.txt
'
;
//let file10kurl = '';
//let file10murl = '';
// var shell = require('shelljs')
describe
(
'
UploadTest
'
,
function
()
{
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll: Prerequisites at the test suite level, which are executed before the test suite is executed.
'
);
})
beforeEach
(
function
()
{
console
.
info
(
'
beforeEach: Prerequisites at the test case level, which are executed before each test case is executed.
'
);
})
afterEach
(
function
()
{
console
.
info
(
'
afterEach: Test case-level clearance conditions, which are executed after each test case is executed.
'
);
})
afterAll
(
function
()
{
console
.
info
(
'
afterAll: Test suite-level cleanup condition, which is executed after the test suite is executed
'
);
})
/*
* @tc.number : InitUploadtaskCallback001
* @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
*/
it
(
'
InitUploadtaskCallback001
'
,
0
,
async
function
(
done
)
{
try
{
// const cmd = `echo \"123456\" > /data/accounts/account_0/appdata/com.example.myapplication.hmservice/cache/test.txt`;
// shell.exec(cmd, (err) => {
// if (err) {
// throw Error(err).message;
// }
// })
console
.
log
(
"
Testupdate before getuploadconfig
"
);
let
UploadConfig
=
pubfun
.
getUploadConfig
(
file7url
)
console
.
log
(
"
Testupdate before upload UploadConfig =
"
+
JSON
.
stringify
(
UploadConfig
));
console
.
log
(
"
Testupdate before upload
"
);
await
pubfun
.
publicupload
(
UploadConfig
).
then
((
data
)
=>
{
console
.
log
(
"
Testupdate going upload uploadTask =
"
+
data
);
uploadTask
=
data
;
expect
(
true
).
assertEqual
((
data
!=
undefined
)
||
(
data
!=
""
)
||
(
data
!=
{}));
done
();
}).
catch
((
err
)
=>
{
console
.
log
(
"
InitUploadtaskCallback001 fail 1
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertFail
();
done
();
})
}
catch
(
e
)
{
console
.
log
(
"
InitUploadtaskCallback001 fail 2
"
+
JSON
.
stringify
(
e
));
expect
(
e
).
assertFail
();
done
();
}
})
/*
* @tc.number : SwitchOnProgressCallback001
* @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
*/
it
(
'
SwitchOnProgressCallback001
'
,
0
,
async
function
(
done
)
{
try
{
/*console.log("Testupdate before getuploadconfig");
let UploadConfig = pubfun.getUploadConfig(file7url)
console.log("Testupdate before upload UploadConfig = " + JSON.stringify(UploadConfig));
console.log("Testupdate before upload");
await pubfun.publicupload(UploadConfig).then((data) => {
console.log("Testupdate going upload uploadTask = " + data);
uploadTask = data;
}).catch((err) => {
console.log("SwitchOnProgressCallback001 fail" + JSON.stringify(err));
})*/
pubfun
.
publiconprogress
(
uploadTask
,
type_progress
);
expect
(
true
).
assertEqual
(
0
==
0
);
done
();
}
catch
(
err
)
{
console
.
log
(
"
Testupdate SwitchOnProgressCallback001 catch err
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertFail
();
done
();
}
});
/*
* @tc.number : SwitchOffProgressCallback001
* @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
*/
it
(
'
SwitchOffProgressCallback001
'
,
0
,
async
function
(
done
)
{
try
{
/*let UploadConfig = pubfun.getUploadConfig(file7url)
await pubfun.publicupload(UploadConfig).then((data) => {
uploadTask = data;
}).catch((err) => {
console.log("SwitchOffProgressCallback001 fail 1" + JSON.stringify(err));
})*/
pubfun
.
publiconprogress
(
uploadTask
,
type_progress
);
expect
(
true
).
assertEqual
(
0
==
0
);
await
pubfun
.
publicoffprogress
(
uploadTask
,
type_progress
).
then
((
data
)
=>
{
console
.
log
(
"
SwitchOffProgressCallback001 data
"
+
JSON
.
stringify
(
data
));
expect
(
7
).
assertEqual
(
data
.
totalSize
);
done
();
}).
catch
((
err
)
=>
{
console
.
log
(
"
SwitchOffProgressCallback001 fail 2
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertFail
();
done
();
})
}
catch
(
e
)
{
console
.
log
(
"
SwitchOffProgressCallback001 fail 3
"
+
JSON
.
stringify
(
e
));
expect
(
e
).
assertFail
();
done
();
}
})
/*
* @tc.number : SwitchOnHeaderReceiveCallback001
* @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
*/
/*it('SwitchOnHeaderReceiveCallback001', 0, async function (done) {
try {
let UploadConfig = pubfun.getUploadConfig(file7url)
await pubfun.publicupload(UploadConfig).then((data) => {
uploadTask = data;
}).catch((err) => {
console.log("SwitchOnHeaderReceiveCallback001 fail 1" + JSON.stringify(err));
})
await pubfun.publicon(uploadTask,type_HeaderReceive).then((data) => {
console.info("upOnHeader headers:" + JSON.stringify(data));
expect('待确认').assertEqual(data);
done();
}).catch((err) => {
console.log("SwitchOnHeaderReceiveCallback001 fail 2" + JSON.stringify(err));
})
} catch (e) {
console.log("SwitchOnHeaderReceiveCallback001 fail 3" + JSON.stringify(e));
expect(null).assertFail();
}
})
/*
* @tc.number : SwitchOffHeaderReceiveCallback001
* @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
*/
/*it('SwitchOffHeaderReceiveCallback001', 0, async function (done) {
try {
let UploadConfig = pubfun.getUploadConfig(file7url)
await pubfun.publicupload(UploadConfig).then((data) => {
uploadTask = data;
}).catch((err) => {
console.log("SwitchOffHeaderReceiveCallback001 fail 1" + JSON.stringify(err));
})
await pubfun.publicoff(uploadTask,type_HeaderReceive).then((data) => {
console.info("upOnHeader headers:" + JSON.stringify(data));
expect('待确认').assertEqual(data);
done();
}).catch((err) => {
console.log("SwitchOffHeaderReceiveCallback001 fail 2" + JSON.stringify(err));
})
} catch (e) {
console.log("SwitchOffHeaderReceiveCallback001 fail 3" + JSON.stringify(e));
expect(null).assertFail();
}
})
/*
* @tc.number : SwitchOnFailCallback001
* @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
*/
it
(
'
SwitchOnFailCallback001
'
,
0
,
async
function
(
done
)
{
try
{
/*let UploadConfig = pubfun.getUploadConfig(file7url)
await pubfun.publicupload(UploadConfig).then((data) => {
uploadTask = data;
}).catch((err) => {
console.log("SwitchOnFailCallback001 fail 1" + JSON.stringify(err));
})*/
await
pubfun
.
publicon
(
uploadTask
,
type_Fail
).
then
((
data
)
=>
{
console
.
log
(
"
SwitchOnFailCallback001 data
"
+
data
);
expect
(
5
).
assertEqual
(
data
);
done
();
}).
catch
((
err
)
=>
{
console
.
log
(
"
SwitchOnFailCallback001 fail 2
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertFail
();
done
();
})
}
catch
(
e
)
{
console
.
log
(
"
SwitchOnFailCallback001 fail 3
"
+
JSON
.
stringify
(
e
));
expect
(
e
).
assertFail
();
done
();
}
})
/*
* @tc.number : SwitchOffFailCallback001
* @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
*/
it
(
'
SwitchOffFailCallback001
'
,
0
,
async
function
(
done
)
{
try
{
/*let UploadConfig = pubfun.getUploadConfig(file7url)
await pubfun.publicupload(UploadConfig).then((data) => {
uploadTask = data;
}).catch((err) => {
console.log("SwitchOffFailCallback001 fail 1" + JSON.stringify(err));
})*/
await
pubfun
.
publicon
(
uploadTask
,
type_Fail
)
await
pubfun
.
publicoff
(
uploadTask
,
type_Fail
).
then
((
data
)
=>
{
console
.
log
(
"
SwitchOffFailCallback001 data
"
+
data
);
expect
(
5
).
assertEqual
(
data
);
done
();
}).
catch
((
err
)
=>
{
console
.
log
(
"
SwitchOffFailCallback001 fail 2
"
+
JSON
.
stringify
(
err
));
done
();
expect
(
err
).
assertFail
();
})
}
catch
(
e
)
{
console
.
log
(
"
SwitchOffFailCallback001 fail 3
"
+
JSON
.
stringify
(
e
));
expect
(
e
).
assertFail
();
done
();
}
})
/*
* @tc.number : RemoveCallback001
* @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
*/
it
(
'
RemoveCallback001
'
,
0
,
async
function
(
done
)
{
try
{
/*let UploadConfig = pubfun.getUploadConfig(file7url)
await pubfun.publicupload(UploadConfig).then((data) => {
uploadTask = data;
}).catch((err) => {
console.log("RemoveCallback001 fail 1" + JSON.stringify(err));
})*/
await
pubfun
.
publicremove
(
uploadTask
).
then
((
data
)
=>
{
console
.
log
(
"
RemoveCallback001 data
"
+
data
);
expect
(
true
).
assertEqual
(
data
);
done
();
}).
catch
((
err
)
=>
{
console
.
log
(
"
RemoveCallback001 fail 2
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertFail
();
done
();
})
}
catch
(
e
)
{
console
.
log
(
"
RemoveCallback001 fail 3
"
+
JSON
.
stringify
(
e
));
expect
(
e
).
assertFail
();
done
();
}
})
})
\ No newline at end of file
miscservices/RequestTest_js/entry/src/main/js/default/app.js
0 → 100644
浏览文件 @
12f49a2d
/*
* 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.
*/
export
default
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
)
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
)
},
}
miscservices/RequestTest_js/entry/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
12f49a2d
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
miscservices/RequestTest_js/entry/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
12f49a2d
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
miscservices/RequestTest_js/entry/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
12f49a2d
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
width
:
100%
;
height
:
100%
;
}
.title
{
font-size
:
40px
;
color
:
#000000
;
opacity
:
0.9
;
}
@media
screen
and
(
device-type
:
tablet
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
100px
;
}
}
@media
screen
and
(
device-type
:
wearable
)
{
.title
{
font-size
:
28px
;
color
:
#FFFFFF
;
}
}
@media
screen
and
(
device-type
:
tv
)
{
.container
{
background-image
:
url("/common/images/Wallpaper.png")
;
background-size
:
cover
;
background-repeat
:
no-repeat
;
background-position
:
center
;
}
.title
{
font-size
:
100px
;
color
:
#FFFFFF
;
}
}
@media
screen
and
(
device-type
:
phone
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
60px
;
}
}
miscservices/RequestTest_js/entry/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
12f49a2d
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
miscservices/RequestTest_js/entry/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
12f49a2d
/*
* 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.
*/
import
{
Core
,
ExpectExtend
}
from
'
deccjsunit/index
'
import
{
DataDriver
}
from
'
deccjsunit
'
export
default
{
data
:
{
title
:
''
,
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
)
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
id
:
'
extend
'
,
})
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
configService
.
setConfig
(
this
)
console
.
log
(
'
test start
'
)
require
(
'
../../../Test/List.test.js
'
)
core
.
execute
()
this
.
title
=
this
.
$t
(
'
strings.bye
'
)
},
onReady
()
{},
}
miscservices/RequestTest_js/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
12f49a2d
{
"string"
:
[
{
"name"
:
"entry_MainAbility"
,
"value"
:
"entry_MainAbility"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Empty Ability"
}
]
}
\ No newline at end of file
miscservices/RequestTest_js/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
12f49a2d
6.6 KB
miscservices/RequestTest_js/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
12f49a2d
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录