OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_TEST_FAKE_REFRESH_TOKEN_STORE_H_ |
| 6 #define REMOTING_TEST_FAKE_REFRESH_TOKEN_STORE_H_ |
| 7 |
| 8 #include "remoting/test/refresh_token_store.h" |
| 9 |
| 10 namespace remoting { |
| 11 namespace test { |
| 12 |
| 13 // Stubs out the file API and returns fake data so we can remove |
| 14 // file system dependencies when testing the TestDriverEnvironment. |
| 15 class FakeRefreshTokenStore : public RefreshTokenStore { |
| 16 public: |
| 17 FakeRefreshTokenStore(); |
| 18 ~FakeRefreshTokenStore() override; |
| 19 |
| 20 // RefreshTokenStore interface. |
| 21 std::string FetchRefreshToken() override; |
| 22 bool StoreRefreshToken(const std::string& refresh_token) override; |
| 23 |
| 24 bool refresh_token_write_attempted() const { |
| 25 return refresh_token_write_attempted_; |
| 26 } |
| 27 |
| 28 const std::string& stored_refresh_token_value() const { |
| 29 return stored_refresh_token_value_; |
| 30 } |
| 31 |
| 32 void set_refresh_token_value(const std::string& new_token_value) { |
| 33 refresh_token_value_ = new_token_value; |
| 34 } |
| 35 |
| 36 void set_refresh_token_write_succeeded(bool write_succeeded) { |
| 37 refresh_token_write_succeeded_ = write_succeeded; |
| 38 } |
| 39 |
| 40 private: |
| 41 // Control members used to return specific data to the caller. |
| 42 std::string refresh_token_value_; |
| 43 bool refresh_token_write_succeeded_; |
| 44 |
| 45 // Verification members to observe the value of the data being written. |
| 46 bool refresh_token_write_attempted_; |
| 47 std::string stored_refresh_token_value_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(FakeRefreshTokenStore); |
| 50 }; |
| 51 |
| 52 } // namespace test |
| 53 } // namespace remoting |
| 54 |
| 55 #endif // REMOTING_TEST_FAKE_REFRESH_TOKEN_STORE_H_ |
OLD | NEW |