From 7a085c3db9c96bf0237f93034fa299f90d8257e9 Mon Sep 17 00:00:00 2001 From: anning Date: Wed, 28 Sep 2022 21:50:36 +0800 Subject: [PATCH] applications Signed-off-by: anning --- applications/BUILD.gn | 2 +- applications/settingsdata/BUILD.gn | 2 +- .../settingsdata/settings_ets/BUILD.gn | 2 +- .../main/ets/test/SettingUiJsunit.test.ets | 69 +++++++++++++++++++ 4 files changed, 72 insertions(+), 3 deletions(-) diff --git a/applications/BUILD.gn b/applications/BUILD.gn index 7c8653c03..c11d1209e 100644 --- a/applications/BUILD.gn +++ b/applications/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# Copyright (C) 2022 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 diff --git a/applications/settingsdata/BUILD.gn b/applications/settingsdata/BUILD.gn index 8c1858d8f..dd277e22b 100644 --- a/applications/settingsdata/BUILD.gn +++ b/applications/settingsdata/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# Copyright (C) 2022 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 diff --git a/applications/settingsdata/settings_ets/BUILD.gn b/applications/settingsdata/settings_ets/BUILD.gn index c32edc598..7a002f2bc 100644 --- a/applications/settingsdata/settings_ets/BUILD.gn +++ b/applications/settingsdata/settings_ets/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2022 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 diff --git a/applications/settingsdata/settings_ets/entry/src/main/ets/test/SettingUiJsunit.test.ets b/applications/settingsdata/settings_ets/entry/src/main/ets/test/SettingUiJsunit.test.ets index 91bda9735..53b7fa209 100644 --- a/applications/settingsdata/settings_ets/entry/src/main/ets/test/SettingUiJsunit.test.ets +++ b/applications/settingsdata/settings_ets/entry/src/main/ets/test/SettingUiJsunit.test.ets @@ -1183,5 +1183,74 @@ export default function settingUiJsunit() { return; } }); + + it('settings_get_value_113',0,async function(done){ + try{console.info('test settings_get_value_113 start'); + settings.enableAirplaneMode(false,(err,data)=>{console.info('settings test enableAirplaneMode callback ssss'); + console.info('settings test enableAirplaneMode callback err'+JSON.stringify(err.code)); + expect(JSON.stringify(err.code)).assertEqual("801"); + done(); + }) + }catch(err){console.info('settings test enableAirplaneMode try catch err'); + expect(true).assertTrue(); + done(); + return; + }}); + + it('settings_get_value_114',0,async function(done){ + try{ + settings.enableAirplaneMode(false).then((data)=>{ + console.info('settings test enableAirplaneMode promise data'+JSON.stringify(data)); + expect(false).assertTrue(); + done(); + }).catch((err)=>{ + console.info('settings test enableAirplaneMode promise err'+JSON.stringify(err.code)); + expect(JSON.stringify(err.code)).assertEqual("801"); + done(); + return; + }) + }catch(err){ + console.info('settings test enableAirplaneMode try catch err'+JSON.stringify(err)); + expect(true).assertTrue(); + done(); + return; + } + }); + + it('settings_get_value_115',0,async function (done) { + try{ + settings.canShowFloating((err,data)=>{ + console.info('settings test canShowFloating promise err'+JSON.stringify(err.code)); + expect(JSON.stringify(err.code)).assertEqual("801"); + done(); + }) + }catch(err){ + console.info('settings test canShowFloating promise err'+toString(err)); + expect(true).assertTrue(); + done(); + return; + } + }); + + it('settings_get_value_116',0,async function (done) { + try{ + let str = {"code":801}; + settings.canShowFloating().then((data)=>{ + console.info('settings test canShowFloating promise err'+toString(data)); + expect(toString(err)).assertEqual(str); + done(); + }).catch((err)=>{ + console.info('settings test canShowFloating promise err'+JSON.stringify(err.code)); + expect(JSON.stringify(err.code)).assertEqual("801"); + done(); + return; + }) + }catch(err){ + console.info('settings test canShowFloating promise err'+toString(err)); + expect(true).assertTrue(); + done(); + return; + } + }); }) } -- GitLab