| Index: components/cryptauth/cryptauth_api_call_flow_unittest.cc
|
| diff --git a/components/proximity_auth/cryptauth/cryptauth_api_call_flow_unittest.cc b/components/cryptauth/cryptauth_api_call_flow_unittest.cc
|
| similarity index 86%
|
| rename from components/proximity_auth/cryptauth/cryptauth_api_call_flow_unittest.cc
|
| rename to components/cryptauth/cryptauth_api_call_flow_unittest.cc
|
| index 0fff019a57baaedea381e5287555536b6ff2cf07..cbc6701e4f881dde46ea3a2d05f5c51feadd4040 100644
|
| --- a/components/proximity_auth/cryptauth/cryptauth_api_call_flow_unittest.cc
|
| +++ b/components/cryptauth/cryptauth_api_call_flow_unittest.cc
|
| @@ -2,7 +2,7 @@
|
| // 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_api_call_flow.h"
|
| +#include "components/cryptauth/cryptauth_api_call_flow.h"
|
|
|
| #include <memory>
|
|
|
| @@ -14,7 +14,7 @@
|
| #include "net/url_request/url_request_test_util.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| -namespace proximity_auth {
|
| +namespace cryptauth {
|
|
|
| namespace {
|
|
|
| @@ -24,11 +24,11 @@ const char kRequestUrl[] = "https://googleapis.com/cryptauth/test";
|
|
|
| } // namespace
|
|
|
| -class ProximityAuthCryptAuthApiCallFlowTest
|
| +class CryptAuthApiCallFlowTest
|
| : public testing::Test,
|
| public net::TestURLFetcherDelegateForTests {
|
| protected:
|
| - ProximityAuthCryptAuthApiCallFlowTest()
|
| + CryptAuthApiCallFlowTest()
|
| : url_request_context_getter_(new net::TestURLRequestContextGetter(
|
| new base::TestSimpleTaskRunner())) {}
|
|
|
| @@ -46,9 +46,9 @@ class ProximityAuthCryptAuthApiCallFlowTest
|
| void StartApiCallFlowWithRequest(const std::string& serialized_request) {
|
| flow_.Start(GURL(kRequestUrl), url_request_context_getter_.get(),
|
| "access_token", serialized_request,
|
| - base::Bind(&ProximityAuthCryptAuthApiCallFlowTest::OnResult,
|
| + base::Bind(&CryptAuthApiCallFlowTest::OnResult,
|
| base::Unretained(this)),
|
| - base::Bind(&ProximityAuthCryptAuthApiCallFlowTest::OnError,
|
| + base::Bind(&CryptAuthApiCallFlowTest::OnError,
|
| base::Unretained(this)));
|
| // URLFetcher object for the API request should be created.
|
| CheckCryptAuthHttpRequest(serialized_request);
|
| @@ -109,24 +109,24 @@ class ProximityAuthCryptAuthApiCallFlowTest
|
| std::unique_ptr<net::TestURLFetcherFactory> url_fetcher_factory_;
|
| CryptAuthApiCallFlow flow_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(ProximityAuthCryptAuthApiCallFlowTest);
|
| + DISALLOW_COPY_AND_ASSIGN(CryptAuthApiCallFlowTest);
|
| };
|
|
|
| -TEST_F(ProximityAuthCryptAuthApiCallFlowTest, RequestSuccess) {
|
| +TEST_F(CryptAuthApiCallFlowTest, RequestSuccess) {
|
| StartApiCallFlow();
|
| CompleteCurrentRequest(net::OK, net::HTTP_OK, kSerializedResponseProto);
|
| EXPECT_EQ(kSerializedResponseProto, *result_);
|
| EXPECT_FALSE(error_message_);
|
| }
|
|
|
| -TEST_F(ProximityAuthCryptAuthApiCallFlowTest, RequestFailure) {
|
| +TEST_F(CryptAuthApiCallFlowTest, RequestFailure) {
|
| StartApiCallFlow();
|
| CompleteCurrentRequest(net::ERR_FAILED, 0, std::string());
|
| EXPECT_FALSE(result_);
|
| EXPECT_EQ("Request failed", *error_message_);
|
| }
|
|
|
| -TEST_F(ProximityAuthCryptAuthApiCallFlowTest, RequestStatus500) {
|
| +TEST_F(CryptAuthApiCallFlowTest, RequestStatus500) {
|
| StartApiCallFlow();
|
| CompleteCurrentRequest(net::OK, net::HTTP_INTERNAL_SERVER_ERROR,
|
| "CryptAuth Meltdown.");
|
| @@ -135,7 +135,7 @@ TEST_F(ProximityAuthCryptAuthApiCallFlowTest, RequestStatus500) {
|
| }
|
|
|
| // The empty string is a valid protocol buffer message serialization.
|
| -TEST_F(ProximityAuthCryptAuthApiCallFlowTest, RequestWithNoBody) {
|
| +TEST_F(CryptAuthApiCallFlowTest, RequestWithNoBody) {
|
| StartApiCallFlowWithRequest(std::string());
|
| CompleteCurrentRequest(net::OK, net::HTTP_OK, kSerializedResponseProto);
|
| EXPECT_EQ(kSerializedResponseProto, *result_);
|
| @@ -143,11 +143,11 @@ TEST_F(ProximityAuthCryptAuthApiCallFlowTest, RequestWithNoBody) {
|
| }
|
|
|
| // The empty string is a valid protocol buffer message serialization.
|
| -TEST_F(ProximityAuthCryptAuthApiCallFlowTest, ResponseWithNoBody) {
|
| +TEST_F(CryptAuthApiCallFlowTest, ResponseWithNoBody) {
|
| StartApiCallFlow();
|
| CompleteCurrentRequest(net::OK, net::HTTP_OK, std::string());
|
| EXPECT_EQ(std::string(), *result_);
|
| EXPECT_FALSE(error_message_);
|
| }
|
|
|
| -} // namespace proximity_auth
|
| +} // namespace cryptauth
|
|
|