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

Side by Side Diff: sync/test/fake_server/fake_server.h

Issue 310103004: Add integraton test for sync backup/rollback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « sync/engine/sync_scheduler_impl.cc ('k') | sync/test/fake_server/fake_server.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef SYNC_TEST_FAKE_SERVER_FAKE_SERVER_H_ 5 #ifndef SYNC_TEST_FAKE_SERVER_FAKE_SERVER_H_
6 #define SYNC_TEST_FAKE_SERVER_FAKE_SERVER_H_ 6 #define SYNC_TEST_FAKE_SERVER_FAKE_SERVER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 bool SetNewStoreBirthday(const std::string& store_birthday); 63 bool SetNewStoreBirthday(const std::string& store_birthday);
64 64
65 // Puts the server in a state where it acts as if authentication has 65 // Puts the server in a state where it acts as if authentication has
66 // succeeded. 66 // succeeded.
67 void SetAuthenticated(); 67 void SetAuthenticated();
68 68
69 // Puts the server in a state where all commands will fail with an 69 // Puts the server in a state where all commands will fail with an
70 // authentication error. 70 // authentication error.
71 void SetUnauthenticated(); 71 void SetUnauthenticated();
72 72
73 // Return |error_type| on next sync request.
74 void TriggerError(const sync_pb::SyncEnums::ErrorType& error_type);
75
73 // Adds |observer| to FakeServer's observer list. This should be called 76 // Adds |observer| to FakeServer's observer list. This should be called
74 // before the Profile associated with |observer| is connected to the server. 77 // before the Profile associated with |observer| is connected to the server.
75 void AddObserver(Observer* observer); 78 void AddObserver(Observer* observer);
76 79
77 // Removes |observer| from the FakeServer's observer list. This method 80 // Removes |observer| from the FakeServer's observer list. This method
78 // must be called if AddObserver was ever called with |observer|. 81 // must be called if AddObserver was ever called with |observer|.
79 void RemoveObserver(Observer* observer); 82 void RemoveObserver(Observer* observer);
80 83
81 private: 84 private:
82 typedef std::map<std::string, FakeServerEntity*> EntityMap; 85 typedef std::map<std::string, FakeServerEntity*> EntityMap;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // authenticated. 138 // authenticated.
136 bool authenticated_; 139 bool authenticated_;
137 140
138 // All SyncEntity objects saved by the server. The key value is the entity's 141 // All SyncEntity objects saved by the server. The key value is the entity's
139 // id string. 142 // id string.
140 EntityMap entities_; 143 EntityMap entities_;
141 144
142 // All Keystore keys known to the server. 145 // All Keystore keys known to the server.
143 std::vector<std::string> keystore_keys_; 146 std::vector<std::string> keystore_keys_;
144 147
148 sync_pb::SyncEnums::ErrorType error_type_;
149
145 // FakeServer's observers. 150 // FakeServer's observers.
146 ObserverList<Observer, true> observers_; 151 ObserverList<Observer, true> observers_;
147 }; 152 };
148 153
149 } // namespace fake_server 154 } // namespace fake_server
150 155
151 #endif // SYNC_TEST_FAKE_SERVER_FAKE_SERVER_H_ 156 #endif // SYNC_TEST_FAKE_SERVER_FAKE_SERVER_H_
OLDNEW
« no previous file with comments | « sync/engine/sync_scheduler_impl.cc ('k') | sync/test/fake_server/fake_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698