From 22cf3c6e736367d2e5a34e3501b1388d6666fdf9 Mon Sep 17 00:00:00 2001 From: liuyanzhi Date: Mon, 8 May 2023 02:34:20 +0000 Subject: [PATCH] fix fuzz one Signed-off-by: liuyanzhi Change-Id: Ie3e5bb35232c13037717387a22c659bc33f5cef1 --- test/common/acts/BUILD.gn | 26 - .../acts/actsnotificationfuzztest/BUILD.gn | 81 --- .../actsnotificationfuzztest.cpp | 50 -- .../include/notificationfuzzconfigparser.h | 82 --- .../include/notificationfuzztestmanager.h | 88 ---- .../include/notificationgetparam.h | 477 ------------------ .../notificationfuzzconfig/config.json | 145 ------ 7 files changed, 949 deletions(-) delete mode 100644 test/common/acts/BUILD.gn delete mode 100644 test/common/acts/actsnotificationfuzztest/BUILD.gn delete mode 100644 test/common/acts/actsnotificationfuzztest/actsnotificationfuzztest.cpp delete mode 100644 test/resource/notificationfuzztest/include/notificationfuzzconfigparser.h delete mode 100644 test/resource/notificationfuzztest/include/notificationfuzztestmanager.h delete mode 100644 test/resource/notificationfuzztest/include/notificationgetparam.h delete mode 100644 test/resource/notificationfuzztest/notificationfuzzconfig/config.json diff --git a/test/common/acts/BUILD.gn b/test/common/acts/BUILD.gn deleted file mode 100644 index ad71e3517..000000000 --- a/test/common/acts/BUILD.gn +++ /dev/null @@ -1,26 +0,0 @@ -# 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("//build/ohos.gni") - -config("ansfwk_kits_test_config") { - visibility = [ ":*" ] - - include_dirs = [ "${services_path}/include" ] -} - -group("actsnotificationtest") { - testonly = true - - deps = [ "actsnotificationfuzztest:actsnotificationfuzztest" ] -} diff --git a/test/common/acts/actsnotificationfuzztest/BUILD.gn b/test/common/acts/actsnotificationfuzztest/BUILD.gn deleted file mode 100644 index 478baca17..000000000 --- a/test/common/acts/actsnotificationfuzztest/BUILD.gn +++ /dev/null @@ -1,81 +0,0 @@ -# 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("//base/notification/distributed_notification_service/notification.gni") -import("//build/test.gni") - -module_output_path = "${component_name}/systemtest" - -ohos_systemtest("ActsNotificationFuzzTest") { - module_out_path = module_output_path - resource_config_file = - "${component_path}/test/resource/notificationfuzztest/ohos_test.xml" - - sources = [ - "${component_path}/test/resource/notificationfuzztest/src/notificationfuzztestmanager.cpp", - "${component_path}/test/resource/notificationfuzztest/src/notificationgetparam.cpp", - "actsnotificationfuzztest.cpp", - ] - - configs = [ "${component_path}/test/common/acts:ansfwk_kits_test_config" ] - - include_dirs = [ - "${ability_runtime_inner_api_path}/ability_manager/include", - "${ability_runtime_path}/interfaces/kits/native/ability/native", - "${ability_runtime_kits_path}/app/native/app/include/task", - "${ability_runtime_services_path}/abilitymgr/include", - "${core_path}/include", - "${inner_api_path}", - "${services_path}/ans/include", - "//third_party/json/single_include", - ] - - cflags = [] - - if (target_cpu == "arm") { - cflags += [ "-DBINDER_IPC_32BIT" ] - } - - deps = [ - "${ability_runtime_path}/frameworks/native/appkit:appkit_native", - "${core_path}:ans_core", - "${frameworks_module_ans_path}:ans_innerkits", - "${services_path}/ans:ans_targets", - "//third_party/googletest:gtest_main", - ] - - external_deps = [ - "ability_base:base", - "ability_base:want", - "ability_runtime:ability_manager", - "ability_runtime:abilitykit_native", - "bundle_framework:appexecfwk_base", - "bundle_framework:appexecfwk_core", - "c_utils:utils", - "common_event_service:cesfwk_innerkits", - "eventhandler:libeventhandler", - "hiviewdfx_hilog_native:libhilog", - "ipc:ipc_core", - "multimedia_image_framework:image_native", - "relational_store:native_appdatafwk", - "relational_store:native_dataability", - "relational_store:native_rdb", - "samgr:samgr_proxy", - ] -} - -group("actsnotificationfuzztest") { - testonly = true - - deps = [ ":ActsNotificationFuzzTest" ] -} diff --git a/test/common/acts/actsnotificationfuzztest/actsnotificationfuzztest.cpp b/test/common/acts/actsnotificationfuzztest/actsnotificationfuzztest.cpp deleted file mode 100644 index 68c3dc861..000000000 --- a/test/common/acts/actsnotificationfuzztest/actsnotificationfuzztest.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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. - */ -#include "../../../resource/notificationfuzztest/include/notificationfuzztestmanager.h" - -#include -#include - -using namespace testing::ext; -namespace OHOS { -namespace Notification { -class ActsNotificationFuzzTest : public testing::Test { -public: - static void SetUpTestCase(); - static void TearDownTestCase(); - void SetUp(); - void TearDown(); -}; - -void ActsNotificationFuzzTest::SetUpTestCase() -{} - -void ActsNotificationFuzzTest::TearDownTestCase() -{} - -void ActsNotificationFuzzTest::SetUp() -{} - -void ActsNotificationFuzzTest::TearDown() -{} - -HWTEST_F(ActsNotificationFuzzTest, ACTS_FuzzTest_0100, Function | MediumTest | Level1) -{ - std::cout << "fuzztest start" << std::endl; - NotificationFuzzTestManager::GetInstance()->StartFuzzTest(); - std::cout << "fuzztest end" << std::endl; -} -} // namespace Notification -} // namespace OHOS \ No newline at end of file diff --git a/test/resource/notificationfuzztest/include/notificationfuzzconfigparser.h b/test/resource/notificationfuzztest/include/notificationfuzzconfigparser.h deleted file mode 100644 index bee6ada54..000000000 --- a/test/resource/notificationfuzztest/include/notificationfuzzconfigparser.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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. - */ -#ifndef NOTIFICATION_FUZZ_CONFIG_PARSER_H -#define NOTIFICATION_FUZZ_CONFIG_PARSER_H - -#include -#include -#include -#include - -#include "nlohmann/json.hpp" -namespace OHOS { -const std::string FUZZ_TEST_CONFIG_FILE_PATH {"/data/fuzztestconfig/config.json"}; - -const std::string FUZZ_TEST_MAIN_LOOP_KEY {"flag"}; - -struct FuzzTestData { - int32_t mainLoopFlag {0}; - std::vector methodVec {}; -}; - -class NotificationFuzzConfigParser { -public: - /** - * @brief Loads interface list from the configuration file. - * - * @param path The path of configuration file. - * @param ftd Records the configuration file. - */ - void ParseFromFile4FuzzTest(const std::string &path, FuzzTestData &ftd) const - { - std::cout << __func__ << std::endl; - if (path.empty()) { - std::cout << __FUNCTION__ << " invalid file path, check!" << std::endl; - return; - } - - nlohmann::json jsonObj; - std::ifstream(path) >> jsonObj; - std::cout << path; - for (auto it = jsonObj.begin(); it != jsonObj.end(); ++it) { - if (!it.key().compare(FUZZ_TEST_MAIN_LOOP_KEY)) { - ftd.mainLoopFlag = it.value(); - continue; - } - - auto className = it.key(); - if (it->is_structured()) { - for (auto itm = it->begin(); itm != it->end(); ++itm) { - auto methodName = itm.key(); - - if (!(it->is_structured() && (it->size() != 0))) { - ftd.methodVec.push_back(className + methodName); - continue; - } - - std::string param {}; - for (auto itp = itm->begin(); itp != itm->end(); ++itp) { - auto tp = itp.value(); - param += tp; - } - ftd.methodVec.push_back(className + methodName + param); - } - } - } - } -}; -} // namespace OHOS - -#endif // FUZZ_CONFIG_PARSER_H diff --git a/test/resource/notificationfuzztest/include/notificationfuzztestmanager.h b/test/resource/notificationfuzztest/include/notificationfuzztestmanager.h deleted file mode 100644 index e1c48e64b..000000000 --- a/test/resource/notificationfuzztest/include/notificationfuzztestmanager.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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. - */ -#ifndef NOTIFICATION_FUZZTESTMANAGER_H -#define NOTIFICATION_FUZZTESTMANAGER_H - -#include -#include - -#include "nlohmann/json.hpp" -namespace OHOS { -namespace Notification { -class NotificationFuzzTestManager { -public: - using Ptr = std::shared_ptr; - - /** - * @brief Default deconstructor used to deconstruct. - */ - ~NotificationFuzzTestManager() - {} - - /** - * @brief Obtains the instance of the fuzz test. - * - * @return Returns the instance of the fuzz test. - */ - static Ptr GetInstance() - { - if (instance == nullptr) { - NotificationFuzzTestManager* pObj = new NotificationFuzzTestManager(); - instance = std::shared_ptr(pObj); - } - return instance; - } - - /** - * @brief Starts the fuzz test. - */ - void StartFuzzTest(); - -private: - void SetJsonFunction(std::string functionName); - void SetCycle(uint16_t cycle); - NotificationFuzzTestManager(); - NotificationFuzzTestManager(const NotificationFuzzTestManager &) = delete; - NotificationFuzzTestManager &operator=(const NotificationFuzzTestManager &) = delete; - static Ptr instance; - uint16_t cycle_ = 0; - std::unordered_map remainderMap_ {}; - std::unordered_map> callFunctionMap_ {}; - - const int COLOR_R = 100; - const int COLOR_G = 100; - const int COLOR_B = 100; - void RegisterNotificationHelper(); - void RegisterNotificationSorting(); - void RegisterNotificationSortingMap(); - void RegisterNotificationSubscribeInfo(); - void RegisterNotificationSubscriber(); - void RegisterWantAgentHelper(); - void RegisterLauncherService(); - void RegisterNapiBundlemgr(); - void RegisterIAbilityContinuation(); - void RegisterRevocable(); - void RegisterTaskDispatcher(); - void RegisterAbility(); - void RegisterAbilityContext(); - void RegisterContext(); - void RegisterAbilityLifecycleCallbacks(); - void RegisterIAbilityManager(); - friend class TestAnsSubscriber; -}; -} // namespace EventFwk -} // namespace OHOS - -#endif \ No newline at end of file diff --git a/test/resource/notificationfuzztest/include/notificationgetparam.h b/test/resource/notificationfuzztest/include/notificationgetparam.h deleted file mode 100644 index dd986f444..000000000 --- a/test/resource/notificationfuzztest/include/notificationgetparam.h +++ /dev/null @@ -1,477 +0,0 @@ -/* - * 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. - */ -#ifndef NOTIFICATION_GET_PARAM_H -#define NOTIFICATION_GET_PARAM_H -#include -#include -#include -#include - -#include "ability.h" -#include "ability_handler.h" -#include "ability_manager.h" -#include "ability_manager_interface.h" -#include "ability_manager_service.h" -#include "data_uri_utils.h" -#include "element_name.h" -#include "event_runner.h" -#include "launcher_ability_info.h" -#include "launcher_service.h" -#include "uri.h" -#include "want.h" - -#ifdef PRINT_LOG -#undef PRINT_LOG -#endif - -#include "notification.h" -#include "notification_helper.h" -#include "notification_sorting_map.h" -#include "want_agent_helper.h" - -using Want = OHOS::AAFwk::Want; -namespace OHOS { -namespace Notification { -bool GetBoolParam(); -uint8_t GetU8Param(); -unsigned int GetUIntParam(); -uint16_t GetU16Param(); -uint32_t GetU32Param(); -uint64_t GetU64Param(); -int8_t GetS8Param(); -int16_t GetS16Param(); -int32_t GetS32Param(); -int64_t GetS64Param(); -char32_t GetChar32Param(); - -short GetShortParam(); -long GetLongParam(); -int GetIntParam(); -double GetDoubleParam(); -float GetFloatParam(); -char GetCharParam(); -char *GetCharArryParam(); -std::string GetStringParam(); -std::vector GetBoolVectorParam(); -std::vector GetShortVectorParam(); -std::vector GetLongVectorParam(); -std::vector GetIntVectorParam(); -std::vector GetFloatVectorParam(); -std::vector GetDoubleVectorParam(); -std::vector GetCharVectorParam(); -std::vector GetChar32VectorParam(); -std::vector GetStringVectorParam(); -template -std::vector GetUnsignVectorParam(); -std::vector GetS8VectorParam(); -std::vector GetS16VectorParam(); -std::vector GetS32VectorParam(); -std::vector GetS64VectorParam(); -std::shared_ptr GetParamWant(); -sptr GetParamSptrRemote(); -std::shared_ptr GetParamEventRunner(); -std::shared_ptr GetParamAbility(); -std::shared_ptr GetParamWantParams(); -OHOS::AppExecFwk::ApplicationFlag GetParamApplicationFlag(); -OHOS::AppExecFwk::ApplicationInfo GetParamApplicationInfo(); -OHOS::AppExecFwk::AbilityInfo GetParamAbilityInfo(); -sptr GetParamIBundleStatusCallback(); -std::shared_ptr GetParamNotificationSorting(); -std::vector GetParamNotificationSortingVector(); -std::shared_ptr GetParamNotificationSortingMap(); -std::shared_ptr GetParamNotificationSlot(); -sptr GetParamNotificationSlotSptr(); -OHOS::Notification::NotificationConstant::SlotType GetParamSlotType(); -std::vector> GetParamNotificationSlotSptrVector(); -std::vector GetParamNotificationSlotVector(); -std::shared_ptr GetParamNotificationBundleOption(); -std::shared_ptr GetParamNotificationRequest(); -std::vector> GetParamNotificationRequestVector(); -sptr GetParamNotificationSortingMapSptr(); -OHOS::Notification::NotificationSlot::NotificationLevel GetParamNotificationLevel(); -std::shared_ptr GetParamNotificationSubscriber(); -std::shared_ptr GetParamNotificationSubscribeInfo(); - -std::shared_ptr GetParamWantAgentInfo(); -OHOS::AbilityRuntime::WantAgent::WantAgentConstant::OperationType GetParamOperationType(); -OHOS::AbilityRuntime::WantAgent::WantAgentConstant::Flags GetParamFlags(); -std::vector GetParamFlagsVector(); - -std::shared_ptr GetParamNotification(); -sptr GetParamNotificationSptr(); -std::vector> GetParamNotificationSptrVector(); -std::shared_ptr GetParamPendingWant(); -std::shared_ptr GetParamWantAgent(); -std::shared_ptr GetParamCompletedCallback(); -std::shared_ptr GetParamTriggerInfo(); -std::shared_ptr GetParamCancelListener(); - -std::shared_ptr GetParamLauncherService(); -std::vector GetParamLauncherAbilityInfoVector(); -std::shared_ptr GetParamLauncherAbilityInfo(); -std::vector GetParamLauncherShortcutInfoVector(); -std::vector GetParamFormInfoVector(); -std::vector GetParamShortcutInfoVector(); -std::vector GetParamModuleUsageRecordVector(); -sptr GetParamOnPermissionChangedCallback(); - -std::shared_ptr GetParamTaskDispatcher(); -std::shared_ptr GetParamBaseTaskDispatcher(); -OHOS::AppExecFwk::TaskPriority GetParamTaskPriority(); -std::shared_ptr GetParamRunnable(); -std::shared_ptr GetParamGroup(); -std::shared_ptr> GetParamIteratableTask(); -OHOS::Notification::NotificationConstant::SubscribeResult GetParamSubscribeResult(); -OHOS::AppExecFwk::MissionInformation GetParamMissionInformation(); -std::shared_ptr GetParamAbilityLifecycleCallbacks(); -std::shared_ptr GetParamIAbilityManager(); -std::shared_ptr GetParamNotificationDoNotDisturbDate(); -OHOS::Notification::NotificationConstant::DoNotDisturbType GetParamDoNotDisturbType(); -class TestRemoteObject : public IRemoteObject { -public: - /** - * @brief Default constructor used to construct. - */ - TestRemoteObject(); - - /** - * @brief Default deconstructor used to deconstruct. - */ - ~TestRemoteObject(); - - /** - * @brief Override GetObjectRefCount. - * - * @return Returns a fixed value of type int_32. - */ - int32_t GetObjectRefCount() override - { - return 0; - } - - /** - * @brief Override SendRequest. - * - * @param code The uint32_t type input parameter. - * @param data The MessageParcel type input parameter. - * @param reply The MessageOption type input parameter. - * @param option The MessageOption type input parameter. - * @return Returns a fixed value of type int. - */ - int SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override - { - return 0; - } - - /** - * @brief Override IsProxyObject. - * - * @return Returns a fixed value of type bool. - */ - bool IsProxyObject() const override - { - return true; - } - - /** - * @brief Override CheckObjectLegality. - * - * @return Returns a fixed value of type bool. - */ - bool CheckObjectLegality() const override - { - return true; - } - - /** - * @brief Override AddDeathRecipient. - * - * @param recipient The DeathRecipient type point input parameter. - * @return Returns a fixed value of type bool. - */ - bool AddDeathRecipient(const sptr &recipient) override - { - return true; - } - - /** - * @brief Override RemoveDeathRecipient. - * - * @param recipient The DeathRecipient type point input parameter. - * @return Returns a fixed value of type bool. - */ - bool RemoveDeathRecipient(const sptr &recipient) override - { - return true; - } - - /** - * @brief Override Marshalling. - * - * @param parcel The Parcel type input parameter. - * @return Returns a fixed value of type bool. - */ - bool Marshalling(Parcel &parcel) const override - { - return true; - } - - /** - * @brief Override AsInterface. - * - * @return Returns a null pointer. - */ - sptr AsInterface() override - { - return nullptr; - } - - /** - * @brief Override Dump. - * - * @param fd The int type input parameter. - * @param args The u16string type vector input parameter. - * @return Returns a fixed value of type int. - */ - int Dump(int fd, const std::vector &args) override - { - return 0; - } - - /** - * @brief Override GetObjectDescriptor - * - * @return Returns a random value of type u16string. - */ - std::u16string GetObjectDescriptor() const - { - std::u16string descriptor = std::u16string(); - return descriptor; - } -}; - -class TestIBundleStatusCallback : public OHOS::AppExecFwk::IBundleStatusCallback { -public: - /** - * @brief Default constructor used to construct. - */ - TestIBundleStatusCallback() - {} - - /** - * @brief Override OnBundleStateChanged. - * - * @param installType The uint8_t type input parameter. - * @param resultCode The int32_t type input parameter. - * @param resultMsg The string type input parameter. - * @param bundleName The string type input parameter. - */ - void OnBundleStateChanged(const uint8_t installType, const int32_t resultCode, const std::string &resultMsg, - const std::string &bundleName) override - {} - - /** - * @brief Default deconstructor used to deconstruct. - */ - virtual ~TestIBundleStatusCallback() - {} -}; - -class TestAnsSubscriber : public OHOS::Notification::NotificationSubscriber { -public: - /** - * @brief Default constructor used to create subscriber. - */ - TestAnsSubscriber() - {} - - /** - * @brief Default deconstructor used to deconstruct. - */ - ~TestAnsSubscriber() - {} - - /** - * @brief Override OnConnected. - */ - void OnConnected() override - { - std::cout << "TestAnsSubscriber OnConnected" << std::endl; - mutex.unlock(); - } - - /** - * @brief Override OnDisconnected. - */ - void OnDisconnected() override - { - std::cout << "TestAnsSubscriber OnDisconnected" << std::endl; - mutex.unlock(); - } - - /** - * @brief Override OnDied. - */ - void OnDied() override - {} - - /** - * @brief Override OnUpdate. - * - * @param sortingMap The NotificationSortingMap type point input parameter. - */ - void OnUpdate(const std::shared_ptr &sortingMap) override - {} - - /** - * @brief Override OnDoNotDisturbDateChange. - * - * @param date The NotificationDoNotDisturbDate type point input parameter. - */ - void OnDoNotDisturbDateChange(const std::shared_ptr &date) override - {} - - /** - * @brief Override OnCanceled. - * - * @param request The Notification type point input parameter. - * @param request The NotificationSortingMap type point input parameter. - * @param deleteReason The int type input parameter. - */ - void OnCanceled(const std::shared_ptr &request, - const std::shared_ptr &sortingMap, int deleteReason) override - {} - - /** - * @brief Override OnConsumed. - * - * @param request The Notification type point input parameter. - * @param sortingMap The NotificationSortingMap type point input parameter. - */ - void OnConsumed(const std::shared_ptr &request, - const std::shared_ptr &sortingMap) override - {} - -public: - static std::mutex mutex; -}; - -class TestCompletedCallback : public OHOS::AbilityRuntime::WantAgent::CompletedCallback { - void OnSendFinished(const AAFwk::Want &want, int resultCode, const std::string &resultData, - const AAFwk::WantParams &resultExtras) override - {} -}; - -class TestCancelListener : public OHOS::AbilityRuntime::WantAgent::CancelListener { -public: - /** - * @brief Override OnCancelled. - */ - void OnCancelled(int resultCode) override - {} -}; - -class TestOnPermissionChangedCallback : public OHOS::AppExecFwk::OnPermissionChangedCallback { -public: - /** - * @brief Override OnChanged. - * - * @param uid Records the uid. - */ - void OnChanged(const int32_t uid) override - {} -}; - -class TestAbilityLifecycleCallbacks : public OHOS::AppExecFwk::AbilityLifecycleCallbacks { -public: - /** - * @brief Default constructor used to construct. - */ - TestAbilityLifecycleCallbacks() = default; - - /** - * @brief Default deconstructor used to deconstruct. - */ - virtual ~TestAbilityLifecycleCallbacks() = default; - - /** - * @brief Override OnAbilityStart. - * - * @param ability The ability to records the start state. - */ - virtual void OnAbilityStart(const std::shared_ptr &ability) - {} - - /** - * @brief Override OnAbilityInactive. - * - * @param ability The ability to records the inactive state. - */ - virtual void OnAbilityInactive(const std::shared_ptr &ability) - {} - - /** - * @brief Override OnAbilityBackground. - * - * @param ability The ability to records the background state. - */ - virtual void OnAbilityBackground(const std::shared_ptr &ability) - {} - - /** - * @brief Override OnAbilityForeground. - * - * @param ability The ability to records the foreground state. - */ - virtual void OnAbilityForeground(const std::shared_ptr &ability) - {} - - /** - * @brief Override OnAbilityActive. - * - * @param ability The ability to records the active state. - */ - virtual void OnAbilityActive(const std::shared_ptr &ability) - {} - - /** - * @brief Override OnAbilityStop. - * - * @param ability The ability to records the stop state. - */ - virtual void OnAbilityStop(const std::shared_ptr &ability) - {} - - /** - * @brief Override OnAbilitySaveState. - * - * @param outState Output status. - */ - virtual void OnAbilitySaveState(const OHOS::AppExecFwk::PacMap &outState) - {} -}; -class WantSender : public OHOS::AAFwk::WantSenderStub { -public: - /** - * @brief Override Send. - * - * @param senderInfo Sender information. - */ - void Send(OHOS::AAFwk::SenderInfo &senderInfo) override - {} -}; -} // namespace Notification -} // namespace OHOS -#endif diff --git a/test/resource/notificationfuzztest/notificationfuzzconfig/config.json b/test/resource/notificationfuzztest/notificationfuzzconfig/config.json deleted file mode 100644 index d5c2c34c0..000000000 --- a/test/resource/notificationfuzztest/notificationfuzzconfig/config.json +++ /dev/null @@ -1,145 +0,0 @@ -{ - "flag": 10, - "NotificationSubscriber": { - "OnCanceledNotification": [], - "OnCanceledNotificationNotificationSortingMapint": [], - "OnSubscribeResult": [], - "OnConsumedNotification": [], - "OnConsumedNotificationNotificationSortingMap": [], - "OnUnsubscribeResultNotificationConstantSubscribeResult": [], - "OnUpdate": [], - "OnDied": [] - }, - "NotificationSubscribeInfo": { - "AddAppName": [], - "AddAppNames": [], - "GetAppNames": [] - }, - "NotificationSorting": { - "GetRanking": [], - "GetKey": [], - "GetImportance": [], - "GetSlot": [], - "GetVisiblenessOverride": [], - "IsDisplayBadge": [], - "IsHiddenNotification": [], - "GetGroupKeyOverride": [] - }, - "NotificationSortingMap": { - "GetKey": [], - "GetNotificationSorting": [] - }, - "NotificationHelper": { - "AddNotificationSlot": [], - "AddSlotByType": [], - "AddNotificationSlots": [], - "RemoveNotificationSlot": [], - "RemoveAllSlots": [], - "GetNotificationSlot": [], - "GetNotificationSlots": [], - "GetNotificationSlotNumAsBundle": [], - "PublishNotificationNotificationRequest": [], - "PublishNotificationstringNotificationRequest": [], - "PublishNotificationNotificationRequeststring": [], - "CancelNotificationint32_t": [], - "CancelNotificationstringint32_t": [], - "CancelAllNotifications": [], - "GetActiveNotificationNums": [], - "GetActiveNotifications": [], - "SetNotificationAgent": [], - "GetNotificationAgent": [], - "CanPublishNotificationAsBundle": [], - "PublishNotificationAsBundle": [], - "SetNotificationBadgeNum": [], - "SetNotificationBadgeNumint32_t": [], - "IsAllowedNotifybool": [], - "HasNotificationPolicyAccessPermission": [], - "GetBundleImportance": [], - "SubscribeNotificationNotificationSubscriber": [], - "SubscribeNotificationNotificationSubscriberNotificationSubscribeInfo": [], - "UnSubscribeNotificationNotificationSubscriber": [], - "UnSubscribeNotificationNotificationSubscriberNotificationSubscribeInfo": [], - "RemoveNotificationstring": [], - "RemoveNotificationNotificationBundleOptionint32_tstring": [], - "RemoveAllNotifications": [], - "RemoveNotificationsByBundle": [], - "RemoveNotifications": [], - "GetNotificationSlotsForBundle": [], - "UpdateNotificationSlots": [], - "GetAllActiveNotificationsNotification": [], - "GetAllActiveNotificationsstringNotification": [], - "IsAllowedNotify": [], - "SetNotificationsEnabledForAllBundles": [], - "SetNotificationsEnabledForDefaultBundle": [], - "SetNotificationsEnabledForSpecifiedBundle": [], - "SetShowBadgeEnabledForBundle": [], - "GetShowBadgeEnabledForBundle": [], - "GetShowBadgeEnabled": [], - "SetDoNotDisturbDate": [], - "GetDoNotDisturbDate": [] - }, - "WantAgentHelper": { - "GetWantAgentOHOSAppExecFwkContextWantAgentInfo": [], - "GetWantAgentWantAgentInfo": [], - "GetType": [], - "TriggerWantAgent": [], - "Cancel": [], - "JudgeEquality": [], - "GetHashCode": [], - "GetBundleName": [], - "GetUid": [], - "GetWant": [], - "RegisterCancelListener": [], - "UnregisterCancelListener": [] - }, - "LauncherService": { - "GetAbilityList": [], - "GetAbilityInfo": [], - "GetApplicationInfo": [], - "IsBundleEnabled": [], - "IsAbilityEnabled": [], - "GetShortcutInfos": [], - "RegisterCallback": [], - "UnRegisterCallback": [] - }, - "IAbilityContinuation": { - "OnStartContinuation": [], - "OnSaveData": [], - "OnRestoreData": [], - "OnCompleteContinuation": [] - }, - "Ability": { - "StartAbility": [], - "OnRequestPermissionsFromUserResult": [] - }, - "AbilityContext": { - "StartAbility": [] - }, - "Context": { - "VerifyPermission": [], - "VerifyCallingPermission": [], - "VerifySelfPermission": [], - "VerifyCallingOrSelfPermission": [], - "CanRequestPermission": [], - "RequestPermissionsFromUser": [], - "MoveMissionToEnd": [], - "SetMissionInformation": [], - "LockMission": [], - "UnlockMission": [], - "GetMissionId": [], - "GetUITaskDispatcher": [], - "GetMainTaskDispatcher": [], - "CreateParallelTaskDispatcher": [], - "CreateSerialTaskDispatcher": [], - "GetGlobalTaskDispatcher": [] - }, - "AbilityLifecycleCallbacks": { - "OnAbilityActive": [] - }, - "IAbilityManager": { - "MoveMissionToEnd": [], - "IsFirstInMission": [], - "PowerOn": [], - "PowerOff": [] - } -} \ No newline at end of file -- Gitee