diff options
author | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-17 00:19:04 +0000 |
---|---|---|
committer | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-17 00:19:04 +0000 |
commit | 3e61b482c65dab5e3e1fce1c79c6318f21a7c006 (patch) | |
tree | e25484eb55257c362c0284f4b18f38fcbbd78792 /sync/sessions | |
parent | 6fa507fa08768cc01533150e04f7f88408cc8cfd (diff) | |
download | chromium_src-3e61b482c65dab5e3e1fce1c79c6318f21a7c006.zip chromium_src-3e61b482c65dab5e3e1fce1c79c6318f21a7c006.tar.gz chromium_src-3e61b482c65dab5e3e1fce1c79c6318f21a7c006.tar.bz2 |
Trim code form sync's ServerConnectionManager
- Remove 'authenticated' from SyncManager::Status. This variable was
set to true iff the last attempt to contact the sync server resulted in
a 200 OK response. There are lots of problems with this approach.
See also: crbug.com/117611.
The about:sync page also displays auth errors with
MakeSyncAuthErrorText(), which is much more likely to be accurate
- Remove server_up from SyncManager::Status. It used to be set to true
iff the last server response was SERVER_CONNECTION_OK. That doesn't
make a lot of sense and isn't very useful.
- Remove server_reachable from SyncManager::Status. This was toggled
only when ServerConnectionManager::CheckServerReachable() failed, which
didn't happen very often. CheckServerReachable() has since been
removed, so I think it now gets set only at startup and on the first
successful contact with the server.
- Remove server_reachable from ServerConnectionEvent and
ServerConnectionManager, for similar reasons.
- Remove the methods CheckTime(), IsServerReachable(),
IsUserAuthenticated(), and CheckServerReachable(),
SetServerParameters(), server_reachable() from ServerConnectionManager.
These methods were not used anywhere. Also removed
IsGoodReplyFromServer(), whose last remaining callsite has been removed
in this commit.
- Remove the server_connection_ok_ flag from SyncScheduler.
- Hard-code AllStatus' online status to true. See TODO comment.
- Remove OnCredentialsUpdated() and OnConnectionStatusChange() from
SyncScheduler. Their functionality has been moved to the SyncManager.
- Rearrange some code in MockConnectionManager. Apparently there used
to be such a thing as an "AUTHENTICATE" request, which we had unit tests
for. That no longer exists, so I've rewritten some parts of this mock
class to better relfect ServerConnectionManager's current authentication
mechanisms.
- Update various unit tests in response to these changes.
- Update some integration tests to verify backoff behaviour when the
sync server is unreachable. This replaces the old behaviour of
verifying that certain flags were set in the sync snapshot.
- Reduce the number of retries required to verify backoff. This is to
help ensure that our integration tests fall within the 45s time limit.
- Disable notifications when disabling network connectivity in
integration tests. This improves the reliability of exponential backoff
verification because the notifications would sometimes interfere with
backoff logic.
BUG=110954,105739,98346,106262
TEST=
Review URL: http://codereview.chromium.org/9348036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127310 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/sessions')
-rw-r--r-- | sync/sessions/test_util.cc | 6 | ||||
-rw-r--r-- | sync/sessions/test_util.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/sync/sessions/test_util.cc b/sync/sessions/test_util.cc index 7e9b54b..387dbf6 100644 --- a/sync/sessions/test_util.cc +++ b/sync/sessions/test_util.cc @@ -26,6 +26,12 @@ void SimulateCommitFailed(sessions::SyncSession* session, SERVER_RETURN_TRANSIENT_ERROR); } +void SimulateConnectionFailure(sessions::SyncSession* session, + SyncerStep begin, SyncerStep end) { + session->mutable_status_controller()->set_last_download_updates_result( + NETWORK_CONNECTION_UNAVAILABLE); +} + void SimulateSuccess(sessions::SyncSession* session, SyncerStep begin, SyncerStep end) { if (session->HasMoreToSync()) { diff --git a/sync/sessions/test_util.h b/sync/sessions/test_util.h index b8ecf8f..aad02e2 100644 --- a/sync/sessions/test_util.h +++ b/sync/sessions/test_util.h @@ -22,6 +22,8 @@ void SimulateDownloadUpdatesFailed(sessions::SyncSession* session, SyncerStep begin, SyncerStep end); void SimulateCommitFailed(sessions::SyncSession* session, SyncerStep begin, SyncerStep end); +void SimulateConnectionFailure(sessions::SyncSession* session, + SyncerStep begin, SyncerStep end); void SimulateSuccess(sessions::SyncSession* session, SyncerStep begin, SyncerStep end); void SimulateThrottledImpl(sessions::SyncSession* session, |