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

Unified Diff: components/cryptauth/cryptauth_enroller_impl_unittest.cc

Issue 2502343003: Moved //components/proximity_auth/cryptauth to //components/cryptauth. (Closed)
Patch Set: Fixed proto #includes. Created 4 years, 1 month 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
Index: components/cryptauth/cryptauth_enroller_impl_unittest.cc
diff --git a/components/proximity_auth/cryptauth/cryptauth_enroller_impl_unittest.cc b/components/cryptauth/cryptauth_enroller_impl_unittest.cc
similarity index 89%
rename from components/proximity_auth/cryptauth/cryptauth_enroller_impl_unittest.cc
rename to components/cryptauth/cryptauth_enroller_impl_unittest.cc
index b4a42be77f8b50893d3580074b96e2311a85e7e1..5e65fc4f3828af270ef71efc71ec85f28c453e5d 100644
--- a/components/proximity_auth/cryptauth/cryptauth_enroller_impl_unittest.cc
+++ b/components/cryptauth/cryptauth_enroller_impl_unittest.cc
@@ -2,20 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/proximity_auth/cryptauth/cryptauth_enroller_impl.h"
+#include "components/cryptauth/cryptauth_enroller_impl.h"
#include "base/bind.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
-#include "components/proximity_auth/cryptauth/cryptauth_enrollment_utils.h"
-#include "components/proximity_auth/cryptauth/fake_secure_message_delegate.h"
-#include "components/proximity_auth/cryptauth/mock_cryptauth_client.h"
+#include "components/cryptauth/cryptauth_enrollment_utils.h"
+#include "components/cryptauth/fake_secure_message_delegate.h"
+#include "components/cryptauth/mock_cryptauth_client.h"
#include "testing/gtest/include/gtest/gtest.h"
using ::testing::_;
using ::testing::Return;
-namespace proximity_auth {
+namespace cryptauth {
namespace {
@@ -98,11 +98,11 @@ void SaveUnwrapResults(bool* verified_out,
} // namespace
-class ProximityAuthCryptAuthEnrollerTest
+class CryptAuthEnrollerTest
: public testing::Test,
public MockCryptAuthClientFactory::Observer {
public:
- ProximityAuthCryptAuthEnrollerTest()
+ CryptAuthEnrollerTest()
: client_factory_(new MockCryptAuthClientFactory(
MockCryptAuthClientFactory::MockType::MAKE_NICE_MOCKS)),
secure_message_delegate_(new FakeSecureMessageDelegate()),
@@ -112,7 +112,7 @@ class ProximityAuthCryptAuthEnrollerTest
// This call is actually synchronous.
secure_message_delegate_->GenerateKeyPair(
- base::Bind(&ProximityAuthCryptAuthEnrollerTest::OnKeyPairGenerated,
+ base::Bind(&CryptAuthEnrollerTest::OnKeyPairGenerated,
base::Unretained(this)));
}
@@ -122,7 +122,7 @@ class ProximityAuthCryptAuthEnrollerTest
enroller_result_.reset();
enroller_.Enroll(
user_public_key_, user_private_key_, device_info, kInvocationReason,
- base::Bind(&ProximityAuthCryptAuthEnrollerTest::OnEnrollerCompleted,
+ base::Bind(&CryptAuthEnrollerTest::OnEnrollerCompleted,
base::Unretained(this)));
}
@@ -188,11 +188,11 @@ class ProximityAuthCryptAuthEnrollerTest
void OnCryptAuthClientCreated(MockCryptAuthClient* client) override {
ON_CALL(*client, SetupEnrollment(_, _, _))
.WillByDefault(Invoke(
- this, &ProximityAuthCryptAuthEnrollerTest::OnSetupEnrollment));
+ this, &CryptAuthEnrollerTest::OnSetupEnrollment));
ON_CALL(*client, FinishEnrollment(_, _, _))
.WillByDefault(Invoke(
- this, &ProximityAuthCryptAuthEnrollerTest::OnFinishEnrollment));
+ this, &CryptAuthEnrollerTest::OnFinishEnrollment));
ON_CALL(*client, GetAccessTokenUsed())
.WillByDefault(Return(kAccessTokenUsed));
@@ -259,10 +259,10 @@ class ProximityAuthCryptAuthEnrollerTest
CryptAuthClient::FinishEnrollmentCallback finish_callback_;
CryptAuthClient::ErrorCallback error_callback_;
- DISALLOW_COPY_AND_ASSIGN(ProximityAuthCryptAuthEnrollerTest);
+ DISALLOW_COPY_AND_ASSIGN(CryptAuthEnrollerTest);
};
-TEST_F(ProximityAuthCryptAuthEnrollerTest, EnrollmentSucceeds) {
+TEST_F(CryptAuthEnrollerTest, EnrollmentSucceeds) {
StartEnroller(GetDeviceInfo());
// Handle SetupEnrollment request.
@@ -287,7 +287,7 @@ TEST_F(ProximityAuthCryptAuthEnrollerTest, EnrollmentSucceeds) {
EXPECT_TRUE(*enroller_result_);
}
-TEST_F(ProximityAuthCryptAuthEnrollerTest, SetupEnrollmentApiCallError) {
+TEST_F(CryptAuthEnrollerTest, SetupEnrollmentApiCallError) {
StartEnroller(GetDeviceInfo());
EXPECT_TRUE(setup_request_.get());
@@ -299,7 +299,7 @@ TEST_F(ProximityAuthCryptAuthEnrollerTest, SetupEnrollmentApiCallError) {
EXPECT_FALSE(*enroller_result_);
}
-TEST_F(ProximityAuthCryptAuthEnrollerTest, SetupEnrollmentBadStatus) {
+TEST_F(CryptAuthEnrollerTest, SetupEnrollmentBadStatus) {
StartEnroller(GetDeviceInfo());
EXPECT_TRUE(setup_request_.get());
@@ -310,7 +310,7 @@ TEST_F(ProximityAuthCryptAuthEnrollerTest, SetupEnrollmentBadStatus) {
EXPECT_FALSE(*enroller_result_);
}
-TEST_F(ProximityAuthCryptAuthEnrollerTest, SetupEnrollmentNoInfosReturned) {
+TEST_F(CryptAuthEnrollerTest, SetupEnrollmentNoInfosReturned) {
StartEnroller(GetDeviceInfo());
EXPECT_TRUE(setup_request_.get());
cryptauth::SetupEnrollmentResponse response;
@@ -322,7 +322,7 @@ TEST_F(ProximityAuthCryptAuthEnrollerTest, SetupEnrollmentNoInfosReturned) {
EXPECT_FALSE(*enroller_result_);
}
-TEST_F(ProximityAuthCryptAuthEnrollerTest, FinishEnrollmentApiCallError) {
+TEST_F(CryptAuthEnrollerTest, FinishEnrollmentApiCallError) {
StartEnroller(GetDeviceInfo());
setup_callback_.Run(GetSetupEnrollmentResponse(true));
ASSERT_FALSE(error_callback_.is_null());
@@ -331,7 +331,7 @@ TEST_F(ProximityAuthCryptAuthEnrollerTest, FinishEnrollmentApiCallError) {
EXPECT_FALSE(*enroller_result_);
}
-TEST_F(ProximityAuthCryptAuthEnrollerTest, FinishEnrollmentBadStatus) {
+TEST_F(CryptAuthEnrollerTest, FinishEnrollmentBadStatus) {
StartEnroller(GetDeviceInfo());
setup_callback_.Run(GetSetupEnrollmentResponse(true));
ASSERT_FALSE(finish_callback_.is_null());
@@ -340,7 +340,7 @@ TEST_F(ProximityAuthCryptAuthEnrollerTest, FinishEnrollmentBadStatus) {
EXPECT_FALSE(*enroller_result_);
}
-TEST_F(ProximityAuthCryptAuthEnrollerTest, ReuseEnroller) {
+TEST_F(CryptAuthEnrollerTest, ReuseEnroller) {
StartEnroller(GetDeviceInfo());
setup_callback_.Run(GetSetupEnrollmentResponse(true));
finish_callback_.Run(GetFinishEnrollmentResponse(true));
@@ -350,10 +350,10 @@ TEST_F(ProximityAuthCryptAuthEnrollerTest, ReuseEnroller) {
EXPECT_FALSE(*enroller_result_);
}
-TEST_F(ProximityAuthCryptAuthEnrollerTest, IncompleteDeviceInfo) {
+TEST_F(CryptAuthEnrollerTest, IncompleteDeviceInfo) {
StartEnroller(cryptauth::GcmDeviceInfo());
ASSERT_TRUE(enroller_result_.get());
EXPECT_FALSE(*enroller_result_);
}
-} // namespace proximity_auth
+} // namespace cryptauth
« no previous file with comments | « components/cryptauth/cryptauth_enroller_impl.cc ('k') | components/cryptauth/cryptauth_enrollment_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698