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

Unified Diff: sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc

Issue 11314008: sync: Follow-up to conflict resolution refactor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 8 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
Index: sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc
diff --git a/sync/sessions/session_state_unittest.cc b/sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc
similarity index 78%
rename from sync/sessions/session_state_unittest.cc
rename to sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc
index 92d4b6fc8957199b8fe7ca154901bbd2dc4390ef..842211f3b3ef1bb61fe83f2263737844820bb6a9 100644
--- a/sync/sessions/session_state_unittest.cc
+++ b/sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc
@@ -2,16 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "sync/sessions/session_state.h"
-
-#include <string>
+#include "sync/internal_api/public/sessions/sync_session_snapshot.h"
-#include "base/base64.h"
#include "base/memory/scoped_ptr.h"
#include "base/test/values_test_util.h"
-#include "base/time.h"
#include "base/values.h"
-#include "sync/internal_api/public/sessions/sync_session_snapshot.h"
#include "sync/internal_api/public/sessions/sync_source_info.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -25,26 +20,9 @@ using base::ExpectDictIntegerValue;
using base::ExpectDictListValue;
using base::ExpectDictStringValue;
-class SessionStateTest : public testing::Test {};
-
-TEST_F(SessionStateTest, SyncSourceInfoToValue) {
- sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source =
- sync_pb::GetUpdatesCallerInfo::PERIODIC;
- ModelTypeInvalidationMap types;
- types[PREFERENCES].payload = "preferencespayload";
- types[EXTENSIONS].payload = "";
- scoped_ptr<DictionaryValue> expected_types_value(
- ModelTypeInvalidationMapToValue(types));
-
- SyncSourceInfo source_info(updates_source, types);
-
- scoped_ptr<DictionaryValue> value(source_info.ToValue());
- EXPECT_EQ(2u, value->size());
- ExpectDictStringValue("PERIODIC", *value, "updatesSource");
- ExpectDictDictionaryValue(*expected_types_value, *value, "types");
-}
+class SyncSessionSnapshotTest : public testing::Test {};
-TEST_F(SessionStateTest, SyncSessionSnapshotToValue) {
+TEST_F(SyncSessionSnapshotTest, SyncSessionSnapshotToValue) {
ModelNeutralState model_neutral;
model_neutral.num_server_changes_remaining = 105;
model_neutral.num_successful_commits = 5;
@@ -67,11 +45,9 @@ TEST_F(SessionStateTest, SyncSessionSnapshotToValue) {
scoped_ptr<DictionaryValue> expected_download_progress_markers_value(
ProgressMarkerMapToValue(download_progress_markers));
- const bool kHasMoreToSync = false;
const bool kIsSilenced = true;
const int kNumEncryptionConflicts = 1054;
const int kNumHierarchyConflicts = 1055;
- const int kNumSimpleConflicts = 1056;
const int kNumServerConflicts = 1057;
SyncSourceInfo source;
@@ -81,18 +57,16 @@ TEST_F(SessionStateTest, SyncSessionSnapshotToValue) {
kIsShareUsable,
initial_sync_ended,
download_progress_markers,
- kHasMoreToSync,
kIsSilenced,
kNumEncryptionConflicts,
kNumHierarchyConflicts,
- kNumSimpleConflicts,
kNumServerConflicts,
source,
false,
0,
base::Time::Now());
scoped_ptr<DictionaryValue> value(snapshot.ToValue());
- EXPECT_EQ(20u, value->size());
+ EXPECT_EQ(18u, value->size());
ExpectDictIntegerValue(model_neutral.num_successful_commits,
*value, "numSuccessfulCommits");
ExpectDictIntegerValue(model_neutral.num_successful_bookmark_commits,
@@ -114,14 +88,11 @@ TEST_F(SessionStateTest, SyncSessionSnapshotToValue) {
"initialSyncEnded");
ExpectDictDictionaryValue(*expected_download_progress_markers_value,
*value, "downloadProgressMarkers");
- ExpectDictBooleanValue(kHasMoreToSync, *value, "hasMoreToSync");
ExpectDictBooleanValue(kIsSilenced, *value, "isSilenced");
ExpectDictIntegerValue(kNumEncryptionConflicts, *value,
"numEncryptionConflicts");
ExpectDictIntegerValue(kNumHierarchyConflicts, *value,
"numHierarchyConflicts");
- ExpectDictIntegerValue(kNumSimpleConflicts, *value,
- "numSimpleConflicts");
ExpectDictIntegerValue(kNumServerConflicts, *value,
"numServerConflicts");
ExpectDictDictionaryValue(*expected_source_value, *value, "source");

Powered by Google App Engine
This is Rietveld 408576698