OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/cryptauth/cryptauth_client_impl.h" | 5 #include "components/cryptauth/cryptauth_client_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/test/null_task_runner.h" | 10 #include "base/test/null_task_runner.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 access_token_ = access_token; | 56 access_token_ = access_token; |
57 }; | 57 }; |
58 | 58 |
59 private: | 59 private: |
60 std::string access_token_; | 60 std::string access_token_; |
61 }; | 61 }; |
62 | 62 |
63 // Mock CryptAuthApiCallFlow, which handles the HTTP requests to CryptAuth. | 63 // Mock CryptAuthApiCallFlow, which handles the HTTP requests to CryptAuth. |
64 class MockCryptAuthApiCallFlow : public CryptAuthApiCallFlow { | 64 class MockCryptAuthApiCallFlow : public CryptAuthApiCallFlow { |
65 public: | 65 public: |
66 MockCryptAuthApiCallFlow() : CryptAuthApiCallFlow() {} | 66 MockCryptAuthApiCallFlow() : CryptAuthApiCallFlow() { |
| 67 SetPartialNetworkTrafficAnnotation(PARTIAL_TRAFFIC_ANNOTATION_FOR_TESTS); |
| 68 } |
67 virtual ~MockCryptAuthApiCallFlow() {} | 69 virtual ~MockCryptAuthApiCallFlow() {} |
68 | 70 |
69 MOCK_METHOD6(Start, | 71 MOCK_METHOD6(Start, |
70 void(const GURL&, | 72 void(const GURL&, |
71 net::URLRequestContextGetter* context, | 73 net::URLRequestContextGetter* context, |
72 const std::string& access_token, | 74 const std::string& access_token, |
73 const std::string& serialized_request, | 75 const std::string& serialized_request, |
74 const ResultCallback& result_callback, | 76 const ResultCallback& result_callback, |
75 const ErrorCallback& error_callback)); | 77 const ErrorCallback& error_callback)); |
76 | 78 |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 GetMyDevicesRequest request_proto; | 555 GetMyDevicesRequest request_proto; |
554 request_proto.set_allow_stale_read(true); | 556 request_proto.set_allow_stale_read(true); |
555 client_->GetMyDevices( | 557 client_->GetMyDevices( |
556 request_proto, | 558 request_proto, |
557 base::Bind(&SaveResult<GetMyDevicesResponse>, &result_proto), | 559 base::Bind(&SaveResult<GetMyDevicesResponse>, &result_proto), |
558 base::Bind(&NotCalled<std::string>)); | 560 base::Bind(&NotCalled<std::string>)); |
559 EXPECT_EQ(kAccessToken, client_->GetAccessTokenUsed()); | 561 EXPECT_EQ(kAccessToken, client_->GetAccessTokenUsed()); |
560 } | 562 } |
561 | 563 |
562 } // namespace cryptauth | 564 } // namespace cryptauth |
OLD | NEW |