Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
72172efa
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,发现更多精彩内容 >>
提交
72172efa
编写于
11月 27, 2021
作者:
O
openharmony_ci
提交者:
Gitee
11月 27, 2021
浏览文件
操作
浏览文件
下载
差异文件
!1211 modify testcases on 20211127
Merge pull request !1211 from 杨清/0924
上级
c43c6e79
7c814cd2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
121 addition
and
0 deletion
+121
-0
updater/update_test/src/main/js/default/test/update.test.js
updater/update_test/src/main/js/default/test/update.test.js
+121
-0
未找到文件。
updater/update_test/src/main/js/default/test/update.test.js
浏览文件 @
72172efa
...
...
@@ -1948,4 +1948,125 @@ describe('updateclient', function() {
console
.
info
(
'
[verifyVersion] success.
'
);
console
.
info
(
'
testVerifyVersion05 END
'
);
});
/**
* @tc.number SUB_UPDATE_JS_API_0086
* @tc.name testPackageTypes
* @tc.desc check packageTypes is defined correct.
*/
it
(
'
testPackageTypes
'
,
0
,
function
()
{
console
.
info
(
'
testPackageTypes START
'
);
try
{
expect
(
updater
.
PackageTypes
.
PACKAGE_TYPE_NORMAL
).
assertEqual
(
1
);
expect
(
updater
.
PackageTypes
.
PACKAGE_TYPE_BASE
).
assertEqual
(
2
);
expect
(
updater
.
PackageTypes
.
PACKAGE_TYPE_CUST
).
assertEqual
(
3
);
expect
(
updater
.
PackageTypes
.
PACKAGE_TYPE_PRELOAD
).
assertEqual
(
4
);
expect
(
updater
.
PackageTypes
.
PACKAGE_TYPE_COTA
).
assertEqual
(
5
);
expect
(
updater
.
PackageTypes
.
PACKAGE_TYPE_VERSION
).
assertEqual
(
6
);
expect
(
updater
.
PackageTypes
.
PACKAGE_TYPE_PATCH
).
assertEqual
(
7
);
}
catch
(
e
)
{
console
.
error
(
'
[testPackageTypes] fail.
'
+
e
);
}
console
.
info
(
'
[PackageTypes] success.
'
);
console
.
info
(
'
testPackageTypes END
'
);
});
/**
* @tc.number SUB_UPDATE_JS_API_0087
* @tc.name testNewVersionStatus
* @tc.desc check NewVersionStatus is defined correct.
*/
it
(
'
testNewVersionStatus
'
,
0
,
function
()
{
console
.
info
(
'
testNewVersionStatus START
'
);
try
{
expect
(
updater
.
NewVersionStatus
.
VERSION_STATUS_ERR
).
assertEqual
(
-
1
);
expect
(
updater
.
NewVersionStatus
.
VERSION_STATUS_NEW
).
assertEqual
(
0
);
expect
(
updater
.
NewVersionStatus
.
VERSION_STATUS_NONE
).
assertEqual
(
1
);
expect
(
updater
.
NewVersionStatus
.
VERSION_STATUS_BUSY
).
assertEqual
(
2
);
}
catch
(
e
)
{
console
.
error
(
'
[testNewVersionStatus] fail.
'
+
e
);
}
console
.
info
(
'
[NewVersionStatus] success.
'
);
console
.
info
(
'
testNewVersionStatus END
'
);
});
/**
* @tc.number SUB_UPDATE_JS_API_0088
* @tc.name testInstallMode
* @tc.desc check InstallMode is defined correct.
*/
it
(
'
testInstallMode
'
,
0
,
function
()
{
console
.
info
(
'
testInstallMode START
'
);
try
{
expect
(
updater
.
InstallMode
.
INSTALL_MODE_NORMAL
).
assertEqual
(
0
);
expect
(
updater
.
InstallMode
.
INSTALL_MODE_NIGHT
).
assertEqual
(
1
);
expect
(
updater
.
InstallMode
.
INSTALL_MODE_AUTO
).
assertEqual
(
2
);
}
catch
(
e
)
{
console
.
error
(
'
[testInstallMode] fail.
'
+
e
);
}
console
.
info
(
'
[InstallMode] success.
'
);
console
.
info
(
'
testInstallMode END
'
);
});
/**
* @tc.number SUB_UPDATE_JS_API_0089
* @tc.name testCheckResultAndDescriptionInfo
* @tc.desc check checkResult and descriptionInfo is defined correct.
*/
it
(
'
testInstallMode
'
,
0
,
function
()
{
console
.
info
(
'
testCheckResultAndDescriptionInfo START
'
);
try
{
let
descriptionInfo
=
updater
.
DescriptionInfo
.
content
;
console
.
info
(
'
test DescriptionInfo.content is
'
+
descriptionInfo
);
expect
(
updater
.
CheckResult
.
packageType
.
PACKAGE_TYPE_NORMAL
).
assertEqual
(
1
);
}
catch
(
e
)
{
console
.
error
(
'
[testCheckResultAndDescriptionInfo] fail.
'
+
e
);
}
console
.
info
(
'
[CheckResultAndDescriptionInfo] success.
'
);
console
.
info
(
'
testCheckResultAndDescriptionInfo END
'
);
});
/**
* @tc.number SUB_UPDATE_JS_API_0090
* @tc.name testGetUpdaterForOther
* @tc.desc Test getUpdaterForOther obj.
*/
it
(
'
testGetUpdaterForOther
'
,
0
,
function
()
{
console
.
info
(
'
testGetUpdaterForOther START
'
);
try
{
if
(
client
===
undefined
)
{
console
.
error
(
"
client not defined
"
);
return
;
}
let
tmpGetUpdaterForOther
=
client
.
getUpdaterForOther
(
'
/data/updater/updater.zip
'
,
'
1234567890
'
,
'
OTA
'
);
expect
(
tmpGetUpdaterForOther
!=
undefined
).
assertTrue
();
}
catch
(
e
)
{
console
.
error
(
'
[testGetUpdaterForOther] fail.
'
+
e
);
}
console
.
info
(
'
[client.getUpdaterForOther] success.
'
);
console
.
info
(
'
testGetUpdaterForOther END
'
);
});
/**
* @tc.number SUB_UPDATE_JS_API_0091
* @tc.name testGetUpdaterFromOther
* @tc.desc Test getUpdaterFromOther obj.
*/
it
(
'
testGetUpdaterFromOther
'
,
0
,
function
()
{
console
.
info
(
'
testGetUpdaterFromOther START
'
);
try
{
if
(
client
===
undefined
)
{
console
.
error
(
"
client not defined
"
);
return
;
}
let
tmpGetUpdaterFromOther
=
client
.
getUpdaterFromOther
(
'
/data/updater/updater.zip
'
,
'
1234567890
'
,
'
OTA
'
);
expect
(
tmpGetUpdaterFromOther
!=
undefined
).
assertTrue
();
}
catch
(
e
)
{
console
.
error
(
'
[testGetUpdaterFromOther] fail.
'
+
e
);
}
console
.
info
(
'
[client.getUpdaterFromOther] success.
'
);
console
.
info
(
'
testGetUpdaterFromOther END
'
);
});
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录