@@ -290,77 +290,6 @@ SUITE(outside_tests)
290
290
});
291
291
}
292
292
#endif // !defined(__cplusplus_winrt)
293
-
294
- TEST_FIXTURE (uri_address, outside_ssl_json)
295
- {
296
- // Create URI for:
297
- // https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=UUF1hMUVwlrvlVMjUGOZExgg&key=AIzaSyAviHxf_y0SzNoAq3iKqvWVE4KQ0yylsnk
298
- uri_builder playlistUri (U (" https://www.googleapis.com/youtube/v3/playlistItems?" ));
299
- playlistUri.append_query (U (" part" ), U (" snippet" ));
300
- playlistUri.append_query (U (" playlistId" ), U (" UUF1hMUVwlrvlVMjUGOZExgg" ));
301
- playlistUri.append_query (U (" key" ), U (" AIzaSyAviHxf_y0SzNoAq3iKqvWVE4KQ0yylsnk" ));
302
-
303
- // Send request
304
- web::http::client::http_client playlistClient (playlistUri.to_uri ());
305
-
306
- handle_timeout ([&] {
307
- // Retry up to 4 times.
308
- for (int i = 0 ; i < 4 ; ++i)
309
- {
310
- try
311
- {
312
- playlistClient.request (methods::GET)
313
- .then ([=](http_response playlistResponse) -> pplx::task<json::value> {
314
- return playlistResponse.extract_json ();
315
- })
316
- .then ([=](json::value v) {
317
- int count = 0 ;
318
- auto & obj = v.as_object ();
319
-
320
- VERIFY_ARE_NOT_EQUAL (obj.find (U (" pageInfo" )), obj.end ());
321
- VERIFY_ARE_NOT_EQUAL (obj.find (U (" items" )), obj.end ());
322
-
323
- auto & items = obj[U (" items" )];
324
-
325
- for (auto iter = items.as_array ().cbegin (); iter != items.as_array ().cend (); ++iter)
326
- {
327
- const auto & item = *iter;
328
- auto iSnippet = item.as_object ().find (U (" snippet" ));
329
- if (iSnippet == item.as_object ().end ())
330
- {
331
- throw std::runtime_error (" snippet key not found" );
332
- }
333
- auto iTitle = iSnippet->second .as_object ().find (U (" title" ));
334
- if (iTitle == iSnippet->second .as_object ().end ())
335
- {
336
- throw std::runtime_error (" title key not found" );
337
- }
338
- auto name = iTitle->second .serialize ();
339
- count++;
340
- }
341
- VERIFY_ARE_EQUAL (3 , count); // Update this accordingly, if the number of items changes
342
- })
343
- .wait ();
344
- break ;
345
- }
346
- catch (web::http::http_exception const & e)
347
- {
348
- #if defined(_MSC_VER) && !defined(__cplusplus_winrt)
349
- if (e.error_code ().value () != API_QUERY_DATA_AVAILABLE || i == 3 )
350
- {
351
- // If we didn't get a "connection broken" error (or we are on the last retry), rethrow it
352
- throw ;
353
- }
354
- #else
355
- (void )e;
356
- throw ;
357
- #endif
358
- os_utilities::sleep (1000 );
359
- }
360
- }
361
- });
362
- }
363
-
364
293
} // SUITE(outside_tests)
365
294
366
295
} // namespace client
0 commit comments