Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
30b6ebb7
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,发现更多精彩内容 >>
未验证
提交
30b6ebb7
编写于
1月 28, 2022
作者:
O
openharmony_ci
提交者:
Gitee
1月 28, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1736 【startup_standard】【master】修复不稳定的用例
Merge pull request !1736 from 南先森/startup0127
上级
5a01fafe
88c9356e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
1 addition
and
329 deletion
+1
-329
startup/startup_standard/systemparamter/src/main/js/default/test/List.test.js
...dard/systemparamter/src/main/js/default/test/List.test.js
+1
-1
startup/startup_standard/systemparamter/src/main/js/default/test/SysParametersJs.test.js
...paramter/src/main/js/default/test/SysParametersJs.test.js
+0
-328
未找到文件。
startup/startup_standard/systemparamter/src/main/js/default/test/List.test.js
浏览文件 @
30b6ebb7
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
require('./SysParametersJs.test.js')
require
(
'
./SysParametersJs.test.js
'
)
startup/startup_standard/systemparamter/src/main/js/default/test/SysParametersJs.test.js
浏览文件 @
30b6ebb7
...
...
@@ -431,332 +431,4 @@ describe('SystemParameterTest', function () {
expect
(
ret
).
assertTrue
();
console
.
info
(
'
system_parameter_test_0815 end
'
);
})
/**
* @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0816
* @tc.name testWatcherOn01
* @tc.desc Watch the value of the attribute with the specified key.
*/
it
(
'
system_parameter_test_0816
'
,
0
,
function
()
{
console
.
info
(
'
system_parameter_test_0816 start
'
);
var
ret
=
true
;
let
key
=
"
test.watcher.401
"
;
try
{
let
watcher
=
systemparameter
.
getWatcher
(
key
);
if
(
watcher
===
undefined
)
{
ret
=
false
;
expect
(
ret
).
assertTrue
();
}
else
{
watcher
.
on
(
"
valueChange
"
,
function
(
key
,
value
)
{
ret
=
true
;
console
.
info
(
"
system_parameter_test_0816 callback key:
"
+
key
);
console
.
info
(
"
system_parameter_test_0816 callback value:
"
+
value
);
});
SetParameter
(
key
);
}
}
catch
(
e
)
{
ret
=
true
;
console
.
info
(
"
input error:
"
+
e
);
}
expect
(
ret
).
assertTrue
();
console
.
info
(
'
system_parameter_test_0816 end
'
);
})
/**
* @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0817
* @tc.name testWatcherOn02
* @tc.desc Watch the value of the attribute with the specified key.
*/
it
(
'
system_parameter_test_0817
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
system_parameter_test_0817 start
'
);
var
ret
=
true
;
let
key
=
"
test.watcher.402
"
;
try
{
let
watcher
=
systemparameter
.
getWatcher
(
key
);
if
(
watcher
===
undefined
)
{
ret
=
false
;
}
else
{
watcher
.
on
(
"
valueChange
"
,
function
(
key
,
value
)
{
// no callback
ret
=
true
;
console
.
info
(
"
system_parameter_test_0817 callback key:
"
+
key
);
console
.
info
(
"
system_parameter_test_0817 callback value:
"
+
value
);
});
}
}
catch
(
e
)
{
ret
=
false
;
console
.
info
(
"
input error:
"
+
e
);
}
expect
(
ret
).
assertTrue
();
done
();
console
.
info
(
'
system_parameter_test_0817 end
'
);
})
/**
* @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0818
* @tc.name testWatcherOn03
* @tc.desc Watch the value of the attribute with the specified key.
*/
it
(
'
system_parameter_test_0818
'
,
0
,
function
()
{
console
.
info
(
'
system_parameter_test_0818 start
'
);
var
ret
=
true
;
let
key
=
"
test.watcher.403
"
;
try
{
let
watcher
=
systemparameter
.
getWatcher
(
key
+
"
*
"
);
if
(
watcher
===
undefined
)
{
ret
=
false
;
}
else
{
watcher
.
on
(
"
valueChange
"
,
function
(
key
,
value
)
{
ret
=
true
;
console
.
info
(
"
system_parameter_test_0818 callback key:
"
+
key
);
console
.
info
(
"
system_parameter_test_0818 callback value:
"
+
value
);
});
SetParameter
(
"
test.watcher.403.404
"
);
}
}
catch
(
e
)
{
ret
=
false
;
console
.
info
(
"
input error:
"
+
e
);
}
expect
(
ret
).
assertTrue
();
console
.
info
(
'
system_parameter_test_0818 end
'
);
})
/**
* @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0819
* @tc.name testWatcherOn04
* @tc.desc Watch the value of the attribute with the specified key.
*/
it
(
'
system_parameter_test_0819
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
system_parameter_test_0819 start
'
);
var
ret
=
false
;
try
{
let
watcher
=
systemparameter
.
getWatcher
(
"
*
"
);
if
(
watcher
!=
undefined
)
{
let
code
=
watcher
.
on
(
"
valueChange
"
,
function
(
key
,
value
)
{
// fail
ret
=
true
;
console
.
info
(
"
system_parameter_test_0819 callback key:
"
+
key
);
console
.
info
(
"
system_parameter_test_0819 callback value:
"
+
value
);
});
console
.
info
(
"
system_parameter_test_0819 code:
"
+
code
);
}
else
{
ret
=
true
;
}
}
catch
(
e
)
{
ret
=
true
;
console
.
info
(
"
system_parameter_test_0819 error:
"
+
e
);
}
expect
(
ret
).
assertTrue
();
done
();
console
.
info
(
'
system_parameter_test_0819 end
'
);
})
function
callback1
(
key
,
value
)
{
console
.
info
(
"
callback1 Watch callback key:
"
+
key
);
console
.
info
(
"
callback1 Watch callback value:
"
+
value
);
}
/**
* @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0820
* @tc.name testWatcherOn05
* @tc.desc Watch the value of the attribute with the specified key.
*/
it
(
'
system_parameter_test_0820
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
system_parameter_test_0820 start
'
);
var
ret
=
true
;
let
key
=
"
test.watcher.405
"
;
try
{
let
watcher
=
systemparameter
.
getWatcher
(
key
);
if
(
watcher
===
undefined
)
{
ret
=
false
;
}
else
{
ret
=
false
;
let
code
=
watcher
.
on
(
"
valueChange
"
,
callback1
);
if
(
code
===
0
)
{
ret
=
true
;
}
code
=
watcher
.
on
(
"
valueChange
"
,
callback1
);
if
(
code
===
0
)
{
ret
=
true
;
}
}
}
catch
(
e
)
{
ret
=
true
;
console
.
info
(
"
system_parameter_test_0820 input error:
"
+
e
);
}
expect
(
ret
).
assertTrue
();
done
();
console
.
info
(
'
system_parameter_test_0820 end
'
);
})
/**
* @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0821
* @tc.name testWatcherOff01
* @tc.desc Watch the value of the attribute with the specified key.
*/
it
(
'
system_parameter_test_0821
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
system_parameter_test_0821 start
'
);
var
ret
=
false
;
let
key
=
"
test.watcher.501
"
;
try
{
let
watcher
=
systemparameter
.
getWatcher
(
key
);
if
(
watcher
===
undefined
)
{
ret
=
false
;
}
else
{
ret
=
true
;
let
code
=
watcher
.
on
(
"
valueChange
"
,
callback1
);
SetParameter
(
key
);
code
=
watcher
.
off
(
"
valueChange
"
,
callback1
);
if
(
code
===
0
)
{
ret
=
true
;
}
}
}
catch
(
e
)
{
ret
=
false
;
console
.
info
(
"
input error:
"
+
e
);
}
setTimeout
(
function
()
{
expect
(
ret
).
assertTrue
();
done
();
},
'
1000
'
);
console
.
info
(
'
system_parameter_test_0821 end
'
);
})
/**
* @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0822
* @tc.name testWatcherOff02
* @tc.desc Watch the value of the attribute with the specified key.
*/
it
(
'
system_parameter_test_0822
'
,
0
,
function
()
{
console
.
info
(
'
system_parameter_test_0822 start
'
);
var
ret
=
true
;
let
key
=
"
test.watcher.502
"
;
try
{
let
watcher
=
systemparameter
.
getWatcher
(
key
);
if
(
watcher
===
undefined
)
{
ret
=
false
;
}
else
{
let
code
=
watcher
.
on
(
"
valueChange222
"
,
callback1
);
if
(
code
===
0
)
{
ret
=
false
;
}
code
=
watcher
.
off
(
"
valueChange222
"
,
callback1
);
if
(
code
===
0
)
{
ret
=
false
;
}
}
}
catch
(
e
)
{
ret
=
false
;
console
.
info
(
"
input error:
"
+
e
);
}
expect
(
ret
).
assertTrue
();
console
.
info
(
'
system_parameter_test_0822 end
'
);
})
/**
* @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0823
* @tc.name testWatcherOff03
* @tc.desc Watch the value of the attribute with the specified key.
*/
it
(
'
system_parameter_test_0823
'
,
0
,
function
()
{
console
.
info
(
'
system_parameter_test_0823 start
'
);
var
ret
=
false
;
let
key
=
"
test.watcher.503
"
;
try
{
let
watcher
=
systemparameter
.
getWatcher
(
key
);
if
(
watcher
===
undefined
)
{
ret
=
false
;
}
else
{
ret
=
false
;
let
code
=
watcher
.
on
(
"
valueChange
"
,
function
(
key
,
value
)
{
console
.
info
(
"
system_parameter_test_0823 callback key:
"
+
key
);
console
.
info
(
"
system_parameter_test_0823 callback value:
"
+
value
);
let
code
=
watcher
.
off
(
"
valueChange
"
);
if
(
code
===
0
)
{
ret
=
true
;
}
});
if
(
code
===
0
)
{
ret
=
true
;
}
SetParameter
(
key
);
}
}
catch
(
e
)
{
ret
=
false
;
console
.
info
(
"
input error:
"
+
e
);
}
expect
(
ret
).
assertTrue
();
console
.
info
(
'
system_parameter_test_0823 end
'
);
})
/**
* @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0824
* @tc.name testWatcherOff04
* @tc.desc Watch the value of the attribute with the specified key.
*/
it
(
'
system_parameter_test_0824
'
,
0
,
function
()
{
console
.
info
(
'
system_parameter_test_0824 start
'
);
var
ret
=
false
;
let
key
=
"
test.watcher.504
"
;
try
{
let
watcher
=
systemparameter
.
getWatcher
(
key
);
if
(
watcher
===
undefined
)
{
ret
=
false
;
}
else
{
ret
=
false
;
let
code
=
watcher
.
on
(
"
valueChange
"
,
callback1
);
if
(
code
===
0
)
{
ret
=
true
;
}
code
=
watcher
.
off
(
"
valueChange
"
,
callback1
);
console
.
info
(
"
system_parameter_test_0824
"
+
code
);
if
(
code
===
0
)
{
ret
=
true
;
}
code
=
watcher
.
off
(
"
valueChange
"
,
callback1
);
console
.
info
(
"
system_parameter_test_0824
"
+
code
);
if
(
code
!=
0
)
{
ret
=
true
;
}
}
}
catch
(
e
)
{
ret
=
false
;
console
.
info
(
"
input error:
"
+
e
);
}
expect
(
ret
).
assertTrue
();
console
.
info
(
'
system_parameter_test_0824 end
'
);
})
function
callback3
(
key
,
value
)
{
console
.
info
(
"
system_parameter_test_0825 callback key:
"
+
key
);
console
.
info
(
"
system_parameter_test_0825 callback value:
"
+
value
);
}
/**
* @tc.number SUB_STARTUP_JS_SYSTEM_PARAMETER_0825
* @tc.name testWatcherOff05
* @tc.desc Watch the value of the attribute with the specified key.
*/
it
(
'
system_parameter_test_0825
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
system_parameter_test_0825 start
'
);
var
ret
=
false
;
let
key
=
"
test.watcher.505
"
;
try
{
let
watcher
=
systemparameter
.
getWatcher
(
key
);
if
(
watcher
===
undefined
)
{
ret
=
false
;
}
else
{
ret
=
false
;
let
code
=
watcher
.
on
(
"
valueChange
"
,
callback3
);
if
(
code
===
0
)
{
ret
=
true
;
}
SetParameter
(
key
);
}
}
catch
(
e
)
{
ret
=
false
;
console
.
info
(
"
input error:
"
+
e
);
}
expect
(
ret
).
assertTrue
();
done
();
console
.
info
(
'
system_parameter_test_0825 end
'
);
})
})
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录