| Index: sync/test/engine/mock_connection_manager.h
|
| diff --git a/sync/test/engine/mock_connection_manager.h b/sync/test/engine/mock_connection_manager.h
|
| index a2b50601c76441c5b63e1bbc93470154688149ac..f603de103f42b93d0401d37036904ca569f5a902 100644
|
| --- a/sync/test/engine/mock_connection_manager.h
|
| +++ b/sync/test/engine/mock_connection_manager.h
|
| @@ -117,25 +117,11 @@ class MockConnectionManager : public browser_sync::ServerConnectionManager {
|
| // issue multiple requests during a sync cycle.
|
| void NextUpdateBatch();
|
|
|
| - void FailNextPostBufferToPathCall() { fail_next_postbuffer_ = true; }
|
| + void FailNextPostBufferToPathCall() { countdown_to_postbuffer_fail_ = 1; }
|
| + void FailNthPostBufferToPathCall(int n) { countdown_to_postbuffer_fail_ = n; }
|
|
|
| void SetClearUserDataResponseStatus(sync_pb::SyncEnums::ErrorType errortype);
|
|
|
| - // A visitor class to allow a test to change some monitoring state atomically
|
| - // with the action of overriding the response codes sent back to the Syncer
|
| - // (for example, so you can say "ThrottleNextRequest, and assert no more
|
| - // requests are made once throttling is in effect" in one step.
|
| - class ResponseCodeOverrideRequestor {
|
| - public:
|
| - // Called with response_code_override_lock_ acquired.
|
| - virtual void OnOverrideComplete() = 0;
|
| -
|
| - protected:
|
| - virtual ~ResponseCodeOverrideRequestor() {}
|
| - };
|
| - void ThrottleNextRequest(ResponseCodeOverrideRequestor* visitor);
|
| - void FailWithAuthInvalid(ResponseCodeOverrideRequestor* visitor);
|
| - void StopFailingWithAuthInvalid(ResponseCodeOverrideRequestor* visitor);
|
| void FailNonPeriodicGetUpdates() { fail_non_periodic_get_updates_ = true; }
|
|
|
| // Simple inspectors.
|
| @@ -222,6 +208,11 @@ class MockConnectionManager : public browser_sync::ServerConnectionManager {
|
| return store_birthday_;
|
| }
|
|
|
| + // Explicitly indicate that we will not be fetching some updates.
|
| + void ClearUpdatesQueue() {
|
| + update_queue_.clear();
|
| + }
|
| +
|
| // Locate the most recent update message for purpose of alteration.
|
| sync_pb::SyncEntity* GetMutableLastUpdate();
|
|
|
| @@ -299,8 +290,9 @@ class MockConnectionManager : public browser_sync::ServerConnectionManager {
|
| bool client_stuck_;
|
| std::string commit_time_rename_prepended_string_;
|
|
|
| - // Fail on the next call to PostBufferToPath().
|
| - bool fail_next_postbuffer_;
|
| + // On each PostBufferToPath() call, we decrement this counter. The call fails
|
| + // iff we hit zero at that call.
|
| + int countdown_to_postbuffer_fail_;
|
|
|
| // Our directory. Used only to ensure that we are not holding the transaction
|
| // lock when performing network I/O. Can be NULL if the test author is
|
|
|