1 /*
2 * Copyright (c) 2022 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
16 #include "request_manager_test.h"
17
18 #include "accesstoken_kit.h"
19 #include "app_mgr_constants.h"
20 #include "nativetoken_kit.h"
21 #include "token_setproc.h"
22
23 #include "i_locator_callback.h"
24 #include "locator_callback_host.h"
25 #include "request.h"
26 #include "request_config.h"
27
28 using namespace testing::ext;
29
30 namespace OHOS {
31 namespace Location {
32 const int32_t LOCATION_PERM_NUM = 4;
33 const int UNKNOWN_PRIORITY = 0x01FF;
34 const int UNKNOWN_SCENE = 0x02FF;
SetUp()35 void RequestManagerTest::SetUp()
36 {
37 MockNativePermission();
38 requestManager_ = DelayedSingleton<RequestManager>::GetInstance();
39 EXPECT_NE(nullptr, requestManager_);
40 request_ = std::make_shared<Request>();
41 EXPECT_NE(nullptr, request_);
42 request_->SetUid(SYSTEM_UID);
43 request_->SetPid(0);
44 request_->SetTokenId(tokenId_);
45 request_->SetFirstTokenId(0);
46 request_->SetPackageName("RequestManagerTest");
47 auto requestConfig = std::make_unique<RequestConfig>();
48 EXPECT_NE(nullptr, requestConfig);
49 requestConfig->SetPriority(PRIORITY_FAST_FIRST_FIX);
50 requestConfig->SetFixNumber(1);
51 request_->SetRequestConfig(*requestConfig);
52 sptr<LocatorCallbackHost> locatorCallbackHost =
53 sptr<LocatorCallbackHost>(new (std::nothrow)LocatorCallbackHost());
54 callback_ = sptr<ILocatorCallback>(locatorCallbackHost);
55 request_->SetLocatorCallBack(callback_);
56 }
57
TearDown()58 void RequestManagerTest::TearDown()
59 {
60 }
61
MockNativePermission()62 void RequestManagerTest::MockNativePermission()
63 {
64 const char *perms[] = {
65 ACCESS_LOCATION.c_str(), ACCESS_APPROXIMATELY_LOCATION.c_str(),
66 ACCESS_BACKGROUND_LOCATION.c_str(), MANAGE_SECURE_SETTINGS.c_str(),
67 };
68 NativeTokenInfoParams infoInstance = {
69 .dcapsNum = 0,
70 .permsNum = LOCATION_PERM_NUM,
71 .aclsNum = 0,
72 .dcaps = nullptr,
73 .perms = perms,
74 .acls = nullptr,
75 .processName = "RequestManagerTest",
76 .aplStr = "system_basic",
77 };
78 tokenId_ = GetAccessTokenId(&infoInstance);
79 SetSelfTokenID(tokenId_);
80 Security::AccessToken::AccessTokenKit::ReloadNativeTokenInfo();
81 }
82
FillRequestField(std::shared_ptr<Request> & request)83 void RequestManagerTest::FillRequestField(std::shared_ptr<Request>& request)
84 {
85 request->SetUid(SYSTEM_UID);
86 request->SetPid(0);
87 request->SetTokenId(0);
88 request->SetFirstTokenId(0);
89 request->SetPackageName("pkg.name");
90 std::unique_ptr<RequestConfig> requestConfig =
91 std::make_unique<RequestConfig>();
92 request->SetRequestConfig(*requestConfig);
93 sptr<LocatorCallbackHost> locatorCallbackHost =
94 sptr<LocatorCallbackHost>(new (std::nothrow)LocatorCallbackHost());
95 auto callback = sptr<ILocatorCallback>(locatorCallbackHost);
96 request->SetLocatorCallBack(callback);
97 request->SetRequesting(false);
98 std::unique_ptr<Location> location = std::make_unique<Location>();
99 request->SetLastLocation(location);
100 request->SetLocationPermState(true);
101 request->SetBackgroundPermState(true);
102 request->SetApproximatelyPermState(true);
103 }
104
VerifyRequestField(std::shared_ptr<Request> & request)105 void RequestManagerTest::VerifyRequestField(std::shared_ptr<Request>& request)
106 {
107 EXPECT_EQ(SYSTEM_UID, request->GetUid());
108 EXPECT_EQ(0, request->GetPid());
109 EXPECT_EQ(0, request->GetTokenId());
110 EXPECT_EQ(0, request->GetFirstTokenId());
111 EXPECT_EQ("pkg.name", request->GetPackageName());
112 EXPECT_NE(nullptr, request->GetRequestConfig());
113 EXPECT_NE(nullptr, request->GetLocatorCallBack());
114 EXPECT_EQ(false, request->GetIsRequesting());
115 EXPECT_NE(nullptr, request->GetLastLocation());
116 EXPECT_EQ(true, request->GetLocationPermState());
117 EXPECT_EQ(true, request->GetBackgroundPermState());
118 EXPECT_EQ(true, request->GetApproximatelyPermState());
119 }
120
121 HWTEST_F(RequestManagerTest, InitSystemListeners001, TestSize.Level1)
122 {
123 GTEST_LOG_(INFO)
124 << "RequestManagerTest, InitSystemListeners001, TestSize.Level1";
125 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] InitSystemListeners001 begin");
126 EXPECT_EQ(true, requestManager_->InitSystemListeners());
127 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] InitSystemListeners001 end");
128 }
129
130 HWTEST_F(RequestManagerTest, HandleStartAndStopLocating001, TestSize.Level1)
131 {
132 GTEST_LOG_(INFO)
133 << "RequestManagerTest, HandleStartAndStopLocating001, TestSize.Level1";
134 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] HandleStartAndStopLocating001 begin");
135 requestManager_->HandleStartLocating(request_);
136 requestManager_->HandleStopLocating(nullptr); // can't stop locating
137
138 requestManager_->HandleStartLocating(request_); // can start locating
139 requestManager_->HandleStopLocating(callback_); // can stop locating
140
141 requestManager_->HandleStartLocating(nullptr); // can't start locating
142 requestManager_->HandleStopLocating(callback_); // can stop locating, but not locating
143 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] HandleStartAndStopLocating001 end");
144 }
145
146 HWTEST_F(RequestManagerTest, HandlePowerSuspendChanged001, TestSize.Level1)
147 {
148 GTEST_LOG_(INFO)
149 << "RequestManagerTest, HandlePowerSuspendChanged001, TestSize.Level1";
150 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] HandlePowerSuspendChanged001 begin");
151 requestManager_->UpdateRequestRecord(request_, true);
152 int32_t state1 = static_cast<int32_t>(AppExecFwk::ApplicationState::APP_STATE_FOREGROUND);
153 requestManager_->HandlePowerSuspendChanged(request_->GetPid(),
154 request_->GetUid(), state1);
155 int32_t state2 = static_cast<int32_t>(AppExecFwk::ApplicationState::APP_STATE_BACKGROUND);
156 requestManager_->HandlePowerSuspendChanged(request_->GetPid(),
157 request_->GetUid(), state2);
158 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] HandlePowerSuspendChanged001 end");
159 }
160
161 HWTEST_F(RequestManagerTest, HandlePowerSuspendChanged002, TestSize.Level1)
162 {
163 GTEST_LOG_(INFO)
164 << "RequestManagerTest, HandlePowerSuspendChanged002, TestSize.Level1";
165 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] HandlePowerSuspendChanged002 begin");
166 requestManager_->UpdateRequestRecord(request_, false);
167 int32_t state1 = static_cast<int32_t>(AppExecFwk::ApplicationState::APP_STATE_FOREGROUND);
168 requestManager_->HandlePowerSuspendChanged(request_->GetPid(),
169 request_->GetUid(), state1);
170 int32_t state2 = static_cast<int32_t>(AppExecFwk::ApplicationState::APP_STATE_BACKGROUND);
171 requestManager_->HandlePowerSuspendChanged(request_->GetPid(),
172 request_->GetUid(), state2);
173 }
174
175 HWTEST_F(RequestManagerTest, HandlePowerSuspendChanged003, TestSize.Level1)
176 {
177 requestManager_->UpdateRequestRecord(request_, false);
178 int32_t state1 = static_cast<int32_t>(AppExecFwk::ApplicationState::APP_STATE_FOREGROUND);
179 requestManager_->HandlePowerSuspendChanged(request_->GetPid() + 1,
180 request_->GetUid(), state1);
181 int32_t state2 = static_cast<int32_t>(AppExecFwk::ApplicationState::APP_STATE_BACKGROUND);
182 requestManager_->HandlePowerSuspendChanged(request_->GetPid() + 1,
183 request_->GetUid(), state2);
184 }
185
186 HWTEST_F(RequestManagerTest, HandlePowerSuspendChanged004, TestSize.Level1)
187 {
188 requestManager_->UpdateRequestRecord(request_, false);
189 int32_t state1 = static_cast<int32_t>(AppExecFwk::ApplicationState::APP_STATE_FOREGROUND);
190 requestManager_->HandlePowerSuspendChanged(request_->GetPid(),
191 request_->GetUid() + 1, state1);
192 int32_t state2 = static_cast<int32_t>(AppExecFwk::ApplicationState::APP_STATE_BACKGROUND);
193 requestManager_->HandlePowerSuspendChanged(request_->GetPid(),
194 request_->GetUid() + 1, state2);
195 }
196
197 HWTEST_F(RequestManagerTest, UpdateRequestRecord001, TestSize.Level1)
198 {
199 GTEST_LOG_(INFO)
200 << "RequestManagerTest, UpdateRequestRecord001, TestSize.Level1";
201 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] UpdateRequestRecord001 begin");
202 requestManager_->UpdateRequestRecord(request_, true); // uid = 1000 should be added to runningUids
203 requestManager_->UpdateRequestRecord(request_, false); // uid = 1000 should be removed from runningUids
204 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] UpdateRequestRecord001 end");
205 }
206
207 HWTEST_F(RequestManagerTest, UpdateUsingPermissionTest001, TestSize.Level1)
208 {
209 GTEST_LOG_(INFO)
210 << "RequestManagerTest, UpdateUsingPermissionTest001, TestSize.Level1";
211 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] UpdateUsingPermissionTest001 begin");
212 requestManager_->UpdateUsingPermission(nullptr);
213 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] UpdateUsingPermissionTest001 end");
214 }
215
216 HWTEST_F(RequestManagerTest, UpdateUsingPermissionTest002, TestSize.Level1)
217 {
218 GTEST_LOG_(INFO)
219 << "RequestManagerTest, UpdateUsingPermissionTest002, TestSize.Level1";
220 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] UpdateUsingPermissionTest002 begin");
221 EXPECT_EQ(false, request_->GetLocationPermState());
222 EXPECT_EQ(false, request_->GetBackgroundPermState());
223 EXPECT_EQ(false, request_->GetApproximatelyPermState());
224 requestManager_->UpdateUsingPermission(request_);
225 EXPECT_EQ(false, request_->GetLocationPermState());
226 EXPECT_EQ(false, request_->GetBackgroundPermState());
227 EXPECT_EQ(false, request_->GetApproximatelyPermState());
228 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] UpdateUsingPermissionTest002 end");
229 }
230
231 HWTEST_F(RequestManagerTest, UpdateUsingPermissionTest003, TestSize.Level1)
232 {
233 GTEST_LOG_(INFO)
234 << "RequestManagerTest, UpdateUsingPermissionTest003, TestSize.Level1";
235 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] UpdateUsingPermissionTest003 begin");
236 requestManager_->UpdateRequestRecord(request_, true);
237 EXPECT_EQ(false, request_->GetLocationPermState());
238 EXPECT_EQ(false, request_->GetBackgroundPermState());
239 EXPECT_EQ(false, request_->GetApproximatelyPermState());
240 requestManager_->UpdateUsingPermission(request_);
241 EXPECT_EQ(true, request_->GetLocationPermState());
242 EXPECT_EQ(false, request_->GetBackgroundPermState());
243 EXPECT_EQ(true, request_->GetApproximatelyPermState());
244
245 requestManager_->UpdateRequestRecord(request_, false);
246 EXPECT_EQ(true, request_->GetLocationPermState());
247 EXPECT_EQ(false, request_->GetBackgroundPermState());
248 EXPECT_EQ(true, request_->GetApproximatelyPermState());
249 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] UpdateUsingPermissionTest003 end");
250 }
251
252 HWTEST_F(RequestManagerTest, HandlePermissionChangedTest001, TestSize.Level1)
253 {
254 GTEST_LOG_(INFO)
255 << "RequestManagerTest, HandlePermissionChangedTest001, TestSize.Level1";
256 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] HandlePermissionChangedTest001 begin");
257 requestManager_->HandleStartLocating(request_);
258 requestManager_->HandlePermissionChanged(request_->GetTokenId());
259
260 requestManager_->HandleStopLocating(callback_);
261 requestManager_->HandlePermissionChanged(request_->GetTokenId());
262 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] HandlePermissionChangedTest001 end");
263 }
264
265 HWTEST_F(RequestManagerTest, RequestTest001, TestSize.Level1)
266 {
267 GTEST_LOG_(INFO)
268 << "RequestManagerTest, RequestTest001, TestSize.Level1";
269 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestTest001 begin");
270 std::shared_ptr<Request> request = std::make_shared<Request>();
271 FillRequestField(request);
272 VerifyRequestField(request);
273 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestTest001 end");
274 }
275
276 HWTEST_F(RequestManagerTest, RequestGetProxyNameTest001, TestSize.Level1)
277 {
278 GTEST_LOG_(INFO)
279 << "RequestManagerTest, RequestGetProxyNameTest001, TestSize.Level1";
280 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest001 begin");
281 std::shared_ptr<Request> request = std::make_shared<Request>();
282 std::shared_ptr<std::list<std::string>> proxyList = nullptr;
283 request->GetProxyName(proxyList);
284 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest001 end");
285 }
286
287 HWTEST_F(RequestManagerTest, RequestGetProxyNameTest002, TestSize.Level1)
288 {
289 GTEST_LOG_(INFO)
290 << "RequestManagerTest, RequestGetProxyNameTest002, TestSize.Level1";
291 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest002 begin");
292 std::shared_ptr<Request> request = std::make_shared<Request>();
293 std::unique_ptr<RequestConfig> requestConfig1 =
294 std::make_unique<RequestConfig>();
295 requestConfig1->SetScenario(SCENE_NAVIGATION);
296 request->SetRequestConfig(*requestConfig1);
297 auto proxyList1 = std::make_shared<std::list<std::string>>();
298 request->GetProxyName(proxyList1);
299 EXPECT_NE(true, proxyList1->empty());
300 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest002 end");
301 }
302
303 HWTEST_F(RequestManagerTest, RequestGetProxyNameTest003, TestSize.Level1)
304 {
305 GTEST_LOG_(INFO)
306 << "RequestManagerTest, RequestGetProxyNameTest003, TestSize.Level1";
307 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest003 begin");
308 std::shared_ptr<Request> request = std::make_shared<Request>();
309 std::unique_ptr<RequestConfig> requestConfig2 =
310 std::make_unique<RequestConfig>();
311 requestConfig2->SetScenario(SCENE_TRAJECTORY_TRACKING);
312 request->SetRequestConfig(*requestConfig2);
313 auto proxyList2 = std::make_shared<std::list<std::string>>();
314 request->GetProxyName(proxyList2);
315 EXPECT_NE(true, proxyList2->empty());
316 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest003 end");
317 }
318
319 HWTEST_F(RequestManagerTest, RequestGetProxyNameTest004, TestSize.Level1)
320 {
321 GTEST_LOG_(INFO)
322 << "RequestManagerTest, RequestGetProxyNameTest004, TestSize.Level1";
323 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest004 begin");
324 std::shared_ptr<Request> request = std::make_shared<Request>();
325 std::unique_ptr<RequestConfig> requestConfig3 =
326 std::make_unique<RequestConfig>();
327 requestConfig3->SetScenario(SCENE_CAR_HAILING);
328 request->SetRequestConfig(*requestConfig3);
329 auto proxyList3 = std::make_shared<std::list<std::string>>();
330 request->GetProxyName(proxyList3);
331 EXPECT_NE(true, proxyList3->empty());
332 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest004 end");
333 }
334
335 HWTEST_F(RequestManagerTest, RequestGetProxyNameTest005, TestSize.Level1)
336 {
337 GTEST_LOG_(INFO)
338 << "RequestManagerTest, RequestGetProxyNameTest005, TestSize.Level1";
339 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest005 begin");
340 std::shared_ptr<Request> request = std::make_shared<Request>();
341 std::unique_ptr<RequestConfig> requestConfig4 =
342 std::make_unique<RequestConfig>();
343 requestConfig4->SetScenario(SCENE_DAILY_LIFE_SERVICE);
344 request->SetRequestConfig(*requestConfig4);
345 auto proxyList4 = std::make_shared<std::list<std::string>>();
346 request->GetProxyName(proxyList4);
347 EXPECT_NE(true, proxyList4->empty());
348 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest005 end");
349 }
350
351 HWTEST_F(RequestManagerTest, RequestGetProxyNameTest006, TestSize.Level1)
352 {
353 GTEST_LOG_(INFO)
354 << "RequestManagerTest, RequestGetProxyNameTest006, TestSize.Level1";
355 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest006 begin");
356 std::shared_ptr<Request> request = std::make_shared<Request>();
357 std::unique_ptr<RequestConfig> requestConfig5 =
358 std::make_unique<RequestConfig>();
359 requestConfig5->SetScenario(SCENE_NO_POWER);
360 request->SetRequestConfig(*requestConfig5);
361 auto proxyList5 = std::make_shared<std::list<std::string>>();
362 request->GetProxyName(proxyList5);
363 EXPECT_NE(true, proxyList5->empty());
364 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest006 end");
365 }
366
367 HWTEST_F(RequestManagerTest, RequestGetProxyNameTest007, TestSize.Level1)
368 {
369 GTEST_LOG_(INFO)
370 << "RequestManagerTest, RequestGetProxyNameTest007, TestSize.Level1";
371 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest007 begin");
372 std::shared_ptr<Request> request = std::make_shared<Request>();
373 std::unique_ptr<RequestConfig> requestConfig6 =
374 std::make_unique<RequestConfig>();
375 requestConfig6->SetScenario(SCENE_UNSET);
376 requestConfig6->SetPriority(PRIORITY_ACCURACY);
377 request->SetRequestConfig(*requestConfig6);
378 auto proxyList6 = std::make_shared<std::list<std::string>>();
379 request->GetProxyName(proxyList6);
380 EXPECT_NE(true, proxyList6->empty());
381 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest007 end");
382 }
383
384 HWTEST_F(RequestManagerTest, RequestGetProxyNameTest008, TestSize.Level1)
385 {
386 GTEST_LOG_(INFO)
387 << "RequestManagerTest, RequestGetProxyNameTest008, TestSize.Level1";
388 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest008 begin");
389 std::shared_ptr<Request> request = std::make_shared<Request>();
390 std::unique_ptr<RequestConfig> requestConfig7 =
391 std::make_unique<RequestConfig>();
392 requestConfig7->SetScenario(SCENE_UNSET);
393 requestConfig7->SetPriority(PRIORITY_LOW_POWER);
394 request->SetRequestConfig(*requestConfig7);
395 auto proxyList7 = std::make_shared<std::list<std::string>>();
396 request->GetProxyName(proxyList7);
397 EXPECT_NE(true, proxyList7->empty());
398 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest008 end");
399 }
400
401 HWTEST_F(RequestManagerTest, RequestGetProxyNameTest009, TestSize.Level1)
402 {
403 GTEST_LOG_(INFO)
404 << "RequestManagerTest, RequestGetProxyNameTest009, TestSize.Level1";
405 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest009 begin");
406 std::shared_ptr<Request> request = std::make_shared<Request>();
407 std::unique_ptr<RequestConfig> requestConfig8 =
408 std::make_unique<RequestConfig>();
409 requestConfig8->SetScenario(SCENE_UNSET);
410 requestConfig8->SetPriority(PRIORITY_FAST_FIRST_FIX);
411 request->SetRequestConfig(*requestConfig8);
412 auto proxyList8 = std::make_shared<std::list<std::string>>();
413 request->GetProxyName(proxyList8);
414 EXPECT_NE(true, proxyList8->empty());
415 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest009 end");
416 }
417
418 HWTEST_F(RequestManagerTest, RequestGetProxyNameTest010, TestSize.Level1)
419 {
420 GTEST_LOG_(INFO)
421 << "RequestManagerTest, RequestGetProxyNameTest010, TestSize.Level1";
422 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest010 begin");
423 std::shared_ptr<Request> request = std::make_shared<Request>();
424 std::unique_ptr<RequestConfig> requestConfig9 =
425 std::make_unique<RequestConfig>();
426 requestConfig9->SetScenario(SCENE_UNSET);
427 requestConfig9->SetPriority(UNKNOWN_PRIORITY);
428 request->SetRequestConfig(*requestConfig9);
429 auto proxyList9 = std::make_shared<std::list<std::string>>();
430 request->GetProxyName(proxyList9);
431 EXPECT_EQ(true, proxyList9->empty());
432 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest010 end");
433 }
434
435 HWTEST_F(RequestManagerTest, RequestGetProxyNameTest011, TestSize.Level1)
436 {
437 GTEST_LOG_(INFO)
438 << "RequestManagerTest, RequestGetProxyNameTest011, TestSize.Level1";
439 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest011 begin");
440 std::shared_ptr<Request> request = std::make_shared<Request>();
441 std::unique_ptr<RequestConfig> requestConfig10 =
442 std::make_unique<RequestConfig>();
443 requestConfig10->SetScenario(UNKNOWN_SCENE);
444 request->SetRequestConfig(*requestConfig10);
445 auto proxyList10 = std::make_shared<std::list<std::string>>();
446 request->GetProxyName(proxyList10);
447 EXPECT_EQ(true, proxyList10->empty());
448 LBSLOGI(REQUEST_MANAGER, "[RequestManagerTest] RequestGetProxyNameTest011 end");
449 }
450 } // namespace Location
451 } // namespace OHOS