0

Code health: port away from deprecated DictionaryValue::HasKey in /remoting/protocol

This is a portion for /remoting/protocol.
(And in some cases also adjust away from other deprecated Value APIs,
 when convenient/nearby)

This CL was uploaded by git cl split.

R=garykac@chromium.org

Bug: 1187060
Change-Id: Ieccb846393b93b8a0d2f11ba75caedd6f6685500
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3366702
Auto-Submit: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Commit-Queue: Gary Kacmarcik <garykac@chromium.org>
Cr-Commit-Position: refs/heads/main@{#955916}
This commit is contained in:
Maks Orlovich
2022-01-05 22:15:06 +00:00
committed by Chromium LUCI CQ
parent f98de021ae
commit 0859f8609c

@ -49,13 +49,15 @@ class MockPairingRegistryCallbacks {
// any shared secret.
void VerifyPairing(PairingRegistry::Pairing expected,
const base::DictionaryValue& actual) {
std::string value;
EXPECT_TRUE(actual.GetString(PairingRegistry::kClientNameKey, &value));
EXPECT_EQ(expected.client_name(), value);
EXPECT_TRUE(actual.GetString(PairingRegistry::kClientIdKey, &value));
EXPECT_EQ(expected.client_id(), value);
const std::string* value =
actual.FindStringKey(PairingRegistry::kClientNameKey);
ASSERT_TRUE(value);
EXPECT_EQ(expected.client_name(), *value);
value = actual.FindStringKey(PairingRegistry::kClientIdKey);
ASSERT_TRUE(value);
EXPECT_EQ(expected.client_id(), *value);
EXPECT_FALSE(actual.HasKey(PairingRegistry::kSharedSecretKey));
EXPECT_FALSE(actual.FindKey(PairingRegistry::kSharedSecretKey));
}
} // namespace