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

Unified Diff: chrome/browser/sync/test/integration/sync_exponential_backoff_test.cc

Issue 642613002: Use Sync FakeServer in exponential backoff tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | chrome/browser/sync/test/integration/sync_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/test/integration/sync_exponential_backoff_test.cc
diff --git a/chrome/browser/sync/test/integration/sync_exponential_backoff_test.cc b/chrome/browser/sync/test/integration/sync_exponential_backoff_test.cc
index ee3cca3b6593c5b5691c1e9fd08b98e8748ade11..52737fa23c36be985e0dd435213143d6876eedc1 100644
--- a/chrome/browser/sync/test/integration/sync_exponential_backoff_test.cc
+++ b/chrome/browser/sync/test/integration/sync_exponential_backoff_test.cc
@@ -20,9 +20,7 @@ using sync_integration_test_util::AwaitCommitActivityCompletion;
class SyncExponentialBackoffTest : public SyncTest {
public:
- // TODO(pvalenzuela): Switch to SINGLE_CLIENT once FakeServer
- // supports this scenario.
- SyncExponentialBackoffTest() : SyncTest(SINGLE_CLIENT_LEGACY) {}
+ SyncExponentialBackoffTest() : SyncTest(SINGLE_CLIENT) {}
virtual ~SyncExponentialBackoffTest() {}
private:
@@ -70,8 +68,7 @@ IN_PROC_BROWSER_TEST_F(SyncExponentialBackoffTest, OfflineToOnline) {
ASSERT_TRUE(AddFolder(0, 0, "folder1"));
ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0))));
- // Trigger a network error at the client side.
- DisableNetwork(GetProfile(0));
+ GetFakeServer()->DisableNetwork();
// Add a new item to trigger another sync cycle.
ASSERT_TRUE(AddFolder(0, 0, "folder2"));
@@ -83,8 +80,7 @@ IN_PROC_BROWSER_TEST_F(SyncExponentialBackoffTest, OfflineToOnline) {
exponential_backoff_checker.Wait();
ASSERT_FALSE(exponential_backoff_checker.TimedOut());
- // Recover from the network error.
- EnableNetwork(GetProfile(0));
+ GetFakeServer()->EnableNetwork();
// Verify that sync was able to recover.
ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0))));
@@ -98,8 +94,7 @@ IN_PROC_BROWSER_TEST_F(SyncExponentialBackoffTest, TransientErrorTest) {
ASSERT_TRUE(AddFolder(0, 0, "folder1"));
ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0))));
- // Trigger a transient error on the server.
- TriggerTransientError();
+ GetFakeServer()->TriggerError(sync_pb::SyncEnums::TRANSIENT_ERROR);
// Add a new item to trigger another sync cycle.
ASSERT_TRUE(AddFolder(0, 0, "folder2"));
« no previous file with comments | « no previous file | chrome/browser/sync/test/integration/sync_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698