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.
5 #ifndef REMOTING_TEST_FAKE_REFRESH_TOKEN_STORE_H_
6 #define REMOTING_TEST_FAKE_REFRESH_TOKEN_STORE_H_
8 #include "remoting/test/refresh_token_store.h"
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
{
17 FakeRefreshTokenStore();
18 ~FakeRefreshTokenStore() override
;
20 // RefreshTokenStore interface.
21 std::string
FetchRefreshToken() override
;
22 bool StoreRefreshToken(const std::string
& refresh_token
) override
;
24 bool refresh_token_write_attempted() const {
25 return refresh_token_write_attempted_
;
28 const std::string
& stored_refresh_token_value() const {
29 return stored_refresh_token_value_
;
32 void set_refresh_token_value(const std::string
& new_token_value
) {
33 refresh_token_value_
= new_token_value
;
36 void set_refresh_token_write_succeeded(bool write_succeeded
) {
37 refresh_token_write_succeeded_
= write_succeeded
;
41 // Control members used to return specific data to the caller.
42 std::string refresh_token_value_
;
43 bool refresh_token_write_succeeded_
;
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_
;
49 DISALLOW_COPY_AND_ASSIGN(FakeRefreshTokenStore
);
53 } // namespace remoting
55 #endif // REMOTING_TEST_FAKE_REFRESH_TOKEN_STORE_H_