1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef FUZZTESTMANAGER_H 16 #define FUZZTESTMANAGER_H 17 18 #include <memory> 19 #include <string> 20 #include <map> 21 #include <unordered_map> 22 23 #include "nlohmann/json.hpp" 24 namespace OHOS { 25 namespace EventFwk { 26 class fuzzTestManager { 27 public: 28 typedef std::shared_ptr<fuzzTestManager> Ptr; ~fuzzTestManager()29 ~fuzzTestManager() 30 {} GetInstance()31 static Ptr GetInstance() 32 { 33 if (instance_ == nullptr) { 34 instance_ = std::shared_ptr<fuzzTestManager>(new fuzzTestManager); 35 } 36 return instance_; 37 } 38 39 void StartFuzzTest(); 40 41 private: 42 void SetJsonFunction(std::string); 43 void SetCycle(uint16_t cycle); 44 fuzzTestManager(); 45 fuzzTestManager(fuzzTestManager &) = delete; 46 fuzzTestManager &operator=(const fuzzTestManager &) = delete; 47 static Ptr instance_; 48 uint16_t cycle_ {}; 49 std::unordered_map<std::string, int> remainderMap_ {}; 50 std::unordered_map<std::string, std::function<void()>> callFunctionMap_ {}; 51 52 const int COLOR_R = 100; 53 const int COLOR_G = 100; 54 const int COLOR_B = 100; 55 56 void RegisterAsyncCommonEventResult(); 57 void RegisterCommonEventData(); 58 void RegisterCommonEventManager(); 59 void RegisterCommonEventPublishInfo(); 60 void RegisterCommonEventSubscribeInfo(); 61 void RegisterCommonEventSubscriber(); 62 void RegisterCommonEventSupport(); 63 void RegisterMatchingSkills(); 64 void RegisterDumper(); 65 void RegisterEventHandler(); 66 void RegisterEventQueue(); 67 void RegisterEventRunner(); 68 void RegisterFileDescriptorListener(); 69 void RegisterInnerEvent(); 70 void RegisterEventRunnerNativeImplement(); 71 void RegisterAbilityManager(); 72 void RegisterWantParams(); 73 void RegisterWant(); 74 void RegisterElementName(); 75 void RegisterBundleMgrProxy(); 76 77 void RegisterOHOSApplication(); 78 void RegisterAbility(); 79 void RegisterDataAbilityHelper(); 80 void RegisterDataUriUtils(); 81 void RegisterLifeCycle(); 82 83 void RegisterAbilityContext(); 84 void RegisterProcessInfo(); 85 }; 86 } // namespace EventFwk 87 } // namespace OHOS 88 89 #endif