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

Side by Side Diff: remoting/test/fake_refresh_token_store.h

Issue 1237883002: Added chromoting test environment for the tests to share data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unittest, display connection stats ability, and error check for transition delay. Created 5 years, 5 months 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 unified diff | Download patch
« no previous file with comments | « remoting/test/fake_host_list_fetcher.cc ('k') | remoting/test/fake_refresh_token_store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« no previous file with comments | « remoting/test/fake_host_list_fetcher.cc ('k') | remoting/test/fake_refresh_token_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698