Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
89c6bc0f
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看板
提交
89c6bc0f
编写于
8月 25, 2022
作者:
H
hk_js
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the fail case about window case
Signed-off-by:
N
hk_js
<
hekun18@huawei.com
>
上级
ee075f74
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
20 addition
and
55 deletion
+20
-55
graphic/windowstandard/src/main/js/default/test/window.test.js
...ic/windowstandard/src/main/js/default/test/window.test.js
+20
-55
未找到文件。
graphic/windowstandard/src/main/js/default/test/window.test.js
浏览文件 @
89c6bc0f
...
@@ -18,7 +18,7 @@ import window from '@ohos.window'
...
@@ -18,7 +18,7 @@ import window from '@ohos.window'
import
display
from
'
@ohos.display
'
import
display
from
'
@ohos.display
'
import
featureAbility
from
'
@ohos.ability.featureAbility
'
import
featureAbility
from
'
@ohos.ability.featureAbility
'
const
TRUE_WINDOW
=
true
;
const
TRUE_WINDOW
=
true
;
const
avoidAreaType
=
3
;
const
avoidAreaType
=
100
;
describe
(
'
window_test
'
,
function
()
{
describe
(
'
window_test
'
,
function
()
{
var
wnd
;
var
wnd
;
...
@@ -341,14 +341,11 @@ describe('window_test', function () {
...
@@ -341,14 +341,11 @@ describe('window_test', function () {
expect
(
wnd
!=
null
).
assertTrue
();
expect
(
wnd
!=
null
).
assertTrue
();
wnd
.
getAvoidArea
(
avoidAreaType
).
then
((
data
)
=>
{
wnd
.
getAvoidArea
(
avoidAreaType
).
then
((
data
)
=>
{
console
.
log
(
'
windowTest getAvoidAreaTest3 wnd.getAvoidArea success, data :
'
+
JSON
.
stringify
(
data
));
console
.
log
(
'
windowTest getAvoidAreaTest3 wnd.getAvoidArea success, data :
'
+
JSON
.
stringify
(
data
));
expect
(
data
.
rightRect
!=
null
).
assertTrue
();
expect
().
assertFail
();
expect
(
data
.
topRect
!=
null
).
assertTrue
();
expect
(
data
.
bottomRect
!=
null
).
assertTrue
();
expect
(
data
.
leftRect
!=
null
).
assertTrue
();
done
();
done
();
},
(
err
)
=>
{
},
(
err
)
=>
{
console
.
log
(
'
windowTest getAvoidAreaTest3 wnd.getAvoidArea failed, err :
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
windowTest getAvoidAreaTest3 wnd.getAvoidArea failed, err :
'
+
JSON
.
stringify
(
err
));
expect
(
).
assertFail
(
);
expect
(
err
.
code
).
assertEqual
(
130
);
done
();
done
();
})
})
},
(
err
)
=>
{
},
(
err
)
=>
{
...
@@ -428,13 +425,10 @@ describe('window_test', function () {
...
@@ -428,13 +425,10 @@ describe('window_test', function () {
wnd
.
getAvoidArea
(
avoidAreaType
,
(
err
,
data
)
=>
{
wnd
.
getAvoidArea
(
avoidAreaType
,
(
err
,
data
)
=>
{
if
(
err
.
code
!=
0
)
{
if
(
err
.
code
!=
0
)
{
console
.
log
(
'
windowTest getAvoidAreaTest6 wnd.getAvoidArea callback fail
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
windowTest getAvoidAreaTest6 wnd.getAvoidArea callback fail
'
+
JSON
.
stringify
(
err
));
expect
(
).
assertFail
(
);
expect
(
err
.
code
).
assertEqual
(
130
);
done
();
done
();
}
else
{
}
else
{
expect
(
data
.
topRect
!=
null
).
assertTrue
();
expect
().
assertFail
();
expect
(
data
.
rightRect
!=
null
).
assertTrue
();
expect
(
data
.
bottomRect
!=
null
).
assertTrue
();
expect
(
data
.
leftRect
!=
null
).
assertTrue
();
done
();
done
();
}
}
})
})
...
@@ -949,12 +943,22 @@ describe('window_test', function () {
...
@@ -949,12 +943,22 @@ describe('window_test', function () {
*/
*/
it
(
'
find_Test_001
'
,
0
,
async
function
(
done
)
{
it
(
'
find_Test_001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
windowTest findTest1 begin
'
);
console
.
log
(
'
windowTest findTest1 begin
'
);
window
.
find
(
'
window0
'
).
then
((
data
)
=>
{
window
.
create
(
'
findWindow0
'
,
window
.
WindowType
.
TYPE_APP
).
then
(
wnd
=>
{
console
.
log
(
'
windowTest findTest1 wnd.find success, data :
'
+
JSON
.
stringify
(
data
));
console
.
log
(
'
windowTest CreateTest1 create success wnd
'
+
wnd
);
expect
(
wnd
!=
null
).
assertTrue
();
window
.
find
(
'
findWindow0
'
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
log
(
'
windowTest findTest1 wnd.find fail, err :
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
else
{
console
.
log
(
'
windowTest findTest1 wnd.find success
'
);
expect
(
data
!=
null
).
assertTrue
();
expect
(
data
!=
null
).
assertTrue
();
done
();
done
();
}
})
},
(
err
)
=>
{
},
(
err
)
=>
{
console
.
log
(
'
windowTest
findTest1 wnd.find failed, err :
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
windowTest
CreateTest1 create failed, err :
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
expect
().
assertFail
();
done
();
done
();
})
})
...
@@ -978,26 +982,6 @@ describe('window_test', function () {
...
@@ -978,26 +982,6 @@ describe('window_test', function () {
})
})
})
})
/**
* @tc.number SUB_WMS_FIND_JSAPI_004
* @tc.name Test find_Test_003
* @tc.desc Query main window.
*/
it
(
'
find_Test_003
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
windowTest findTest3 begin
'
);
window
.
find
(
'
window0
'
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
log
(
'
windowTest findTest3 wnd.find fail, err :
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
else
{
console
.
log
(
'
windowTest findTest3 wnd.find fail
'
);
expect
(
data
!=
null
).
assertTrue
();
done
();
}
})
})
/**
/**
* @tc.number SUB_WMS_FIND_JSAPI_004
* @tc.number SUB_WMS_FIND_JSAPI_004
* @tc.name Test find_Test_004
* @tc.name Test find_Test_004
...
@@ -2151,25 +2135,6 @@ describe('window_test', function () {
...
@@ -2151,25 +2135,6 @@ describe('window_test', function () {
})
})
})
})
/**
* @tc.number SUB_WMS_ENUM_WINDOWSTAGEEVENTTYPE_JSAPI_001
* @tc.name Test enumWindowStageEventType_Test_001.
* @tc.desc To test the enum value of WindowStageEventType.
*/
it
(
'
enumWindowStageEventType_Test_001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
test the enum value of WindowStageEventType begin
'
);
try
{
expect
(
1
).
assertEqual
(
window
.
WindowStageEventType
.
FOREGROUND
);
expect
(
2
).
assertEqual
(
window
.
WindowStageEventType
.
ACTIVE
);
expect
(
3
).
assertEqual
(
window
.
WindowStageEventType
.
INACTIVE
);
expect
(
4
).
assertEqual
(
window
.
WindowStageEventType
.
BACKGROUND
);
done
();
}
catch
(
err
)
{
console
.
log
(
'
test enum value of windowStageEventType error
'
+
JSON
.
stringify
(
err
));
}
})
/**
/**
* @tc.number SUB_WMS_ENUM_WINDOWTYPE_JSAPI_001
* @tc.number SUB_WMS_ENUM_WINDOWTYPE_JSAPI_001
* @tc.name Test enumWindowType_Test_001.
* @tc.name Test enumWindowType_Test_001.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录