aboutsummaryrefslogtreecommitdiffstats
path: root/brillo/http/http_proxy_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'brillo/http/http_proxy_test.cc')
-rw-r--r--brillo/http/http_proxy_test.cc33
1 files changed, 15 insertions, 18 deletions
diff --git a/brillo/http/http_proxy_test.cc b/brillo/http/http_proxy_test.cc
index eb44263..a0d1bfa 100644
--- a/brillo/http/http_proxy_test.cc
+++ b/brillo/http/http_proxy_test.cc
@@ -32,23 +32,20 @@ class HttpProxyTest : public testing::Test {
public:
void ResolveProxyHandlerAsync(dbus::MethodCall* method_call,
int timeout_msec,
- dbus::ObjectProxy::ResponseCallback
- MIGRATE_WrapObjectProxyCallback(callback)) {
+ dbus::ObjectProxy::ResponseCallback* callback) {
if (null_dbus_response_) {
- std::move(MIGRATE_WrapObjectProxyCallback(callback)).Run(nullptr);
+ std::move(*callback).Run(nullptr);
return;
}
- std::move(MIGRATE_WrapObjectProxyCallback(callback))
- .Run(CreateDBusResponse(method_call).get());
+ std::move(*callback).Run(CreateDBusResponse(method_call).get());
}
- MIGRATE_WrapObjectProxyResponseType(dbus::Response)
- ResolveProxyHandler(dbus::MethodCall* method_call, int timeout_msec) {
+ std::unique_ptr<dbus::Response> ResolveProxyHandler(
+ dbus::MethodCall* method_call, int timeout_msec) {
if (null_dbus_response_) {
- return MIGRATE_WrapObjectProxyResponseEmpty;
+ return std::unique_ptr<dbus::Response>();
}
- return MIGRATE_WrapObjectProxyResponseConversion(
- CreateDBusResponse(method_call));
+ return CreateDBusResponse(method_call);
}
MOCK_METHOD(void,
@@ -102,7 +99,7 @@ class HttpProxyTest : public testing::Test {
TEST_F(HttpProxyTest, DBusNullResponseFails) {
std::vector<std::string> proxies;
null_dbus_response_ = true;
- EXPECT_CALL(*object_proxy_, MIGRATE_MockCallMethodAndBlock(_, _))
+ EXPECT_CALL(*object_proxy_, CallMethodAndBlock(_, _))
.WillOnce(Invoke(this, &HttpProxyTest::ResolveProxyHandler));
EXPECT_FALSE(GetChromeProxyServers(bus_, kTestUrl, &proxies));
}
@@ -110,14 +107,14 @@ TEST_F(HttpProxyTest, DBusNullResponseFails) {
TEST_F(HttpProxyTest, DBusInvalidResponseFails) {
std::vector<std::string> proxies;
invalid_dbus_response_ = true;
- EXPECT_CALL(*object_proxy_, MIGRATE_MockCallMethodAndBlock(_, _))
+ EXPECT_CALL(*object_proxy_, CallMethodAndBlock(_, _))
.WillOnce(Invoke(this, &HttpProxyTest::ResolveProxyHandler));
EXPECT_FALSE(GetChromeProxyServers(bus_, kTestUrl, &proxies));
}
TEST_F(HttpProxyTest, NoProxies) {
std::vector<std::string> proxies;
- EXPECT_CALL(*object_proxy_, MIGRATE_MockCallMethodAndBlock(_, _))
+ EXPECT_CALL(*object_proxy_, CallMethodAndBlock(_, _))
.WillOnce(Invoke(this, &HttpProxyTest::ResolveProxyHandler));
EXPECT_TRUE(GetChromeProxyServers(bus_, kTestUrl, &proxies));
EXPECT_THAT(proxies, ElementsAre(kDirectProxy));
@@ -126,7 +123,7 @@ TEST_F(HttpProxyTest, NoProxies) {
TEST_F(HttpProxyTest, MultipleProxiesWithoutDirect) {
proxy_info_ = "proxy example.com; socks5 foo.com;";
std::vector<std::string> proxies;
- EXPECT_CALL(*object_proxy_, MIGRATE_MockCallMethodAndBlock(_, _))
+ EXPECT_CALL(*object_proxy_, CallMethodAndBlock(_, _))
.WillOnce(Invoke(this, &HttpProxyTest::ResolveProxyHandler));
EXPECT_TRUE(GetChromeProxyServers(bus_, kTestUrl, &proxies));
EXPECT_THAT(proxies, ElementsAre("http://example.com", "socks5://foo.com",
@@ -137,7 +134,7 @@ TEST_F(HttpProxyTest, MultipleProxiesWithDirect) {
proxy_info_ = "socks foo.com; Https example.com ; badproxy example2.com ; "
"socks5 test.com ; proxy foobar.com; DIRECT ";
std::vector<std::string> proxies;
- EXPECT_CALL(*object_proxy_, MIGRATE_MockCallMethodAndBlock(_, _))
+ EXPECT_CALL(*object_proxy_, CallMethodAndBlock(_, _))
.WillOnce(Invoke(this, &HttpProxyTest::ResolveProxyHandler));
EXPECT_TRUE(GetChromeProxyServers(bus_, kTestUrl, &proxies));
EXPECT_THAT(proxies, ElementsAre("socks4://foo.com", "https://example.com",
@@ -147,7 +144,7 @@ TEST_F(HttpProxyTest, MultipleProxiesWithDirect) {
TEST_F(HttpProxyTest, DBusNullResponseFailsAsync) {
null_dbus_response_ = true;
- EXPECT_CALL(*object_proxy_, MIGRATE_CallMethod(_, _, _))
+ EXPECT_CALL(*object_proxy_, DoCallMethod(_, _, _))
.WillOnce(Invoke(this, &HttpProxyTest::ResolveProxyHandlerAsync));
EXPECT_CALL(*this, GetProxiesCallback(false, _));
GetChromeProxyServersAsync(
@@ -157,7 +154,7 @@ TEST_F(HttpProxyTest, DBusNullResponseFailsAsync) {
TEST_F(HttpProxyTest, DBusInvalidResponseFailsAsync) {
invalid_dbus_response_ = true;
- EXPECT_CALL(*object_proxy_, MIGRATE_CallMethod(_, _, _))
+ EXPECT_CALL(*object_proxy_, DoCallMethod(_, _, _))
.WillOnce(Invoke(this, &HttpProxyTest::ResolveProxyHandlerAsync));
EXPECT_CALL(*this, GetProxiesCallback(false, _));
GetChromeProxyServersAsync(
@@ -173,7 +170,7 @@ TEST_F(HttpProxyTest, MultipleProxiesWithDirectAsync) {
std::vector<std::string> expected = {
"socks4://foo.com", "https://example.com", "socks5://test.com",
"http://foobar.com", kDirectProxy};
- EXPECT_CALL(*object_proxy_, MIGRATE_CallMethod(_, _, _))
+ EXPECT_CALL(*object_proxy_, DoCallMethod(_, _, _))
.WillOnce(Invoke(this, &HttpProxyTest::ResolveProxyHandlerAsync));
EXPECT_CALL(*this, GetProxiesCallback(true, expected));
GetChromeProxyServersAsync(