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

Side by Side Diff: chrome/browser/sync/sessions/status_controller_unittest.cc

Issue 9158004: Detect sync server communication errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update for review comments Created 8 years, 11 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "chrome/browser/sync/sessions/sync_session.h" 5 #include "chrome/browser/sync/sessions/sync_session.h"
6 #include "chrome/browser/sync/test/engine/test_id_factory.h" 6 #include "chrome/browser/sync/test/engine/test_id_factory.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace browser_sync { 9 namespace browser_sync {
10 namespace sessions { 10 namespace sessions {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 EXPECT_EQ(13, status.num_server_changes_remaining()); 123 EXPECT_EQ(13, status.num_server_changes_remaining());
124 124
125 EXPECT_FALSE(status.syncer_status().invalid_store); 125 EXPECT_FALSE(status.syncer_status().invalid_store);
126 status.set_invalid_store(true); 126 status.set_invalid_store(true);
127 EXPECT_TRUE(status.syncer_status().invalid_store); 127 EXPECT_TRUE(status.syncer_status().invalid_store);
128 128
129 EXPECT_FALSE(status.syncer_status().syncer_stuck); 129 EXPECT_FALSE(status.syncer_status().syncer_stuck);
130 status.set_syncer_stuck(true); 130 status.set_syncer_stuck(true);
131 EXPECT_TRUE(status.syncer_status().syncer_stuck); 131 EXPECT_TRUE(status.syncer_status().syncer_stuck);
132 132
133 status.set_last_download_updates_result(SYNCER_OK);
134 EXPECT_EQ(SYNCER_OK, status.error().last_download_updates_result);
135
136 status.set_last_post_commit_result(SYNC_AUTH_ERROR);
137 EXPECT_EQ(SYNC_AUTH_ERROR, status.error().last_post_commit_result);
138
139 status.set_last_process_commit_response_result(SYNC_SERVER_ERROR);
140 EXPECT_EQ(SYNC_SERVER_ERROR,
141 status.error().last_process_commit_response_result);
142
133 for (int i = 0; i < 14; i++) 143 for (int i = 0; i < 14; i++)
134 status.increment_num_successful_commits(); 144 status.increment_num_successful_commits();
135 EXPECT_EQ(14, status.syncer_status().num_successful_commits); 145 EXPECT_EQ(14, status.syncer_status().num_successful_commits);
136 146
137 std::vector<int64> v; 147 std::vector<int64> v;
138 v.push_back(16); 148 v.push_back(16);
139 status.set_unsynced_handles(v); 149 status.set_unsynced_handles(v);
140 EXPECT_EQ(16, v[0]); 150 EXPECT_EQ(16, v[0]);
141 } 151 }
142 152
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 status.num_server_changes_remaining(); 219 status.num_server_changes_remaining();
210 status.commit_ids(); 220 status.commit_ids();
211 status.HasBookmarkCommitActivity(); 221 status.HasBookmarkCommitActivity();
212 status.download_updates_succeeded(); 222 status.download_updates_succeeded();
213 status.ServerSaysNothingMoreToDownload(); 223 status.ServerSaysNothingMoreToDownload();
214 status.group_restriction(); 224 status.group_restriction();
215 } 225 }
216 226
217 } // namespace sessions 227 } // namespace sessions
218 } // namespace browser_sync 228 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/sessions/status_controller.cc ('k') | chrome/browser/sync/sessions/sync_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698