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

Unified Diff: sync/sessions/test_util.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/sessions/test_util.h ('k') | sync/sync.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/test_util.cc
diff --git a/sync/sessions/test_util.cc b/sync/sessions/test_util.cc
deleted file mode 100644
index 2b7fa0d9a23590e71ad5c2a6cd0d48fe7277acb0..0000000000000000000000000000000000000000
--- a/sync/sessions/test_util.cc
+++ /dev/null
@@ -1,139 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "sync/sessions/test_util.h"
-
-#include <map>
-
-namespace syncer {
-namespace sessions {
-namespace test_util {
-
-void SimulateGetEncryptionKeyFailed(
- ModelTypeSet requsted_types,
- sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source,
- sessions::SyncSession* session) {
- session->mutable_status_controller()->set_last_get_key_result(
- SERVER_RESPONSE_VALIDATION_FAILED);
- session->mutable_status_controller()->set_last_download_updates_result(
- SYNCER_OK);
-}
-
-void SimulateConfigureSuccess(
- ModelTypeSet requsted_types,
- sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source,
- sessions::SyncSession* session) {
- session->mutable_status_controller()->set_last_get_key_result(SYNCER_OK);
- session->mutable_status_controller()->set_last_download_updates_result(
- SYNCER_OK);
-}
-
-void SimulateConfigureFailed(
- ModelTypeSet requsted_types,
- sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source,
- sessions::SyncSession* session) {
- session->mutable_status_controller()->set_last_get_key_result(SYNCER_OK);
- session->mutable_status_controller()->set_last_download_updates_result(
- SERVER_RETURN_TRANSIENT_ERROR);
-}
-
-void SimulateConfigureConnectionFailure(
- ModelTypeSet requsted_types,
- sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source,
- sessions::SyncSession* session) {
- session->mutable_status_controller()->set_last_get_key_result(SYNCER_OK);
- session->mutable_status_controller()->set_last_download_updates_result(
- NETWORK_CONNECTION_UNAVAILABLE);
-}
-
-void SimulateNormalSuccess(ModelTypeSet requested_types,
- sessions::NudgeTracker* nudge_tracker,
- sessions::SyncSession* session) {
- session->mutable_status_controller()->set_commit_result(SYNCER_OK);
- session->mutable_status_controller()->set_last_download_updates_result(
- SYNCER_OK);
-}
-
-void SimulateDownloadUpdatesFailed(ModelTypeSet requested_types,
- sessions::NudgeTracker* nudge_tracker,
- sessions::SyncSession* session) {
- session->mutable_status_controller()->set_last_download_updates_result(
- SERVER_RETURN_TRANSIENT_ERROR);
-}
-
-void SimulateCommitFailed(ModelTypeSet requested_types,
- sessions::NudgeTracker* nudge_tracker,
- sessions::SyncSession* session) {
- session->mutable_status_controller()->set_last_get_key_result(SYNCER_OK);
- session->mutable_status_controller()->set_last_download_updates_result(
- SYNCER_OK);
- session->mutable_status_controller()->set_commit_result(
- SERVER_RETURN_TRANSIENT_ERROR);
-}
-
-void SimulateConnectionFailure(ModelTypeSet requested_types,
- sessions::NudgeTracker* nudge_tracker,
- sessions::SyncSession* session) {
- session->mutable_status_controller()->set_last_download_updates_result(
- NETWORK_CONNECTION_UNAVAILABLE);
-}
-
-void SimulatePollSuccess(ModelTypeSet requested_types,
- sessions::SyncSession* session) {
- session->mutable_status_controller()->set_last_download_updates_result(
- SYNCER_OK);
-}
-
-void SimulatePollFailed(ModelTypeSet requested_types,
- sessions::SyncSession* session) {
- session->mutable_status_controller()->set_last_download_updates_result(
- SERVER_RETURN_TRANSIENT_ERROR);
-}
-
-void SimulateThrottledImpl(
- sessions::SyncSession* session,
- const base::TimeDelta& delta) {
- session->mutable_status_controller()->set_last_download_updates_result(
- SERVER_RETURN_THROTTLED);
- session->delegate()->OnThrottled(delta);
-}
-
-void SimulateTypesThrottledImpl(
- sessions::SyncSession* session,
- ModelTypeSet types,
- const base::TimeDelta& delta) {
- session->mutable_status_controller()->set_last_download_updates_result(
- SERVER_RETURN_THROTTLED);
- session->delegate()->OnTypesThrottled(types, delta);
-}
-
-void SimulatePollIntervalUpdateImpl(
- ModelTypeSet requested_types,
- sessions::SyncSession* session,
- const base::TimeDelta& new_poll) {
- SimulatePollSuccess(requested_types, session);
- session->delegate()->OnReceivedLongPollIntervalUpdate(new_poll);
-}
-
-void SimulateSessionsCommitDelayUpdateImpl(
- ModelTypeSet requested_types,
- sessions::NudgeTracker* nudge_tracker,
- sessions::SyncSession* session,
- const base::TimeDelta& new_delay) {
- SimulateNormalSuccess(requested_types, nudge_tracker, session);
- std::map<ModelType, base::TimeDelta> delay_map;
- delay_map[SESSIONS] = new_delay;
- session->delegate()->OnReceivedCustomNudgeDelays(delay_map);
-}
-
-void SimulateGuRetryDelayCommandImpl(sessions::SyncSession* session,
- base::TimeDelta delay) {
- session->mutable_status_controller()->set_last_download_updates_result(
- SYNCER_OK);
- session->delegate()->OnReceivedGuRetryDelay(delay);
-}
-
-} // namespace test_util
-} // namespace sessions
-} // namespace syncer
« no previous file with comments | « sync/sessions/test_util.h ('k') | sync/sync.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698