Support for IPv6 in HTTP socket and BufferReader unittests
* Add Apple MD5 support in DeviceFiles [ Merge of http://go/wvgerrit/15544 ] Patch courtesy of Spotify. * Changing vague BufferReader log message [ Merge of http://go/wvgerrit/15515 ] Amending the buffer reader log message for null parameters in the read function to say the type of parameter to help tell the difference between Read2, Read2s, Read4, Read4s, Read8, and Read8s. Bug: 23619044 * Fix HTTP socket tests [ Merge of http://go/wvgerrit/15521 ] This fixes the build on Jenkins. I missed these when I updated HTTP socket because they are not part of the CE CDM test suite. * Update HttpSocket for IPv6 [ Merge of http://go/wvgerrit/15517 ] Previously, HttpSocket made assumptions about IPv4. This CL updates this utility to be agnostic to IPv4 vs IPv6. If our servers start resolving to IPv6 addresses in future, our tests can now handle this transparently. * Removed low level warnings from PSSH [ Merge of http://go/wvgerrit/15489 ] Unneeded warnings in parsing PSSH and in buffer reader were appearing in the logs. LOGW commands were replaced with LOGV. Bug: 23419359 * BufferReader unit tests and hardening. [ Merge of http://go/wvgerrit/15449 ] Added unit tests for public-facing functions. Added protection against null or negative parameters. Bug: 23419008 Change-Id: Ia44100a2d1bafe68986ae9a0793214885b21e61e
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
#ifndef CDM_TEST_HTTP_SOCKET_H_
|
||||
#define CDM_TEST_HTTP_SOCKET_H_
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <gtest/gtest_prod.h>
|
||||
@@ -25,7 +27,7 @@ class HttpSocket {
|
||||
const std::string& scheme() const { return scheme_; }
|
||||
bool secure_connect() const { return secure_connect_; }
|
||||
const std::string& domain_name() const { return domain_name_; }
|
||||
int port() const { return port_; }
|
||||
int port() const { return atoi(port_.c_str()); }
|
||||
const std::string& resource_path() const { return resource_path_; }
|
||||
|
||||
int Read(char* data, int len, int timeout_in_ms);
|
||||
@@ -34,13 +36,13 @@ class HttpSocket {
|
||||
private:
|
||||
static bool ParseUrl(const std::string& url, std::string* scheme,
|
||||
bool* secure_connect, std::string* domain_name,
|
||||
int* port, std::string* path);
|
||||
std::string* port, std::string* path);
|
||||
FRIEND_TEST(HttpSocketTest, ParseUrlTest);
|
||||
|
||||
std::string scheme_;
|
||||
bool secure_connect_;
|
||||
std::string domain_name_;
|
||||
int port_;
|
||||
std::string port_;
|
||||
std::string resource_path_;
|
||||
bool valid_url_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user