Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Unified Diff: components/cryptauth/cryptauth_device_manager_unittest.cc

Issue 2611913002: Tweak CryptauthDeviceManager to store fetched BeaconSeed data in Base64URL encoding, and retrieve i… (Closed)
Patch Set: Fixing a comment. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/cryptauth/cryptauth_device_manager.cc ('k') | components/cryptauth/eid_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cryptauth/cryptauth_device_manager_unittest.cc
diff --git a/components/cryptauth/cryptauth_device_manager_unittest.cc b/components/cryptauth/cryptauth_device_manager_unittest.cc
index 1cdf1fae37dae2f8a485f6f3688031256d6b6645..0870113282486a77ada6ab2f85e73a0bece10aeb 100644
--- a/components/cryptauth/cryptauth_device_manager_unittest.cc
+++ b/components/cryptauth/cryptauth_device_manager_unittest.cc
@@ -258,13 +258,17 @@ void ExpectSyncedDevicesAndPrefAreEqual(
const base::DictionaryValue* seed;
ASSERT_TRUE(beacon_seeds_from_prefs->GetDictionary(i, &seed));
- std::string data, start_ms, end_ms;
- EXPECT_TRUE(seed->GetString("beacon_seed_data", &data));
+ std::string data_b64, start_ms, end_ms;
+ EXPECT_TRUE(seed->GetString("beacon_seed_data", &data_b64));
EXPECT_TRUE(seed->GetString("beacon_seed_start_ms", &start_ms));
EXPECT_TRUE(seed->GetString("beacon_seed_end_ms", &end_ms));
const cryptauth::BeaconSeed& expected_seed =
expected_device.beacon_seeds((int) i);
+
+ std::string data;
+ EXPECT_TRUE(base::Base64UrlDecode(
+ data_b64, base::Base64UrlDecodePolicy::REQUIRE_PADDING, &data));
EXPECT_TRUE(expected_seed.has_data());
EXPECT_EQ(expected_seed.data(), data);
« no previous file with comments | « components/cryptauth/cryptauth_device_manager.cc ('k') | components/cryptauth/eid_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698