Merge branch 'google3' up to cl/358300997

This commit is contained in:
hai007
2021-02-19 11:31:01 -08:00
3 changed files with 19 additions and 13 deletions
@@ -107,9 +107,10 @@ DoDhKeyExchange(BaseEndpointChannel* channel_a,
{
.on_success_cb =
[&latch, &context_a](
const string& endpoint_id,
const std::string& endpoint_id,
std::unique_ptr<securegcm::UKey2Handshake> ukey2,
const string& auth_token, const ByteArray& raw_auth_token) {
const std::string& auth_token,
const ByteArray& raw_auth_token) {
NEARBY_LOG(INFO, "client-A side key negotiation done");
EXPECT_TRUE(ukey2->VerifyHandshake());
auto context = ukey2->ToConnectionContext();
@@ -118,7 +119,8 @@ DoDhKeyExchange(BaseEndpointChannel* channel_a,
latch.CountDown();
},
.on_failure_cb =
[&latch](const string& endpoint_id, EndpointChannel* channel) {
[&latch](const std::string& endpoint_id,
EndpointChannel* channel) {
NEARBY_LOG(INFO, "client-A side key negotiation failed");
latch.CountDown();
},
@@ -128,9 +130,10 @@ DoDhKeyExchange(BaseEndpointChannel* channel_a,
{
.on_success_cb =
[&latch, &context_b](
const string& endpoint_id,
const std::string& endpoint_id,
std::unique_ptr<securegcm::UKey2Handshake> ukey2,
const string& auth_token, const ByteArray& raw_auth_token) {
const std::string& auth_token,
const ByteArray& raw_auth_token) {
NEARBY_LOG(INFO, "client-B side key negotiation done");
EXPECT_TRUE(ukey2->VerifyHandshake());
auto context = ukey2->ToConnectionContext();
@@ -139,7 +142,8 @@ DoDhKeyExchange(BaseEndpointChannel* channel_a,
latch.CountDown();
},
.on_failure_cb =
[&latch](const string& endpoint_id, EndpointChannel* channel) {
[&latch](const std::string& endpoint_id,
EndpointChannel* channel) {
NEARBY_LOG(INFO, "client-B side key negotiation failed");
latch.CountDown();
},
+1 -1
View File
@@ -130,7 +130,7 @@ class MockPcpHandler : public BasePcpHandler {
(override));
MOCK_METHOD(Status, StopAdvertisingImpl, (ClientProxy * client), (override));
MOCK_METHOD(StartOperationResult, StartDiscoveryImpl,
(ClientProxy * client, const string& service_id,
(ClientProxy * client, const std::string& service_id,
const ConnectionOptions& options),
(override));
MOCK_METHOD(Status, StopDiscoveryImpl, (ClientProxy * client), (override));
+8 -6
View File
@@ -102,15 +102,16 @@ TEST(EncryptionRunnerTest, ReadWrite) {
&user_a.client, "endpoint_id", &user_a.channel,
{
.on_success_cb =
[&response](const string& endpoint_id,
[&response](const std::string& endpoint_id,
std::unique_ptr<securegcm::UKey2Handshake> ukey2,
const string& auth_token,
const std::string& auth_token,
const ByteArray& raw_auth_token) {
response.server_status = Response::Status::kDone;
response.latch.CountDown();
},
.on_failure_cb =
[&response](const string& endpoint_id, EndpointChannel* channel) {
[&response](const std::string& endpoint_id,
EndpointChannel* channel) {
response.server_status = Response::Status::kFailed;
response.latch.CountDown();
},
@@ -119,15 +120,16 @@ TEST(EncryptionRunnerTest, ReadWrite) {
&user_b.client, "endpoint_id", &user_b.channel,
{
.on_success_cb =
[&response](const string& endpoint_id,
[&response](const std::string& endpoint_id,
std::unique_ptr<securegcm::UKey2Handshake> ukey2,
const string& auth_token,
const std::string& auth_token,
const ByteArray& raw_auth_token) {
response.client_status = Response::Status::kDone;
response.latch.CountDown();
},
.on_failure_cb =
[&response](const string& endpoint_id, EndpointChannel* channel) {
[&response](const std::string& endpoint_id,
EndpointChannel* channel) {
response.client_status = Response::Status::kFailed;
response.latch.CountDown();
},