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

Unified Diff: chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc

Issue 526353002: Merge cryptohome::RetrievedKeyData with cryptohome::KeyDefinition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@d_2_367847_add_get_key_data_ex_to_mount_flow
Patch Set: Rebased. Created 6 years, 3 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 | « no previous file | chrome/browser/chromeos/login/supervised/supervised_user_creation_controller_new.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc
diff --git a/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc b/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc
index 7fd127e5d903adb992a21f659177848abfae7777..af1105910452e11b4179c5912f22dc59cd1ce46b 100644
--- a/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc
+++ b/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc
@@ -5,13 +5,13 @@
#include "chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.h"
#include <string>
+#include <vector>
#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/memory/scoped_ptr.h"
-#include "base/memory/scoped_vector.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/strings/string_util.h"
@@ -258,25 +258,22 @@ class CryptohomeAuthenticatorTest : public testing::Test {
void ExpectGetKeyDataExCall(scoped_ptr<int64> key_type,
scoped_ptr<std::string> salt) {
- key_data_.clear();
- key_data_.push_back(new cryptohome::RetrievedKeyData(
- cryptohome::RetrievedKeyData::TYPE_PASSWORD,
- kCryptohomeGAIAKeyLabel,
- 1));
- key_data_.front()->privileges = cryptohome::PRIV_DEFAULT;
- key_data_.front()->authorization_types.push_back(
- cryptohome::RetrievedKeyData::AUTHORIZATION_TYPE_HMACSHA256);
+ key_definitions_.clear();
+ key_definitions_.push_back(cryptohome::KeyDefinition(
+ std::string() /* secret */,
+ kCryptohomeGAIAKeyLabel,
+ cryptohome::PRIV_DEFAULT));
+ cryptohome::KeyDefinition& key_definition = key_definitions_.back();
+ key_definition.revision = 1;
if (key_type) {
- scoped_ptr<cryptohome::RetrievedKeyData::ProviderData> provider_data(
- new cryptohome::RetrievedKeyData::ProviderData("type"));
- provider_data->number = key_type.Pass();
- key_data_.front()->provider_data.push_back(provider_data.release());
+ key_definition.provider_data.push_back(
+ cryptohome::KeyDefinition::ProviderData("type"));
+ key_definition.provider_data.back().number = key_type.Pass();
}
if (salt) {
- scoped_ptr<cryptohome::RetrievedKeyData::ProviderData> provider_data(
- new cryptohome::RetrievedKeyData::ProviderData("salt"));
- provider_data->bytes = salt.Pass();
- key_data_.front()->provider_data.push_back(provider_data.release());
+ key_definition.provider_data.push_back(
+ cryptohome::KeyDefinition::ProviderData("salt"));
+ key_definition.provider_data.back().bytes = salt.Pass();
}
EXPECT_CALL(*mock_homedir_methods_, GetKeyDataEx(
cryptohome::Identification(user_context_.GetUserID()),
@@ -333,7 +330,7 @@ class CryptohomeAuthenticatorTest : public testing::Test {
UserContext user_context_with_transformed_key_;
Key transformed_key_;
- ScopedVector<cryptohome::RetrievedKeyData> key_data_;
+ std::vector<cryptohome::KeyDefinition> key_definitions_;
ScopedDeviceSettingsTestHelper device_settings_test_helper_;
ScopedTestCrosSettings test_cros_settings_;
@@ -359,7 +356,7 @@ class CryptohomeAuthenticatorTest : public testing::Test {
const cryptohome::HomedirMethods::GetKeyDataCallback& callback) {
callback.Run(true /* success */,
cryptohome::MOUNT_ERROR_NONE,
- key_data_.Pass());
+ key_definitions_);
}
};
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/supervised/supervised_user_creation_controller_new.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698