Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b8af5bd0
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看板
未验证
提交
b8af5bd0
编写于
2月 28, 2022
作者:
O
openharmony_ci
提交者:
Gitee
2月 28, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2080 add settings
Merge pull request !2080 from 安宁/master
上级
5cd0c11a
e7c061b8
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
846 addition
and
0 deletion
+846
-0
settings/BUILD.gn
settings/BUILD.gn
+17
-0
settings/settings_ets/Test.json
settings/settings_ets/Test.json
+18
-0
settings/settings_ets/entry/src/main/BUILD.gn
settings/settings_ets/entry/src/main/BUILD.gn
+32
-0
settings/settings_ets/entry/src/main/config.json
settings/settings_ets/entry/src/main/config.json
+71
-0
settings/settings_ets/entry/src/main/ets/MainAbility/app.ets
settings/settings_ets/entry/src/main/ets/MainAbility/app.ets
+22
-0
settings/settings_ets/entry/src/main/ets/MainAbility/pages/index.ets
...ttings_ets/entry/src/main/ets/MainAbility/pages/index.ets
+64
-0
settings/settings_ets/entry/src/main/ets/MainAbility/test/List.test.ets
...ngs_ets/entry/src/main/ets/MainAbility/test/List.test.ets
+19
-0
settings/settings_ets/entry/src/main/ets/MainAbility/test/SettingUiJsunit.test.ets
...ry/src/main/ets/MainAbility/test/SettingUiJsunit.test.ets
+591
-0
settings/settings_ets/entry/src/main/resources/base/element/string.json
...ngs_ets/entry/src/main/resources/base/element/string.json
+12
-0
settings/settings_ets/entry/src/main/resources/base/media/icon.png
...settings_ets/entry/src/main/resources/base/media/icon.png
+0
-0
settings/settings_ets/signature/openharmony_sx.p7b
settings/settings_ets/signature/openharmony_sx.p7b
+0
-0
未找到文件。
settings/BUILD.gn
0 → 100755
浏览文件 @
b8af5bd0
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
group("settings") {
testonly = true
deps = [ "settings_ets:SettingsEtsTest" ]
}
settings/settings_ets/Test.json
0 → 100755
浏览文件 @
b8af5bd0
{
"description"
:
"Configuration for settings Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"600000"
,
"package"
:
"com.open.harmony.settings"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"SettingsEtsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
settings/settings_ets/entry/src/main/BUILD.gn
0 → 100755
浏览文件 @
b8af5bd0
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("SettingsEtsTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":settings_ets_assets",
":settings_ets_resources",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "SettingsEtsTest"
}
ohos_js_assets("settings_ets_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
}
ohos_resources("settings_ets_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
settings/settings_ets/entry/src/main/config.json
0 → 100755
浏览文件 @
b8af5bd0
{
"app"
:
{
"bundleName"
:
"com.open.harmony.settings"
,
"vendor"
:
"open"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
7
,
"releaseType"
:
"Release"
,
"target"
:
7
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.open.harmony.settings"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
"com.open.harmony.settings.MainAbility"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"MainAbility"
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:description_mainability"
,
"formsEnabled"
:
false
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
],
"name"
:
".MainAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
settings/settings_ets/entry/src/main/ets/MainAbility/app.ets
0 → 100755
浏览文件 @
b8af5bd0
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('Application onCreate')
},
onDestroy() {
console.info('Application onDestroy')
},
}
\ No newline at end of file
settings/settings_ets/entry/src/main/ets/MainAbility/pages/index.ets
0 → 100755
浏览文件 @
b8af5bd0
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets";
import testsuite from "../test/List.test.ets";
import featureAbility from "@ohos.ability.featureAbility";
@Entry
@Component
struct MyComponent {
aboutToAppear() {
console.info("start run testcase!!!!")
featureAbility.getWant()
.then((Want) => {
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
'id': 'extend'
});
core.addService('expect', expectExtend);
const reportExtend = new ReportExtend(file);
core.addService('report', reportExtend);
core.init();
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
console.info('parameters---->' + JSON.stringify(Want.parameters));
configService.setConfig(Want.parameters);
testsuite();
core.execute();
console.info('Operation successful. Data: ' + JSON.stringify(Want));
})
.catch((error) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error));
})
}
build() {
Flex({
direction: FlexDirection.Column,
alignItems: ItemAlign.Center,
justifyContent: FlexAlign.Center
}) {
Text('Settings ETS TEST')
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
.height('100%')
}
}
settings/settings_ets/entry/src/main/ets/MainAbility/test/List.test.ets
0 → 100755
浏览文件 @
b8af5bd0
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import settingUiJsunit from './SettingUiJsunit.test.ets';
export default function testsuite() {
settingUiJsunit();
}
\ No newline at end of file
settings/settings_ets/entry/src/main/ets/MainAbility/test/SettingUiJsunit.test.ets
0 → 100755
浏览文件 @
b8af5bd0
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets";
import settings from '@ohos.settings'
import featureAbility from '@ohos.ability.featureAbility';
export default function settingUiJsunit() {
describe('appInfoTest', function () {
console.log("************* settings Test start*************");
it('settings_uri_test_001', 0,async function (done) {
var name = 'settings.screen.test';
var uri = settings.getUriSync(name);
console.info("[settings_uri_test_001] uri is: " + uri);
var uri2 = settings.getUriSync(name);
console.info("[settings_uri_test_001] uri2 is: " + uri2);
expect(uri).assertEqual(uri2);
done();
});
it('settings_uri_test_002', 0, async function (done) {
var name = '';
var uri = settings.getUriSync(name);
console.info("[settings_uri_test_002] uri is: " + uri);
expect(uri).assertEqual('dataability:///com.ohos.settingsdata.DataAbility')
done();
});
it('settings_uri_test_003', 0, async function (done) {
var name = 122.00;
try {
var uri = settings.getUriSync(name);
console.info("[settings_uri_test_003] uri is: " + uri);
} catch (err) {
let errMsg = err;
console.error("[settings_uri_test_003] error = " + errMsg);
expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
.assertTrue();
}
done();
});
it('settings_uri_test_004', 0, async function (done) {
var name = 'settings.screen.brightness';
var uri = settings.getUriSync(name);
console.info("[settings_uri_test_004] uri is: " + uri);
expect(uri).assertEqual('dataability:///com.ohos.settingsdata.DataAbility/settings.screen.brightness')
done();
});
it('settings_get_value_005', 0, async function (done) {
var name = 'settings.screen.brightness20';
var uri = settings.getUriSync(name);
var helper = featureAbility.acquireDataAbilityHelper(uri);
let value = settings.getValueSync(helper, name, "test getValueSync");
console.info("[settings_get_value_005] value is: " + value);
expect(value).assertEqual("test getValueSync");
done();
});
it('settings_get_value_006', 0, async function () {
var name = 'settings.screen.brightness2';
var uri = settings.getUriSync(name);
console.info("[settings_get_value_006] uri is: " + uri);
var helper = featureAbility.acquireDataAbilityHelper(uri);
let obj = {
"aa": aa
}
try {
let value = settings.getValueSync(helper, name, obj);
console.info("[settings_get_value_006] value is: " + value);
expect(value).assertEqual("test getValueSync");
} catch (err) {
console.error("[settings_get_value_006] error = " + err);
expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
.assertTrue();
}
done();
});
it('settings_get_value_007', 0, async function () {
var name = 'settings.screen.brightness3';
var uri = settings.getUriSync(name);
console.info("[settings_get_value_007] uri is: " + uri);
var helper = featureAbility.acquireDataAbilityHelper(uri);
let obj = '';
try {
let value = settings.getValueSync(helper, name, obj);
console.info("[settings_get_value_007] value is: " + value);
expect(value).assertEqual('');
} catch (err) {
console.error("[settings_get_value_007] error = " + err);
expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
.assertTrue();
}
done();
});
it('settings_get_value_008', 0, async function (done) {
var name = 'settings.screen.brightness4';
var uri = settings.getUriSync(name);
console.info("[settings_get_value_008] uri is: " + uri);
var helper = featureAbility.acquireDataAbilityHelper(uri);
let obj = null;
try {
let value = settings.getValueSync(helper, name, obj);
console.info("[settings_get_value_008] value is: " + value);
} catch (err) {
console.error("[settings_get_value_008] error = " + err);
expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument[2] type. String expected.")
.assertTrue();
}
done();
});
it('settings_get_value_009', 0, async function (done) {
var name = 'settings.screen.brightness5';
var uri = settings.getUriSync(name);
console.info("[settings_get_value_009] uri is: " + uri);
var helper = "helper";
try {
let value = settings.getValueSync(helper, name, "test getValueSync");
console.info("[settings_get_value_009] value is: " + value);
} catch (err) {
console.error("[settings_get_value_009] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_get_value_010', 0, async function (done) {
var name = 'settings.screen.brightness6';
var uri = settings.getUriSync(name);
console.info("[settings_get_value_010] uri is: " + uri);
var helper = null;
try {
let value = settings.getValueSync(helper, name, "test getValueSync");
console.info("[settings_get_value_010] value is: " + value);
} catch (err) {
console.error("[settings_get_value_010] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_get_value_0011', 0, async function (done) {
var name = 'settings.screen.brightness7';
var uri = settings.getUriSync(name);
console.info("[settings_get_value_0011] uri is: " + uri);
var helper = "helper";
let obj = 121;
try {
let value = settings.getValueSync(helper, name, obj);
console.info("[settings_get_value_0011] value is: " + value);
} catch (err) {
console.error("[settings_get_value_0011] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_get_value_0012', 0, async function (done) {
var name = 'settings.screen.brightness8';
var uri = settings.getUriSync(name);
console.info("[settings_get_value_0012] uri is: " + uri);
var helper = null;
let obj = null;
try {
let value = settings.getValueSync(helper, name, obj);
console.info("[settings_get_value_0012] value is: " + value);
} catch (err) {
console.error("[settings_get_value_0012] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_get_value_013', 0, async function (done) {
var name = 1322.00;
try {
var uri = settings.getUriSync(name);
console.info("[settings_get_value_013] uri is: " + uri);
} catch (err) {
let errMsg = err;
console.error("[settings_get_value_013] error = " + errMsg);
expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
.assertTrue();
}
var helper = featureAbility.acquireDataAbilityHelper(uri);
try {
let value = settings.getValueSync(helper, name, "test getValueSync");
console.info("[settings_get_value_013] value is: " + value);
} catch (err) {
console.error("[settings_get_value_013] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_get_value_014', 0, async function (done) {
let name = null;
try {
var uri = settings.getUriSync(name);
console.info("[settings_get_value_014] uri is: " + uri);
} catch (err) {
let errMsg = err;
console.error("[settings_get_value_014] error = " + errMsg);
expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
.assertTrue();
}
var helper = featureAbility.acquireDataAbilityHelper(uri);
try {
let value = settings.getValueSync(helper, name, "test getValueSync");
console.info("[settings_get_value_014] value is: " + value);
} catch (err) {
console.error("[settings_get_value_014] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_get_value_0015', 0, async function (done) {
let name = 1332;
try {
var uri = settings.getUriSync(name);
console.info("[settings_get_value_0015] uri is: " + uri);
} catch (err) {
let errMsg = err;
console.error("[settings_get_value_0015] error = " + errMsg);
expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
.assertTrue();
}
var helper = featureAbility.acquireDataAbilityHelper(uri);
let obj = 22223;
try {
let value = settings.getValueSync(helper, name, obj);
console.info("[settings_get_value_0015] value is: " + value);
} catch (err) {
console.error("[settings_get_value_0015] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_get_value_0016', 0, async function () {
let name = 1332;
try {
var uri = settings.getUriSync(name);
console.info("[settings_get_value_0016] uri is: " + uri);
} catch (err) {
let errMsg = err;
console.error("[settings_get_value_0016] error = " + errMsg);
expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
.assertTrue();
}
var helper = "helper";
try {
let value = settings.getValueSync(helper, name, "test getValueSync");
console.info("[settings_get_value_0016] value is: " + value);
} catch (err) {
console.error("[settings_get_value_0016] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_get_value_0017', 0, async function (done) {
let name = 1332;
try {
var uri = settings.getUriSync(name);
console.info("[settings_get_value_0017] uri is: " + uri);
} catch (err) {
let errMsg = err;
console.error("[settings_get_value_0017] error = " + errMsg);
expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
.assertTrue();
}
var helper = "helper";
let obj = 221323;
try {
let value = settings.getValueSync(helper, name, obj);
console.info("[settings_get_value_0017] value is: " + value);
} catch (err) {
console.error("[settings_get_value_0017] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_set_value_018', 0, async function (done) {
let name = 'settings.screen.brightness10';
var uri = settings.getUriSync(name);
var helper = featureAbility.acquireDataAbilityHelper(uri);
let value = settings.setValueSync(helper, name, "test getValueSync");
expect(value).assertEqual(true);
done();
});
it('settings_set_value_019', 0, async function (done) {
let name = 'settings.screen.brightness11';
var uri = settings.getUriSync(name);
var helper = featureAbility.acquireDataAbilityHelper(uri);
let obj = 32344.00;
try {
let value = settings.setValueSync(helper, name, obj);
console.info("[settings_set_value_019] value is: " + value);
expect(value).assertEqual(true);
} catch (err) {
console.error("[settings_set_value_019] error = " + err);
expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument[2] type. String expected.")
.assertTrue();
}
done();
});
it('settings_set_value_020', 0, async function (done) {
let name = 'settings.screen.brightness12';
var uri = settings.getUriSync(name);
var helper = featureAbility.acquireDataAbilityHelper(uri);
let obj = null;
try {
let value = settings.setValueSync(helper, name, obj);
console.info("[settings_set_value_020] value is: " + value);
expect(value).assertEqual(true);
} catch (err) {
console.error("[settings_set_value_020] error = " + err);
expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument[2] type. String expected.")
.assertTrue();
}
done();
});
it('settings_set_value_021', 0, async function (done) {
let name = 'settings.screen.brightness13';
var helper = "helper";
try {
let value = settings.setValueSync(helper, name, "test getValueSync");
expect(value).assertEqual(true);
} catch (err) {
console.error("[settings_set_value_021] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_set_value_022', 0, async function (done) {
let name = 'settings.screen.brightness13';
var helper = null;
try {
let value = settings.setValueSync(helper, name, "test getValueSync");
expect(value).assertEqual(true);
} catch (err) {
console.error("[settings_set_value_022] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_set_value_023', 0, async function (done) {
let name = 'settings.screen.brightness14';
var helper = "helper";
let obj = 343434.00;
try {
let value = settings.setValueSync(helper, name, obj);
expect(value).assertEqual(true);
} catch (err) {
console.error("[settings_set_value_023] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_set_value_024', 0, async function (done) {
let name = 'settings.screen.brightness14';
var helper = "helper";
let obj = null;
try {
let value = settings.setValueSync(helper, name, obj);
expect(value).assertEqual(true);
} catch (err) {
console.error("[settings_set_value_024] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_set_value_025', 0, async function (done) {
let name = 'settings.screen.brightness14';
var helper = null;
let obj = 2323.00;
try {
let value = settings.setValueSync(helper, name, obj);
expect(value).assertEqual(true);
} catch (err) {
console.error("[settings_set_value_025] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_set_value_026', 0, async function (done) {
let name = 1332;
try {
var uri = settings.getUriSync(name);
console.info("[settings_set_value_026] uri is: " + uri);
} catch (err) {
let errMsg = err;
console.error("[settings_set_value_026] error = " + errMsg);
expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
.assertTrue();
}
var helper = featureAbility.acquireDataAbilityHelper(uri);
try {
let value = settings.setValueSync(helper, name, "test getValueSync");
expect(value).assertEqual(true);
} catch (err) {
console.error("[settings_set_value_026] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_set_value_027', 0, async function (done) {
let name = null;
try {
var uri = settings.getUriSync(name);
console.info("[settings_set_value_027] uri is: " + uri);
} catch (err) {
let errMsg = err;
console.error("[settings_set_value_027] error = " + errMsg);
expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
.assertTrue();
}
var helper = featureAbility.acquireDataAbilityHelper(uri);
try {
let value = settings.setValueSync(helper, name, "test getValueSync");
expect(value).assertEqual(true);
} catch (err) {
console.error("[settings_set_value_027] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_set_value_028', 0, async function (done) {
let name = 2323;
try {
var uri = settings.getUriSync(name);
console.info("[settings_set_value_028] uri is: " + uri);
} catch (err) {
let errMsg = err;
console.error("[settings_set_value_028] error = " + errMsg);
expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
.assertTrue();
}
var helper = featureAbility.acquireDataAbilityHelper(uri);
let obj = 232.00;
try {
let value = settings.setValueSync(helper, name, obj);
expect(value).assertEqual(true);
} catch (err) {
console.error("[settings_set_value_028] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_set_value_029', 0, async function (done) {
let name = 2323;
try {
var uri = settings.getUriSync(name);
console.info("[settings_set_value_029] uri is: " + uri);
} catch (err) {
let errMsg = err;
console.error("[settings_set_value_029] error = " + errMsg);
expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
.assertTrue();
}
var helper = featureAbility.acquireDataAbilityHelper(uri);
let obj = null;
try {
let value = settings.setValueSync(helper, name, obj);
expect(value).assertEqual(true);
} catch (err) {
console.error("[settings_set_value_029] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_set_value_030', 0, async function (done) {
let name = 2323;
try {
var uri = settings.getUriSync(name);
console.info("[settings_set_value_030] uri is: " + uri);
} catch (err) {
let errMsg = err;
console.error("[settings_set_value_030] error = " + errMsg);
expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
.assertTrue();
}
var helper = "helper";
try {
let value = settings.setValueSync(helper, name, "text value");
expect(value).assertEqual(true);
} catch (err) {
console.error("[settings_set_value_030] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_set_value_031', 0, async function (done) {
let name = 2323;
try {
var uri = settings.getUriSync(name);
console.info("[settings_set_value_031] uri is: " + uri);
} catch (err) {
let errMsg = err;
console.error("[settings_set_value_031] error = " + errMsg);
expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
.assertTrue();
}
var helper = null;
try {
let value = settings.setValueSync(helper, name, "text value");
expect(value).assertEqual(true);
} catch (err) {
console.error("[settings_set_value_031] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
it('settings_set_value_032', 0, async function (done) {
let name = 2323;
try {
var uri = settings.getUriSync(name);
console.info("[settings_set_value_032] uri is: " + uri);
} catch (err) {
let errMsg = err;
console.error("[settings_set_value_032] error = " + errMsg);
expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
.assertTrue();
}
var helper = "helper";
let obj = 2323;
try {
let value = settings.setValueSync(helper, name, obj);
expect(value).assertEqual(true);
} catch (err) {
console.error("[settings_set_value_032] error = " + err);
expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
.assertTrue();
}
done();
});
})
}
settings/settings_ets/entry/src/main/resources/base/element/string.json
0 → 100755
浏览文件 @
b8af5bd0
{
"string"
:
[
{
"name"
:
"entry_MainAbility"
,
"value"
:
"entry_MainAbility"
},
{
"name"
:
"description_mainability"
,
"value"
:
"ETS_Empty Ability"
}
]
}
\ No newline at end of file
settings/settings_ets/entry/src/main/resources/base/media/icon.png
0 → 100755
浏览文件 @
b8af5bd0
6.6 KB
settings/settings_ets/signature/openharmony_sx.p7b
0 → 100755
浏览文件 @
b8af5bd0
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录