Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
ead6ddd2
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看板
提交
ead6ddd2
编写于
8月 26, 2021
作者:
J
jiyong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
jiyong@huawei.com
Signed-off-by:
N
jiyong
<
jiyong@huawei.com
>
上级
c2129dee
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
255 addition
and
148 deletion
+255
-148
ace/ace_standard/hap/entry-debug-signed.hap
ace/ace_standard/hap/entry-debug-signed.hap
+0
-0
ace/ace_standard/hap/entry-release-signed.hap
ace/ace_standard/hap/entry-release-signed.hap
+0
-0
ace/ace_standard/project/entry/src/main/config.json
ace/ace_standard/project/entry/src/main/config.json
+32
-7
ace/ace_standard/project/entry/src/main/js/default/app.js
ace/ace_standard/project/entry/src/main/js/default/app.js
+2
-2
ace/ace_standard/project/entry/src/main/js/default/pages/index/index.css
...d/project/entry/src/main/js/default/pages/index/index.css
+5
-5
ace/ace_standard/project/entry/src/main/js/default/pages/index/index.js
...rd/project/entry/src/main/js/default/pages/index/index.js
+5
-10
ace/ace_standard/project/entry/src/main/js/default/pages/routerPush/index.js
...oject/entry/src/main/js/default/pages/routerPush/index.js
+3
-3
ace/ace_standard/project/entry/src/main/js/default/pages/routerReplace/index.js
...ct/entry/src/main/js/default/pages/routerReplace/index.js
+3
-3
ace/ace_standard/project/entry/src/main/js/test/basicabilityapi.test.js
...rd/project/entry/src/main/js/test/basicabilityapi.test.js
+201
-118
ace/ace_standard/project/entry/src/main/resources/base/element/string.json
...project/entry/src/main/resources/base/element/string.json
+4
-0
未找到文件。
ace/ace_standard/hap/entry-debug-signed.hap
已删除
100644 → 0
浏览文件 @
c2129dee
文件已删除
ace/ace_standard/hap/entry-release-signed.hap
0 → 100644
浏览文件 @
ead6ddd2
文件已添加
ace/ace_standard/project/entry/src/main/config.json
浏览文件 @
ead6ddd2
...
@@ -9,31 +9,56 @@
...
@@ -9,31 +9,56 @@
},
},
"deviceConfig"
:
{},
"deviceConfig"
:
{},
"module"
:
{
"module"
:
{
"package"
:
"com.example.aceceshi"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
"com.example.aceceshi.MainAbility"
,
"deviceType"
:
[
"deviceType"
:
[
"liteWearable"
,
"phone"
"smartVision"
],
],
"distro"
:
{
"distro"
:
{
"deliveryWithInstall"
:
true
,
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
},
"abilities"
:
[
"abilities"
:
[
{
{
"name"
:
"default"
,
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.aceceshi.MainAbility"
,
"icon"
:
"$media:icon"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
},
{
"name"
:
"decc.testkit.runner.JsEntryAbility"
,
"label"
:
"$string:entry_MainAbility"
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
"type"
:
"page"
,
"launchType"
:
"standard"
}
}
],
],
"js"
:
[
"js"
:
[
{
{
"name"
:
"default"
,
"pages"
:
[
"pages"
:
[
"pages/index/index"
,
"pages/index/index"
,
"pages/routerPush/index"
,
"pages/routerPush/index"
,
"pages/routerReplace/index"
"pages/routerReplace/index"
]
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
}
}
}
]
]
}
}
...
...
ace/ace_standard/project/entry/src/main/js/default/app.js
浏览文件 @
ead6ddd2
export
default
{
export
default
{
onCreate
()
{
onCreate
()
{
console
.
info
(
"
Application onCreate
"
);
console
.
info
(
'
AceApplication onCreate
'
);
},
},
onDestroy
()
{
onDestroy
()
{
console
.
info
(
"
Application onDestroy
"
);
console
.
info
(
'
AceApplication onDestroy
'
);
}
}
};
};
ace/ace_standard/project/entry/src/main/js/default/pages/index/index.css
浏览文件 @
ead6ddd2
.container
{
.container
{
width
:
454px
;
flex-direction
:
column
;
height
:
454px
;
justify-content
:
center
;
justify-content
:
center
;
align-items
:
center
;
align-items
:
center
;
}
}
.title
{
.title
{
width
:
20
0px
;
font-size
:
4
0px
;
font-size
:
30px
;
color
:
#000000
;
text-align
:
center
;
opacity
:
0.9
;
}
}
ace/ace_standard/project/entry/src/main/js/default/pages/index/index.js
浏览文件 @
ead6ddd2
...
@@ -12,33 +12,28 @@
...
@@ -12,33 +12,28 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import
file
from
'
@system.file
'
import
{
Core
,
ExpectExtend
}
from
'
deccjsunit/index
'
import
{
Core
,
ExpectExtend
,
ReportExtend
}
from
'
deccjsunit/index
'
export
default
{
export
default
{
data
:
{
data
:
{
title
:
""
title
:
""
},
},
onInit
()
{
onInit
()
{
console
.
info
(
'
[test page log] index onInit
'
)
this
.
title
=
this
.
$t
(
'
strings.world
'
);
this
.
title
=
this
.
$t
(
'
strings.world
'
);
const
core
=
Core
.
getInstance
()
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
const
expectExtend
=
new
ExpectExtend
({
'
id
'
:
'
extend
'
'
id
'
:
'
extend
'
})
})
const
reportExtend
=
new
ReportExtend
(
file
)
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
addService
(
'
report
'
,
reportExtend
)
core
.
init
()
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test
'
)
require
(
'
../../../test/List.test
'
)
core
.
execute
()
core
.
execute
()
},
},
onShow
()
{
onShow
()
{
console
.
info
(
'
onShow finish
'
)
console
.
info
(
'
[test page log] index onShow
'
)
},
},
onReady
()
{
onHide
()
{
console
.
info
(
'
[test page log] index onHide
'
)
},
},
}
}
ace/ace_standard/project/entry/src/main/js/default/pages/routerPush/index.js
浏览文件 @
ead6ddd2
...
@@ -16,10 +16,10 @@ export default {
...
@@ -16,10 +16,10 @@ export default {
data
:
{
data
:
{
title
:
"
router push test
"
title
:
"
router push test
"
},
},
onInit
()
{
},
onShow
()
{
onShow
()
{
console
.
info
(
'
[test page log] routerPush onShow
'
);
},
},
onReady
()
{
onHide
()
{
console
.
info
(
'
[test page log] routerPush ohHide
'
);
},
},
}
}
ace/ace_standard/project/entry/src/main/js/default/pages/routerReplace/index.js
浏览文件 @
ead6ddd2
...
@@ -16,10 +16,10 @@ export default {
...
@@ -16,10 +16,10 @@ export default {
data
:
{
data
:
{
title
:
"
router replace test
"
title
:
"
router replace test
"
},
},
onInit
()
{
},
onShow
()
{
onShow
()
{
console
.
info
(
'
[test page log] routerReplace onShow
'
);
},
},
onReady
()
{
onHide
()
{
console
.
info
(
'
[test page log] routerReplace ohHide
'
);
},
},
}
}
ace/ace_standard/project/entry/src/main/js/test/basicabilityapi.test.js
浏览文件 @
ead6ddd2
...
@@ -34,6 +34,26 @@ describe('basicabilityapi', function () {
...
@@ -34,6 +34,26 @@ describe('basicabilityapi', function () {
afterAll
(
function
()
{
afterAll
(
function
()
{
});
});
async
function
backToIndex
(){
let
backToIndexPromise
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
router
.
back
({
uri
:
'
pages/index/index
'
});
resolve
();
},
500
);
});
let
clearPromise
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
router
.
clear
();
resolve
();
},
500
);
});
await
backToIndexPromise
.
then
(()
=>
{
return
clearPromise
;
});
}
/**
/**
* @tc.number SUB_ACE_BASICABILITY_JS_API_0100
* @tc.number SUB_ACE_BASICABILITY_JS_API_0100
* @tc.name testClearInterval
* @tc.name testClearInterval
...
@@ -42,21 +62,28 @@ describe('basicabilityapi', function () {
...
@@ -42,21 +62,28 @@ describe('basicabilityapi', function () {
it
(
'
testClearInterval
'
,
0
,
async
function
(
done
)
{
it
(
'
testClearInterval
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testClearInterval START
'
);
console
.
info
(
'
testClearInterval START
'
);
let
res
=
0
;
let
res
=
0
;
let
intervalID
=
await
setInterval
(
function
()
{
let
intervalID
=
-
1
;
res
++
;
let
promise1
=
new
Promise
((
resolve
,
reject
)
=>
{
console
.
info
(
'
testClearInterval res =
'
+
res
);
intervalID
=
setInterval
(
function
()
{
},
100
);
res
++
;
await
setTimeout
(
function
()
{
console
.
info
(
'
testClearInterval res =
'
+
res
);
console
.
info
(
'
[clearInterval] start
'
);
resolve
();
clearInterval
(
intervalID
);
},
100
);
console
.
info
(
'
[clearInterval] end
'
);
});
},
600
);
let
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
await
setTimeout
(
function
()
{
setTimeout
(
function
()
{
console
.
info
(
'
[clearInterval] start
'
);
clearInterval
(
intervalID
);
console
.
info
(
'
[clearInterval] end
'
);
resolve
();
},
600
);
});
Promise
.
all
([
promise1
,
promise2
]).
then
(()
=>
{
console
.
info
(
'
testClearInterval finally
'
);
console
.
info
(
'
testClearInterval finally
'
);
expect
(
5
).
assertEqual
(
res
);
expect
(
5
).
assertEqual
(
res
);
console
.
info
(
'
testClearInterval END
'
);
console
.
info
(
'
testClearInterval END
'
);
done
();
done
();
}
,
1000
);
});
});
});
/**
/**
...
@@ -83,22 +110,29 @@ describe('basicabilityapi', function () {
...
@@ -83,22 +110,29 @@ describe('basicabilityapi', function () {
*/
*/
it
(
'
testRouterPush
'
,
0
,
async
function
(
done
)
{
it
(
'
testRouterPush
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testRouterPush START
'
);
console
.
info
(
'
testRouterPush START
'
);
await
setTimeout
((
)
=>
{
let
promise1
=
new
Promise
((
resolve
,
reject
)
=>
{
router
.
push
({
router
.
push
({
uri
:
'
pages/routerPush/index
'
uri
:
'
pages/routerPush/index
'
});
});
},
500
);
resolve
();
await
setTimeout
(()
=>
{
});
let
pages
=
router
.
getState
();
let
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
console
.
info
(
"
[router.push] getState
"
+
JSON
.
stringify
(
pages
));
setTimeout
(()
=>
{
expect
(
"
pages/routerPush/
"
).
assertEqual
(
pages
.
path
);
let
pages
=
router
.
getState
();
console
.
info
(
"
[router.push] getLength:
"
+
router
.
getLength
());
console
.
info
(
"
[router.push] getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
2
"
).
assertEqual
(
router
.
getLength
());
expect
(
"
pages/routerPush/
"
).
assertEqual
(
pages
.
path
);
console
.
info
(
'
testRouterPush SUCCESS
'
);
console
.
info
(
"
[router.push] getLength:
"
+
router
.
getLength
());
router
.
back
();
expect
(
"
2
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
testRouterPush END
'
);
console
.
info
(
'
testRouterPush SUCCESS
'
);
done
();
resolve
();
},
1000
);
},
500
);
});
await
promise1
.
then
(()
=>
{
return
promise2
;
});
await
backToIndex
();
console
.
info
(
'
testRouterPush END
'
);
done
();
});
});
/**
/**
...
@@ -108,20 +142,28 @@ describe('basicabilityapi', function () {
...
@@ -108,20 +142,28 @@ describe('basicabilityapi', function () {
*/
*/
it
(
'
testRouterPushNotExist
'
,
0
,
async
function
(
done
)
{
it
(
'
testRouterPushNotExist
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testRouterPushNotExist START
'
);
console
.
info
(
'
testRouterPushNotExist START
'
);
await
setTimeout
((
)
=>
{
let
promise1
=
new
Promise
((
resolve
,
reject
)
=>
{
router
.
push
({
router
.
push
({
uri
:
'
pages/routerNotExist/index
'
uri
:
'
pages/routerNotExist/index
'
});
});
},
500
);
resolve
();
await
setTimeout
(()
=>
{
});
let
pages
=
router
.
getState
();
let
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
console
.
info
(
"
testRouterPushNotExist getState
"
+
JSON
.
stringify
(
pages
));
setTimeout
(()
=>
{
expect
(
"
pages/index/
"
).
assertEqual
(
pages
.
path
);
let
pages
=
router
.
getState
();
console
.
info
(
"
testRouterPushNotExist getLength:
"
+
router
.
getLength
());
console
.
info
(
"
testRouterPushNotExist getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
1
"
).
assertEqual
(
router
.
getLength
());
expect
(
"
pages/index/
"
).
assertEqual
(
pages
.
path
);
console
.
info
(
'
testRouterPushNotExist END
'
);
console
.
info
(
"
testRouterPushNotExist getLength:
"
+
router
.
getLength
());
done
();
expect
(
"
1
"
).
assertEqual
(
router
.
getLength
());
},
1000
);
console
.
info
(
'
testRouterPushNotExist success
'
);
resolve
();
},
500
);
});
await
promise1
.
then
(()
=>
{
return
promise2
;
});
console
.
info
(
'
testRouterPushNotExist END
'
);
done
();
});
});
/**
/**
...
@@ -131,27 +173,39 @@ describe('basicabilityapi', function () {
...
@@ -131,27 +173,39 @@ describe('basicabilityapi', function () {
*/
*/
it
(
'
testRouterReplace
'
,
0
,
async
function
(
done
)
{
it
(
'
testRouterReplace
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testRouterReplace START
'
);
console
.
info
(
'
testRouterReplace START
'
);
await
setTimeout
((
)
=>
{
let
promise1
=
new
Promise
((
resolve
,
reject
)
=>
{
router
.
push
({
router
.
push
({
uri
:
'
pages/routerPush/index
'
uri
:
'
pages/routerPush/index
'
});
});
},
500
);
resolve
();
await
setTimeout
(()
=>
{
});
router
.
replace
({
let
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
uri
:
'
pages/routerReplace/index
'
setTimeout
(()
=>
{
});
router
.
replace
({
},
1000
);
uri
:
'
pages/routerReplace/index
'
await
setTimeout
(()
=>
{
});
let
pages
=
router
.
getState
();
resolve
();
console
.
info
(
"
[router.replace] getState
"
+
JSON
.
stringify
(
pages
));
},
500
);
expect
(
"
pages/routerReplace/
"
).
assertEqual
(
pages
.
path
);
});
console
.
info
(
"
[router.replace] getLength:
"
+
router
.
getLength
());
let
promise3
=
new
Promise
((
resolve
,
reject
)
=>
{
expect
(
"
2
"
).
assertEqual
(
router
.
getLength
());
setTimeout
(()
=>
{
console
.
info
(
'
testRouterReplace SUCCESS
'
);
let
pages
=
router
.
getState
();
router
.
back
();
console
.
info
(
"
[router.replace] getState
"
+
JSON
.
stringify
(
pages
));
console
.
info
(
'
testRouterReplace END
'
);
expect
(
"
pages/routerReplace/
"
).
assertEqual
(
pages
.
path
);
done
();
console
.
info
(
"
[router.replace] getLength:
"
+
router
.
getLength
());
},
1500
);
expect
(
"
2
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
testRouterReplace SUCCESS
'
);
resolve
();
},
1000
);
});
await
promise1
.
then
(()
=>
{
return
promise2
;
}).
then
(()
=>
{
return
promise3
;
});
await
backToIndex
();
console
.
info
(
'
testRouterReplace END
'
);
done
();
});
});
/**
/**
...
@@ -184,25 +238,38 @@ describe('basicabilityapi', function () {
...
@@ -184,25 +238,38 @@ describe('basicabilityapi', function () {
*/
*/
it
(
'
testRouterBack
'
,
0
,
async
function
(
done
)
{
it
(
'
testRouterBack
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testRouterBack START
'
);
console
.
info
(
'
testRouterBack START
'
);
await
setTimeout
((
)
=>
{
let
promise1
=
new
Promise
((
resolve
,
reject
)
=>
{
router
.
push
({
router
.
push
({
uri
:
'
pages/routerPush/index
'
uri
:
'
pages/routerPush/index
'
});
});
},
500
);
resolve
();
await
setTimeout
(()
=>
{
});
router
.
back
({
let
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
uri
:
'
pages/index/index
'
setTimeout
(()
=>
{
});
router
.
back
({
},
1000
);
uri
:
'
pages/index/index
'
await
setTimeout
(()
=>
{
});
let
pages
=
router
.
getState
();
resolve
();
console
.
info
(
"
[router.back] getState
"
+
JSON
.
stringify
(
pages
));
},
500
);
expect
(
"
pages/index/
"
).
assertEqual
(
pages
.
path
);
});
console
.
info
(
"
[router.back] getLength:
"
+
router
.
getLength
());
let
promise3
=
new
Promise
((
resolve
,
reject
)
=>
{
expect
(
"
1
"
).
assertEqual
(
router
.
getLength
());
setTimeout
(()
=>
{
console
.
info
(
'
testRouterBack END
'
);
let
pages
=
router
.
getState
();
done
();
console
.
info
(
"
[router.back] getState
"
+
JSON
.
stringify
(
pages
));
},
1500
);
expect
(
"
pages/index/
"
).
assertEqual
(
pages
.
path
);
console
.
info
(
"
[router.back] getLength:
"
+
router
.
getLength
());
expect
(
"
1
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
testRouterBack SUCCESS
'
);
resolve
();
},
1000
);
});
await
promise1
.
then
(()
=>
{
return
promise2
;
}).
then
(()
=>
{
return
promise3
;
});
console
.
info
(
'
testRouterBack END
'
);
done
();
});
});
/**
/**
...
@@ -228,67 +295,83 @@ describe('basicabilityapi', function () {
...
@@ -228,67 +295,83 @@ describe('basicabilityapi', function () {
let
size
=
router
.
getLength
();
let
size
=
router
.
getLength
();
console
.
info
(
'
[router.getLength] pages stack size =
'
+
size
);
console
.
info
(
'
[router.getLength] pages stack size =
'
+
size
);
expect
(
size
).
assertEqual
(
'
1
'
);
expect
(
size
).
assertEqual
(
'
1
'
);
await
setTimeout
((
)
=>
{
let
promise1
=
new
Promise
((
resolve
,
reject
)
=>
{
router
.
push
({
router
.
push
({
uri
:
'
pages/routerPush/index
'
uri
:
'
pages/routerPush/index
'
});
});
},
500
);
resolve
();
await
setTimeout
(()
=>
{
});
console
.
info
(
"
testRouterLength getLength:
"
+
router
.
getLength
());
let
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
expect
(
"
2
"
).
assertEqual
(
router
.
getLength
());
setTimeout
(()
=>
{
console
.
info
(
'
testRouterPush SUCCESS
'
);
console
.
info
(
"
testRouterLength getLength:
"
+
router
.
getLength
());
router
.
back
();
expect
(
"
2
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
testRouterPush END
'
);
console
.
info
(
'
testRouterLength SUCCESS
'
);
done
();
resolve
();
},
1000
);
},
500
);
});
await
promise1
.
then
(()
=>
{
return
promise2
;
});
await
backToIndex
();
console
.
info
(
'
testRouterLength END
'
);
done
();
});
});
/**
/**
* @tc.number SUB_ACE_BASICABILITY_JS_API_0
71
0
* @tc.number SUB_ACE_BASICABILITY_JS_API_0
80
0
* @tc.name testRouter
MaxLength
* @tc.name testRouter
GetState
* @tc.desc
Test the max number of the page stack is 32
.
* @tc.desc
Get the status information of the current page
.
*/
*/
it
(
'
testRouterMaxLength
'
,
0
,
async
function
(
done
)
{
it
(
'
testRouterGetState
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testRouterLength START
'
);
console
.
info
(
'
testRouterGetState START
'
);
let
intervalID
=
await
setInterval
(
async
function
()
{
await
router
.
push
({
uri
:
'
pages/routerPush/index
'
});
await
router
.
push
({
uri
:
'
pages/routerReplace/index
'
});
console
.
info
(
'
testRouterMaxLength router.getLength:
'
+
router
.
getLength
());
},
500
);
await
setTimeout
(()
=>
{
clearInterval
(
intervalID
);
},
1000
*
17
);
await
setTimeout
(()
=>
{
await
setTimeout
(()
=>
{
console
.
info
(
"
testRouterMaxLength getLength:
"
+
router
.
getLength
());
let
page
=
router
.
getState
();
expect
(
"
32
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
[router.getState] index:
'
+
page
.
index
);
console
.
info
(
'
testRouterMaxLength SUCCESS
'
);
console
.
info
(
'
[router.getState] name:
'
+
page
.
name
);
router
.
back
({
console
.
info
(
'
[router.getState] path:
'
+
page
.
path
);
uri
:
'
pages/index/index
'
expect
(
page
.
index
).
assertEqual
(
'
1
'
);
});
expect
(
page
.
name
).
assertEqual
(
'
index
'
);
console
.
info
(
'
testRouterMaxLength END
'
);
expect
(
page
.
path
).
assertEqual
(
'
pages/index/
'
);
console
.
info
(
'
testRouterGetState END
'
);
done
();
done
();
},
(
1000
*
18
)
);
},
500
);
});
});
/**
/**
* @tc.number SUB_ACE_BASICABILITY_JS_API_0
80
0
* @tc.number SUB_ACE_BASICABILITY_JS_API_0
71
0
* @tc.name testRouter
GetState
* @tc.name testRouter
MaxLength
* @tc.desc
Get the status information of the current page
.
* @tc.desc
Test the max number of the page stack is 32
.
*/
*/
it
(
'
testRouterGetState
'
,
0
,
function
()
{
it
(
'
testRouterMaxLength
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testRouterGetState START
'
);
console
.
info
(
'
testRouterMaxLength START
'
);
let
page
=
router
.
getState
();
let
intervalID
=
-
1
;
console
.
info
(
'
[router.getState] index:
'
+
page
.
index
);
let
promise1
=
new
Promise
((
resolve
,
reject
)
=>
{
console
.
info
(
'
[router.getState] name:
'
+
page
.
name
);
intervalID
=
setInterval
(
function
()
{
console
.
info
(
'
[router.getState] path:
'
+
page
.
path
);
router
.
push
({
expect
(
page
.
index
).
assertEqual
(
'
1
'
);
uri
:
'
pages/routerPush/index
'
expect
(
page
.
name
).
assertEqual
(
'
index
'
);
});
expect
(
page
.
path
).
assertEqual
(
'
pages/index/
'
);
console
.
info
(
'
testRouterMaxLength router.getLength:
'
+
router
.
getLength
());
console
.
info
(
'
testRouterGetState END
'
);
resolve
();
},
100
);
});
let
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(
function
()
{
console
.
info
(
'
testRouterMaxLength[clearInterval] start
'
);
clearInterval
(
intervalID
);
console
.
info
(
'
testRouterMaxLength[clearInterval] end
'
);
resolve
();
},
500
*
34
);
});
Promise
.
all
([
promise1
,
promise2
]).
then
(()
=>
{
setTimeout
(
async
()
=>
{
console
.
info
(
"
testRouterMaxLength getLength:
"
+
router
.
getLength
());
expect
(
"
32
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
testRouterMaxLength success
'
);
await
backToIndex
();
console
.
info
(
'
testRouterMaxLength END
'
);
done
();
},
500
);
});
});
});
/**
/**
...
@@ -414,7 +497,7 @@ describe('basicabilityapi', function () {
...
@@ -414,7 +497,7 @@ describe('basicabilityapi', function () {
let
res
=
0
;
let
res
=
0
;
let
intervalID
=
setInterval
(
function
()
{
let
intervalID
=
setInterval
(
function
()
{
res
++
;
res
++
;
},
100
0
);
},
100
);
await
setTimeout
(
function
()
{
await
setTimeout
(
function
()
{
expect
(
9
).
assertEqual
(
res
);
expect
(
9
).
assertEqual
(
res
);
console
.
info
(
'
testSetInterval SUCCESS
'
);
console
.
info
(
'
testSetInterval SUCCESS
'
);
...
...
ace/ace_standard/project/entry/src/main/resources/base/element/string.json
浏览文件 @
ead6ddd2
...
@@ -3,6 +3,10 @@
...
@@ -3,6 +3,10 @@
{
{
"name"
:
"entry_MainAbility"
,
"name"
:
"entry_MainAbility"
,
"value"
:
"entry_MainAbility"
"value"
:
"entry_MainAbility"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Empty Ability"
}
}
]
]
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录