/ohos5.0/base/powermgr/battery_statistics/test/unittest/src/servicetest/mock/ |
H A D | stats_service_test_mock_parcel.cpp | 27 static sptr<BatteryStatsService> g_statsService = nullptr; variable 34 g_statsService = BatteryStatsService::GetInstance(); in SetUpTestCase() 35 g_statsService->OnStart(); in SetUpTestCase() 38 g_statsServiceProxy = std::make_shared<StatsServiceTestProxy>(g_statsService); in SetUpTestCase() 44 g_statsService->OnStop(); in TearDownTestCase()
|
/ohos5.0/base/powermgr/battery_statistics/test/unittest/src/servicetest/ |
H A D | stats_service_subscriber_test.cpp | 41 static sptr<BatteryStatsService> g_statsService = nullptr; variable 49 g_statsService = BatteryStatsService::GetInstance(); in SetUpTestCase() 50 g_statsService->OnStart(); in SetUpTestCase() 52 if (g_statsService->listenerPtr_ == nullptr) { in SetUpTestCase() 53 g_statsService->listenerPtr_ = std::make_shared<BatteryStatsListener>(); in SetUpTestCase() 56 if (g_statsService->subscriberPtr_ == nullptr) { in SetUpTestCase() 63 g_statsServiceProxy = std::make_shared<StatsServiceTestProxy>(g_statsService); in SetUpTestCase() 69 g_statsService->listenerPtr_ = nullptr; in TearDownTestCase() 70 g_statsService->subscriberPtr_ = nullptr; in TearDownTestCase() 71 g_statsService->OnStop(); in TearDownTestCase() [all …]
|
H A D | stats_service_alarm_test.cpp | 34 static sptr<BatteryStatsService> g_statsService = nullptr; variable 41 g_statsService = BatteryStatsService::GetInstance(); in SetUpTestCase() 42 g_statsService->OnStart(); in SetUpTestCase() 44 if (g_statsService->listenerPtr_ == nullptr) { in SetUpTestCase() 45 g_statsService->listenerPtr_ = std::make_shared<BatteryStatsListener>(); in SetUpTestCase() 49 g_statsServiceProxy = std::make_shared<StatsServiceTestProxy>(g_statsService); in SetUpTestCase() 55 g_statsService->listenerPtr_ = nullptr; in TearDownTestCase() 56 g_statsService->OnStop(); in TearDownTestCase()
|
H A D | stats_service_audio_test.cpp | 34 static sptr<BatteryStatsService> g_statsService = nullptr; variable 41 g_statsService = BatteryStatsService::GetInstance(); in SetUpTestCase() 42 g_statsService->OnStart(); in SetUpTestCase() 44 if (g_statsService->listenerPtr_ == nullptr) { in SetUpTestCase() 45 g_statsService->listenerPtr_ = std::make_shared<BatteryStatsListener>(); in SetUpTestCase() 49 g_statsServiceProxy = std::make_shared<StatsServiceTestProxy>(g_statsService); in SetUpTestCase() 55 g_statsService->listenerPtr_ = nullptr; in TearDownTestCase() 56 g_statsService->OnStop(); in TearDownTestCase()
|
H A D | stats_service_dump_test.cpp | 37 static sptr<BatteryStatsService> g_statsService = nullptr; variable 45 g_statsService = BatteryStatsService::GetInstance(); in SetUpTestCase() 46 g_statsService->OnStart(); in SetUpTestCase() 47 g_statsService->isBootCompleted_ = true; in SetUpTestCase() 49 if (g_statsService->listenerPtr_ == nullptr) { in SetUpTestCase() 50 g_statsService->listenerPtr_ = std::make_shared<BatteryStatsListener>(); in SetUpTestCase() 54 g_statsServiceProxy = std::make_shared<StatsServiceTestProxy>(g_statsService); in SetUpTestCase() 61 g_statsService->listenerPtr_ = nullptr; in TearDownTestCase() 62 g_statsService->OnStop(); in TearDownTestCase()
|
H A D | stats_service_location_test.cpp | 34 static sptr<BatteryStatsService> g_statsService = nullptr; variable 41 g_statsService = BatteryStatsService::GetInstance(); in SetUpTestCase() 42 g_statsService->OnStart(); in SetUpTestCase() 44 if (g_statsService->listenerPtr_ == nullptr) { in SetUpTestCase() 45 g_statsService->listenerPtr_ = std::make_shared<BatteryStatsListener>(); in SetUpTestCase() 49 g_statsServiceProxy = std::make_shared<StatsServiceTestProxy>(g_statsService); in SetUpTestCase() 55 g_statsService->listenerPtr_ = nullptr; in TearDownTestCase() 56 g_statsService->OnStop(); in TearDownTestCase()
|
H A D | stats_service_powermgr_test.cpp | 37 static sptr<BatteryStatsService> g_statsService = nullptr; variable 44 g_statsService = BatteryStatsService::GetInstance(); in SetUpTestCase() 45 g_statsService->OnStart(); in SetUpTestCase() 47 if (g_statsService->listenerPtr_ == nullptr) { in SetUpTestCase() 48 g_statsService->listenerPtr_ = std::make_shared<BatteryStatsListener>(); in SetUpTestCase() 52 g_statsServiceProxy = std::make_shared<StatsServiceTestProxy>(g_statsService); in SetUpTestCase() 58 g_statsService->listenerPtr_ = nullptr; in TearDownTestCase() 59 g_statsService->OnStop(); in TearDownTestCase()
|
H A D | stats_service_display_test.cpp | 36 static sptr<BatteryStatsService> g_statsService = nullptr; variable 65 g_statsService = BatteryStatsService::GetInstance(); in SetUpTestCase() 66 g_statsService->OnStart(); in SetUpTestCase() 68 if (g_statsService->listenerPtr_ == nullptr) { in SetUpTestCase() 69 g_statsService->listenerPtr_ = std::make_shared<BatteryStatsListener>(); in SetUpTestCase() 73 g_statsServiceProxy = std::make_shared<StatsServiceTestProxy>(g_statsService); in SetUpTestCase() 82 g_statsService->listenerPtr_ = nullptr; in TearDownTestCase() 83 g_statsService->OnStop(); in TearDownTestCase()
|
H A D | stats_service_wifi_test.cpp | 35 static sptr<BatteryStatsService> g_statsService = nullptr; variable 42 g_statsService = BatteryStatsService::GetInstance(); in SetUpTestCase() 43 g_statsService->OnStart(); in SetUpTestCase() 45 if (g_statsService->listenerPtr_ == nullptr) { in SetUpTestCase() 46 g_statsService->listenerPtr_ = std::make_shared<BatteryStatsListener>(); in SetUpTestCase() 50 g_statsServiceProxy = std::make_shared<StatsServiceTestProxy>(g_statsService); in SetUpTestCase() 56 g_statsService->listenerPtr_ = nullptr; in TearDownTestCase() 57 g_statsService->OnStop(); in TearDownTestCase()
|
H A D | stats_service_core_test.cpp | 27 static sptr<BatteryStatsService> g_statsService = nullptr; variable 32 g_statsService = BatteryStatsService::GetInstance(); in SetUpTestCase() 33 g_statsService->OnStart(); in SetUpTestCase() 38 g_statsService->OnStop(); in TearDownTestCase()
|
H A D | stats_service_camera_test.cpp | 34 static sptr<BatteryStatsService> g_statsService = nullptr; variable 41 g_statsService = BatteryStatsService::GetInstance(); in SetUpTestCase() 42 g_statsService->OnStart(); in SetUpTestCase() 44 if (g_statsService->listenerPtr_ == nullptr) { in SetUpTestCase() 45 g_statsService->listenerPtr_ = std::make_shared<BatteryStatsListener>(); in SetUpTestCase() 49 g_statsServiceProxy = std::make_shared<StatsServiceTestProxy>(g_statsService); in SetUpTestCase() 55 g_statsService->listenerPtr_ = nullptr; in TearDownTestCase() 56 g_statsService->OnStop(); in TearDownTestCase()
|
H A D | stats_service_phone_test.cpp | 36 static sptr<BatteryStatsService> g_statsService = nullptr; variable 43 g_statsService = BatteryStatsService::GetInstance(); in SetUpTestCase() 44 g_statsService->OnStart(); in SetUpTestCase() 46 if (g_statsService->listenerPtr_ == nullptr) { in SetUpTestCase() 47 g_statsService->listenerPtr_ = std::make_shared<BatteryStatsListener>(); in SetUpTestCase() 51 g_statsServiceProxy = std::make_shared<StatsServiceTestProxy>(g_statsService); in SetUpTestCase() 57 g_statsService->listenerPtr_ = nullptr; in TearDownTestCase() 58 g_statsService->OnStop(); in TearDownTestCase()
|
H A D | stats_service_bluetooth_test.cpp | 35 static sptr<BatteryStatsService> g_statsService = nullptr; variable 83 g_statsService = BatteryStatsService::GetInstance(); in SetUpTestCase() 84 g_statsService->OnStart(); in SetUpTestCase() 86 if (g_statsService->listenerPtr_ == nullptr) { in SetUpTestCase() 87 g_statsService->listenerPtr_ = std::make_shared<BatteryStatsListener>(); in SetUpTestCase() 91 g_statsServiceProxy = std::make_shared<StatsServiceTestProxy>(g_statsService); in SetUpTestCase() 97 g_statsService->listenerPtr_ = nullptr; in TearDownTestCase() 98 g_statsService->OnStop(); in TearDownTestCase()
|
/ohos5.0/base/powermgr/battery_statistics/services/native/src/ |
H A D | battery_stats_service.cpp | 46 auto g_statsService = BatteryStatsService::GetInstance(); variable 47 const bool G_REGISTER_RESULT = SystemAbility::MakeAndRegisterAbility(g_statsService.GetRefPtr());
|