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
;
let
promise1
=
new
Promise
((
resolve
,
reject
)
=>
{
intervalID
=
setInterval
(
function
()
{
res
++
;
res
++
;
console
.
info
(
'
testClearInterval res =
'
+
res
);
console
.
info
(
'
testClearInterval res =
'
+
res
);
resolve
();
},
100
);
},
100
);
await
setTimeout
(
function
()
{
});
let
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(
function
()
{
console
.
info
(
'
[clearInterval] start
'
);
console
.
info
(
'
[clearInterval] start
'
);
clearInterval
(
intervalID
);
clearInterval
(
intervalID
);
console
.
info
(
'
[clearInterval] end
'
);
console
.
info
(
'
[clearInterval] end
'
);
resolve
();
},
600
);
},
600
);
await
setTimeout
(
function
()
{
});
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
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
let
pages
=
router
.
getState
();
let
pages
=
router
.
getState
();
console
.
info
(
"
[router.push] getState
"
+
JSON
.
stringify
(
pages
));
console
.
info
(
"
[router.push] getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
pages/routerPush/
"
).
assertEqual
(
pages
.
path
);
expect
(
"
pages/routerPush/
"
).
assertEqual
(
pages
.
path
);
console
.
info
(
"
[router.push] getLength:
"
+
router
.
getLength
());
console
.
info
(
"
[router.push] getLength:
"
+
router
.
getLength
());
expect
(
"
2
"
).
assertEqual
(
router
.
getLength
());
expect
(
"
2
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
testRouterPush SUCCESS
'
);
console
.
info
(
'
testRouterPush SUCCESS
'
);
router
.
back
();
resolve
();
},
500
);
});
await
promise1
.
then
(()
=>
{
return
promise2
;
});
await
backToIndex
();
console
.
info
(
'
testRouterPush END
'
);
console
.
info
(
'
testRouterPush END
'
);
done
();
done
();
},
1000
);
});
});
/**
/**
...
@@ -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
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
let
pages
=
router
.
getState
();
let
pages
=
router
.
getState
();
console
.
info
(
"
testRouterPushNotExist getState
"
+
JSON
.
stringify
(
pages
));
console
.
info
(
"
testRouterPushNotExist getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
pages/index/
"
).
assertEqual
(
pages
.
path
);
expect
(
"
pages/index/
"
).
assertEqual
(
pages
.
path
);
console
.
info
(
"
testRouterPushNotExist getLength:
"
+
router
.
getLength
());
console
.
info
(
"
testRouterPushNotExist getLength:
"
+
router
.
getLength
());
expect
(
"
1
"
).
assertEqual
(
router
.
getLength
());
expect
(
"
1
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
testRouterPushNotExist success
'
);
resolve
();
},
500
);
});
await
promise1
.
then
(()
=>
{
return
promise2
;
});
console
.
info
(
'
testRouterPushNotExist END
'
);
console
.
info
(
'
testRouterPushNotExist END
'
);
done
();
done
();
},
1000
);
});
});
/**
/**
...
@@ -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
(()
=>
{
});
let
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
router
.
replace
({
router
.
replace
({
uri
:
'
pages/routerReplace/index
'
uri
:
'
pages/routerReplace/index
'
});
});
},
1000
);
resolve
();
await
setTimeout
(()
=>
{
},
500
);
});
let
promise3
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
let
pages
=
router
.
getState
();
let
pages
=
router
.
getState
();
console
.
info
(
"
[router.replace] getState
"
+
JSON
.
stringify
(
pages
));
console
.
info
(
"
[router.replace] getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
pages/routerReplace/
"
).
assertEqual
(
pages
.
path
);
expect
(
"
pages/routerReplace/
"
).
assertEqual
(
pages
.
path
);
console
.
info
(
"
[router.replace] getLength:
"
+
router
.
getLength
());
console
.
info
(
"
[router.replace] getLength:
"
+
router
.
getLength
());
expect
(
"
2
"
).
assertEqual
(
router
.
getLength
());
expect
(
"
2
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
testRouterReplace SUCCESS
'
);
console
.
info
(
'
testRouterReplace SUCCESS
'
);
router
.
back
();
resolve
();
},
1000
);
});
await
promise1
.
then
(()
=>
{
return
promise2
;
}).
then
(()
=>
{
return
promise3
;
});
await
backToIndex
();
console
.
info
(
'
testRouterReplace END
'
);
console
.
info
(
'
testRouterReplace END
'
);
done
();
done
();
},
1500
);
});
});
/**
/**
...
@@ -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
(()
=>
{
});
let
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
router
.
back
({
router
.
back
({
uri
:
'
pages/index/index
'
uri
:
'
pages/index/index
'
});
});
},
1000
);
resolve
();
await
setTimeout
(()
=>
{
},
500
);
});
let
promise3
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
let
pages
=
router
.
getState
();
let
pages
=
router
.
getState
();
console
.
info
(
"
[router.back] getState
"
+
JSON
.
stringify
(
pages
));
console
.
info
(
"
[router.back] getState
"
+
JSON
.
stringify
(
pages
));
expect
(
"
pages/index/
"
).
assertEqual
(
pages
.
path
);
expect
(
"
pages/index/
"
).
assertEqual
(
pages
.
path
);
console
.
info
(
"
[router.back] getLength:
"
+
router
.
getLength
());
console
.
info
(
"
[router.back] getLength:
"
+
router
.
getLength
());
expect
(
"
1
"
).
assertEqual
(
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
'
);
console
.
info
(
'
testRouterBack END
'
);
done
();
done
();
},
1500
);
});
});
/**
/**
...
@@ -228,50 +295,26 @@ describe('basicabilityapi', function () {
...
@@ -228,50 +295,26 @@ 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
(()
=>
{
});
let
promise2
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
console
.
info
(
"
testRouterLength getLength:
"
+
router
.
getLength
());
console
.
info
(
"
testRouterLength getLength:
"
+
router
.
getLength
());
expect
(
"
2
"
).
assertEqual
(
router
.
getLength
());
expect
(
"
2
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
testRouterPush SUCCESS
'
);
console
.
info
(
'
testRouterLength SUCCESS
'
);
router
.
back
();
resolve
();
console
.
info
(
'
testRouterPush END
'
);
done
();
},
1000
);
});
/**
* @tc.number SUB_ACE_BASICABILITY_JS_API_0710
* @tc.name testRouterMaxLength
* @tc.desc Test the max number of the page stack is 32.
*/
it
(
'
testRouterMaxLength
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testRouterLength 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
);
},
500
);
await
setTimeout
(()
=>
{
clearInterval
(
intervalID
);
},
1000
*
17
);
await
setTimeout
(()
=>
{
console
.
info
(
"
testRouterMaxLength getLength:
"
+
router
.
getLength
());
expect
(
"
32
"
).
assertEqual
(
router
.
getLength
());
console
.
info
(
'
testRouterMaxLength SUCCESS
'
);
router
.
back
({
uri
:
'
pages/index/index
'
});
});
console
.
info
(
'
testRouterMaxLength END
'
);
await
promise1
.
then
(()
=>
{
return
promise2
;
});
await
backToIndex
();
console
.
info
(
'
testRouterLength END
'
);
done
();
done
();
},
(
1000
*
18
));
});
});
/**
/**
...
@@ -279,8 +322,9 @@ describe('basicabilityapi', function () {
...
@@ -279,8 +322,9 @@ describe('basicabilityapi', function () {
* @tc.name testRouterGetState
* @tc.name testRouterGetState
* @tc.desc Get the status information of the current page.
* @tc.desc Get the status information of the current page.
*/
*/
it
(
'
testRouterGetState
'
,
0
,
function
(
)
{
it
(
'
testRouterGetState
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testRouterGetState START
'
);
console
.
info
(
'
testRouterGetState START
'
);
await
setTimeout
(()
=>
{
let
page
=
router
.
getState
();
let
page
=
router
.
getState
();
console
.
info
(
'
[router.getState] index:
'
+
page
.
index
);
console
.
info
(
'
[router.getState] index:
'
+
page
.
index
);
console
.
info
(
'
[router.getState] name:
'
+
page
.
name
);
console
.
info
(
'
[router.getState] name:
'
+
page
.
name
);
...
@@ -289,6 +333,45 @@ describe('basicabilityapi', function () {
...
@@ -289,6 +333,45 @@ describe('basicabilityapi', function () {
expect
(
page
.
name
).
assertEqual
(
'
index
'
);
expect
(
page
.
name
).
assertEqual
(
'
index
'
);
expect
(
page
.
path
).
assertEqual
(
'
pages/index/
'
);
expect
(
page
.
path
).
assertEqual
(
'
pages/index/
'
);
console
.
info
(
'
testRouterGetState END
'
);
console
.
info
(
'
testRouterGetState END
'
);
done
();
},
500
);
});
/**
* @tc.number SUB_ACE_BASICABILITY_JS_API_0710
* @tc.name testRouterMaxLength
* @tc.desc Test the max number of the page stack is 32.
*/
it
(
'
testRouterMaxLength
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testRouterMaxLength START
'
);
let
intervalID
=
-
1
;
let
promise1
=
new
Promise
((
resolve
,
reject
)
=>
{
intervalID
=
setInterval
(
function
()
{
router
.
push
({
uri
:
'
pages/routerPush/index
'
});
console
.
info
(
'
testRouterMaxLength router.getLength:
'
+
router
.
getLength
());
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录