Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
761b919f
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看板
未验证
提交
761b919f
编写于
1月 16, 2023
作者:
O
openharmony_ci
提交者:
Gitee
1月 16, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7181 优化用例
Merge pull request !7181 from 姚翠/monthly_20221018
上级
271ff71a
6c1a43a2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
81 addition
and
71 deletion
+81
-71
graphic/windowStage/entry/src/main/ets/test/displayAndWindowRefactorInterface.test.ets
.../main/ets/test/displayAndWindowRefactorInterface.test.ets
+22
-1
graphic/windowStage/entry/src/main/ets/test/windowCallback.test.ets
...ndowStage/entry/src/main/ets/test/windowCallback.test.ets
+59
-48
graphic/windowStage/entry/src/main/ets/test/windowPromise.test.ets
...indowStage/entry/src/main/ets/test/windowPromise.test.ets
+0
-22
未找到文件。
graphic/windowStage/entry/src/main/ets/test/displayAndWindowRefactorInterface.test.ets
浏览文件 @
761b919f
...
...
@@ -1912,13 +1912,14 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
sumCount
++
console
.
info
(
msgStr
+
'Succeeded in setting the window mode. count: '
+
sumCount
);
console
.
info
(
msgStr
+
'Succeeded in setting the window mode. loopCount.length: '
+
loopCount
.
length
);
if
(
sumCount
==
loopCount
.
length
)
done
();
if
(
++
i
<
length
)
{
getData
(
i
,
length
)
console
.
log
(
msgStr
+
'jixuzhixing i: '
+
i
);
}
else
{
console
.
log
(
msgStr
+
'i++<length i: '
+
i
+
' ,length:'
+
length
+
' ,tempType:'
+
tempType
);
}
if
(
sumCount
==
loopCount
.
length
)
done
();
})
.
catch
((
err
)
=>
{
console
.
log
(
msgStr
+
'currentType: '
+
tempType
)
console
.
error
(
msgStr
+
'Failed to set the window mode. Cause: '
+
JSON
.
stringify
(
err
));
...
...
@@ -2082,5 +2083,25 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
}
;
})
/**
* @tc.number SUB_WMS_ENUM_WINDOWSTAGEEVENTTYPERENAME_JSAPI_001
* @tc.name Test enumWindowStageEventTypeReName_Test_001.
* @tc.desc To test the enum value of WindowStageEventType.
*/
it
(
'enumWindowStageEventTypeReName_Test_001'
,
0
,
async
function
(
done
)
{
console
.
info
(
'test the enum value of WindowStageEventType begin'
);
try
{
expect
(
1
)
.
assertEqual
(
ohosWindow
.
WindowStageEventType
.
SHOWN
);
expect
(
2
)
.
assertEqual
(
ohosWindow
.
WindowStageEventType
.
ACTIVE
);
expect
(
3
)
.
assertEqual
(
ohosWindow
.
WindowStageEventType
.
INACTIVE
);
expect
(
4
)
.
assertEqual
(
ohosWindow
.
WindowStageEventType
.
HIDDEN
);
done
();
}
catch
(
err
)
{
console
.
info
(
'test enum value of windowStageEventType error '
+
JSON
.
stringify
(
err
));
expect
()
.
assertFail
();
done
();
}
})
})
}
graphic/windowStage/entry/src/main/ets/test/windowCallback.test.ets
浏览文件 @
761b919f
...
...
@@ -1119,40 +1119,6 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
unexpectedError
(
err
,
caseName
,
'ohosWindow.create'
,
done
);
})
})
/**
* @tc.number SUB_WINDOW_CREATE_JSAPI_008
* @tc.name Test createTest8
* @tc.desc Verify the scenario of creating a window with duplicate IDs
*/
it
(
'createTest8'
,
0
,
done
=>
{
let
caseName
=
'createTest8'
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
console
.
log
(
msgStr
+
'begin'
);
let
windowId
=
'sameid'
ohosWindow
.
create
(
context
,
windowId
,
1
,
(
err
,
data
)
=>
{
console
.
log
(
msgStr
+
'ohosWindow.create 1 once err: '
+
JSON
.
stringify
(
err
));
if
(
err
&&
err
.
code
)
{
unexpectedError
(
err
,
caseName
,
'ohosWindow.create'
,
done
);
}
expect
(
!!
data
)
.
assertTrue
();
ohosWindow
.
create
(
context
,
windowId
,
1
,
(
err
,
data
)
=>
{
console
.
log
(
msgStr
+
'ohosWindow.create 1 twice err: '
+
JSON
.
stringify
(
err
));
if
(
err
&&
err
.
code
)
{
console
.
log
(
msgStr
+
'ohosWindow.create 1 twice data: '
+
JSON
.
stringify
(
data
));
try
{
expect
(
err
.
code
)
.
assertEqual
(
1001
)
}
catch
(
error
)
{
console
.
info
(
`tempWnd.show catch error: ${JSON.stringify(error)}`
)
}
done
();
}
else
{
unexpectedError
(
err
,
caseName
,
'ohosWindow.create'
,
done
);
console
.
log
(
msgStr
+
'ohosWindow.create 1 twice data: '
+
JSON
.
stringify
(
data
));
}
})
})
})
/**
* @tc.number SUB_WINDOW_ON_OFF_JSAPI_005
* @tc.name Test listenerTest5
...
...
@@ -1240,19 +1206,16 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
it
(
'setWindowTypeTest3'
,
0
,
function
(
done
)
{
let
caseName
=
'setWindowTypeTest3'
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
let
baseWndType
=
1
;
let
windowId
=
'setWindowTypeTest3'
;
console
.
log
(
msgStr
+
'begin'
);
let
tempWnd
=
null
let
tempTypeArr
=
[];
ohosWindow
.
create
(
context
,
windowId
,
baseWndType
,
(
err
,
data
)
=>
{
try
{
console
.
log
(
msgStr
+
'ohosWindow.create err'
+
JSON
.
stringify
(
err
)
);
let
data
=
windowStage
.
getMainWindowSync
(
);
console
.
log
(
msgStr
+
'ohosWindow.create data'
+
JSON
.
stringify
(
data
));
console
.
log
(
msgStr
+
'ohosWindow.create !!data'
+
!!
data
);
if
(
!!
data
)
{
tempWnd
=
data
console
.
log
(
msgStr
+
'ohosWindow.create '
+
baseWndType
+
' wnd: '
+
tempWnd
);
//
console.log(msgStr + 'ohosWindow.create ' + baseWndType + ' wnd: ' + tempWnd);
try
{
expect
(
!!
tempWnd
)
.
assertTrue
();
}
catch
(
error
)
{
...
...
@@ -1327,7 +1290,6 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
}
catch
(
err
)
{
console
.
log
(
msgStr
+
'ohosWindow.create catch err: '
+
JSON
.
stringify
(
err
));
}
})
})
/**
* @tc.number SUB_WINDOW_SETWINDOWTYPE_JSAPI_004
...
...
@@ -1337,13 +1299,10 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
it
(
'setWindowTypeTest4'
,
0
,
function
(
done
)
{
let
caseName
=
'setWindowTypeTest4'
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
let
baseWndType
=
1
;
let
changedWndType
=
null
;
let
windowId
=
'setWindowTypeTest4'
;
console
.
log
(
msgStr
+
'begin'
);
let
tempWnd
=
null
ohosWindow
.
create
(
context
,
windowId
,
baseWndType
,
(
err
,
data
)
=>
{
console
.
log
(
msgStr
+
'ohosWindow.create err'
+
JSON
.
stringify
(
err
));
let
data
=
windowStage
.
getMainWindowSync
();
console
.
log
(
msgStr
+
'ohosWindow.create data'
+
JSON
.
stringify
(
data
));
console
.
log
(
msgStr
+
'ohosWindow.create !!data'
+
!!
data
);
if
(
!!
data
)
{
...
...
@@ -1368,10 +1327,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
done
();
}
})
}
else
{
unexpectedError
(
err
,
caseName
,
'ohosWindow.create'
,
done
);
}
})
}
})
/**
* @tc.number SUB_WINDOW_DESTROY_JSAPI_002
...
...
@@ -2270,5 +2226,60 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
})
})
})
/**
* @tc.number SUB_WINDOW_CREATE_JSAPI_008
* @tc.name Test createTest8
* @tc.desc Verify the scenario of creating a window with duplicate IDs
*/
it
(
'createTest8'
,
0
,
done
=>
{
let
caseName
=
'createTest8'
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
console
.
log
(
msgStr
+
'begin'
);
let
windowId
=
'sameid'
ohosWindow
.
create
(
context
,
windowId
,
1
,
(
err
,
data
)
=>
{
console
.
log
(
msgStr
+
'ohosWindow.create 1 once err: '
+
JSON
.
stringify
(
err
));
if
(
err
&&
err
.
code
)
{
unexpectedError
(
err
,
caseName
,
'ohosWindow.create'
,
done
);
}
expect
(
!!
data
)
.
assertTrue
();
ohosWindow
.
create
(
context
,
windowId
,
1
,
(
err
,
data
)
=>
{
console
.
log
(
msgStr
+
'ohosWindow.create 1 twice err: '
+
JSON
.
stringify
(
err
));
if
(
err
&&
err
.
code
)
{
console
.
log
(
msgStr
+
'ohosWindow.create 1 twice data: '
+
JSON
.
stringify
(
data
));
try
{
expect
(
err
.
code
)
.
assertEqual
(
1001
)
}
catch
(
error
)
{
console
.
info
(
`tempWnd.show catch error: ${JSON.stringify(error)}`
)
}
done
();
}
else
{
unexpectedError
(
err
,
caseName
,
'ohosWindow.create'
,
done
);
console
.
log
(
msgStr
+
'ohosWindow.create 1 twice data: '
+
JSON
.
stringify
(
data
));
}
})
})
})
/**
* @tc.number SUB_WINDOW_CREATE_JSAPI_004
* @tc.name Test createTest4
* @tc.desc Verify the scenario of creating a window with duplicate IDs
*/
it
(
'createTest4'
,
0
,
async
function
(
done
)
{
let
caseName
=
'createTest4'
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
console
.
log
(
msgStr
+
'begin'
);
let
windowId
=
'sameids'
let
ohosData
=
await
ohosWindow
.
create
(
context
,
windowId
,
1
)
.
catch
((
err
)
=>
{
console
.
log
(
msgStr
+
'ohosWindow.create 1 once err: '
+
JSON
.
stringify
(
err
));
unexpectedError
(
err
,
caseName
,
'ohosWindow.create'
,
done
);
})
expect
(
!!
ohosData
)
.
assertTrue
();
let
ohosDataError
=
await
ohosWindow
.
create
(
context
,
windowId
,
1
)
.
catch
((
err
)
=>
{
console
.
log
(
msgStr
+
'ohosWindow.create 1 twice err: '
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
)
.
assertEqual
(
1001
)
done
();
})
console
.
log
(
msgStr
+
'ohosWindow.create 1 twice ohosDataError: '
+
JSON
.
stringify
(
ohosDataError
));
})
})
}
graphic/windowStage/entry/src/main/ets/test/windowPromise.test.ets
浏览文件 @
761b919f
...
...
@@ -1158,28 +1158,6 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
});
})
/**
* @tc.number SUB_WINDOW_CREATE_JSAPI_004
* @tc.name Test createTest4
* @tc.desc Verify the scenario of creating a window with duplicate IDs
*/
it
(
'createTest4'
,
0
,
async
function
(
done
)
{
let
caseName
=
'createTest4'
;
let
msgStr
=
'jsunittest '
+
caseName
+
' '
;
console
.
log
(
msgStr
+
'begin'
);
let
windowId
=
'sameids'
let
ohosData
=
await
ohosWindow
.
create
(
context
,
windowId
,
1
)
.
catch
((
err
)
=>
{
console
.
log
(
msgStr
+
'ohosWindow.create 1 once err: '
+
JSON
.
stringify
(
err
));
unexpectedError
(
err
,
caseName
,
'ohosWindow.create'
,
done
);
})
expect
(
!!
ohosData
)
.
assertTrue
();
let
ohosDataError
=
await
ohosWindow
.
create
(
context
,
windowId
,
1
)
.
catch
((
err
)
=>
{
console
.
log
(
msgStr
+
'ohosWindow.create 1 twice err: '
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
)
.
assertEqual
(
1001
)
done
();
})
console
.
log
(
msgStr
+
'ohosWindow.create 1 twice ohosDataError: '
+
JSON
.
stringify
(
ohosDataError
));
})
/**
* @tc.number SUB_WINDOW_LOADCONTENT_JSAPI_001
* @tc.name Test loadContentTest1
* @tc.desc Verify the scenario of loading an existing page
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录