提交 2e910c9b 编写于 作者: A anning

设置用例补充

Signed-off-by: Nanning <anning7@huawei.com>
上级 0fffa929
......@@ -1131,6 +1131,57 @@ export default function settingUiJsunit() {
var str ="settings.wireless.owner_lockdown_wifi_cfg"
expect(str).assertEqual(settings.wireless.OWNER_LOCKDOWN_WIFI_CFG);
done();
});
it('settings_get_value_111',0,async function (done) {
let uri = 'dataability:///com.ohos.settingsdata.DataAbility';
let helper = featureAbility.acquireDataAbilityHelper(uri);
let name = 'settings.screen.brightness111';//关键字
let value = 'brightness111'//值
try{
settings.setValue(helper, name, value,(data)=>{
console.info("[settings_get_value_111] value is:" + data);
settings.getValue(helper, name).then(ret => {
console.info("[settings_get_value_111] value is:" + ret);
expect(ret).assertEqual(value);
done();
})
});
}catch(err){
console.info("[settings_get_value_111] error is:" + toString(error));
expect(true).assertTrue();
done();
return;
}
});
it('settings_get_value_112',0,async function (done) {
let uri = 'dataability:///com.ohos.settingsdata.DataAbility';
let helper = featureAbility.acquireDataAbilityHelper(uri);
let name = 'settings.screen.brightness112';//关键字
let value = 'brightness112'//值
try{
settings.setValue(helper, name, value)
.then((data)=>{
console.info("[settings_get_value_112] value is:" + data);
settings.getValue(helper, name).then(ret => {
console.info("[settings_get_value_112] value is:" + ret);
expect(ret).assertEqual(value);
done();
})
})
.catch((err)=>{
console.info("[settings_get_value_112] error is:" + toString(error));
expect(true).assertTrue();
done();
return;
})
}catch(err){
console.info("[settings_get_value_111] error is:" + toString(error));
expect(true).assertTrue();
done();
return;
}
});
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册