OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "sync/internal_api/public/sessions/sync_session_snapshot.h" | 5 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/test/values_test_util.h" | 8 #include "base/test/values_test_util.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "sync/internal_api/public/sessions/sync_source_info.h" | 10 #include "sync/internal_api/public/sessions/sync_source_info.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 model_neutral.num_successful_bookmark_commits = 10; | 29 model_neutral.num_successful_bookmark_commits = 10; |
30 model_neutral.num_updates_downloaded_total = 100; | 30 model_neutral.num_updates_downloaded_total = 100; |
31 model_neutral.num_tombstone_updates_downloaded_total = 200; | 31 model_neutral.num_tombstone_updates_downloaded_total = 200; |
32 model_neutral.num_reflected_updates_downloaded_total = 50; | 32 model_neutral.num_reflected_updates_downloaded_total = 50; |
33 model_neutral.num_local_overwrites = 15; | 33 model_neutral.num_local_overwrites = 15; |
34 model_neutral.num_server_overwrites = 18; | 34 model_neutral.num_server_overwrites = 18; |
35 | 35 |
36 ProgressMarkerMap download_progress_markers; | 36 ProgressMarkerMap download_progress_markers; |
37 download_progress_markers[BOOKMARKS] = "test"; | 37 download_progress_markers[BOOKMARKS] = "test"; |
38 download_progress_markers[APPS] = "apps"; | 38 download_progress_markers[APPS] = "apps"; |
39 scoped_ptr<DictionaryValue> expected_download_progress_markers_value( | 39 scoped_ptr<base::DictionaryValue> expected_download_progress_markers_value( |
40 ProgressMarkerMapToValue(download_progress_markers)); | 40 ProgressMarkerMapToValue(download_progress_markers)); |
41 | 41 |
42 const bool kIsSilenced = true; | 42 const bool kIsSilenced = true; |
43 const int kNumEncryptionConflicts = 1054; | 43 const int kNumEncryptionConflicts = 1054; |
44 const int kNumHierarchyConflicts = 1055; | 44 const int kNumHierarchyConflicts = 1055; |
45 const int kNumServerConflicts = 1057; | 45 const int kNumServerConflicts = 1057; |
46 | 46 |
47 SyncSourceInfo source; | 47 SyncSourceInfo source; |
48 scoped_ptr<DictionaryValue> expected_source_value(source.ToValue()); | 48 scoped_ptr<base::DictionaryValue> expected_source_value(source.ToValue()); |
49 | 49 |
50 SyncSessionSnapshot snapshot(model_neutral, | 50 SyncSessionSnapshot snapshot(model_neutral, |
51 download_progress_markers, | 51 download_progress_markers, |
52 kIsSilenced, | 52 kIsSilenced, |
53 kNumEncryptionConflicts, | 53 kNumEncryptionConflicts, |
54 kNumHierarchyConflicts, | 54 kNumHierarchyConflicts, |
55 kNumServerConflicts, | 55 kNumServerConflicts, |
56 source, | 56 source, |
57 false, | 57 false, |
58 0, | 58 0, |
59 base::Time::Now(), | 59 base::Time::Now(), |
60 std::vector<int>(MODEL_TYPE_COUNT,0), | 60 std::vector<int>(MODEL_TYPE_COUNT,0), |
61 std::vector<int>(MODEL_TYPE_COUNT, 0)); | 61 std::vector<int>(MODEL_TYPE_COUNT, 0)); |
62 scoped_ptr<DictionaryValue> value(snapshot.ToValue()); | 62 scoped_ptr<base::DictionaryValue> value(snapshot.ToValue()); |
63 EXPECT_EQ(17u, value->size()); | 63 EXPECT_EQ(17u, value->size()); |
64 ExpectDictIntegerValue(model_neutral.num_successful_commits, | 64 ExpectDictIntegerValue(model_neutral.num_successful_commits, |
65 *value, "numSuccessfulCommits"); | 65 *value, "numSuccessfulCommits"); |
66 ExpectDictIntegerValue(model_neutral.num_successful_bookmark_commits, | 66 ExpectDictIntegerValue(model_neutral.num_successful_bookmark_commits, |
67 *value, "numSuccessfulBookmarkCommits"); | 67 *value, "numSuccessfulBookmarkCommits"); |
68 ExpectDictIntegerValue(model_neutral.num_updates_downloaded_total, | 68 ExpectDictIntegerValue(model_neutral.num_updates_downloaded_total, |
69 *value, "numUpdatesDownloadedTotal"); | 69 *value, "numUpdatesDownloadedTotal"); |
70 ExpectDictIntegerValue(model_neutral.num_tombstone_updates_downloaded_total, | 70 ExpectDictIntegerValue(model_neutral.num_tombstone_updates_downloaded_total, |
71 *value, "numTombstoneUpdatesDownloadedTotal"); | 71 *value, "numTombstoneUpdatesDownloadedTotal"); |
72 ExpectDictIntegerValue(model_neutral.num_reflected_updates_downloaded_total, | 72 ExpectDictIntegerValue(model_neutral.num_reflected_updates_downloaded_total, |
(...skipping 13 matching lines...) Expand all Loading... |
86 "numHierarchyConflicts"); | 86 "numHierarchyConflicts"); |
87 ExpectDictIntegerValue(kNumServerConflicts, *value, | 87 ExpectDictIntegerValue(kNumServerConflicts, *value, |
88 "numServerConflicts"); | 88 "numServerConflicts"); |
89 ExpectDictDictionaryValue(*expected_source_value, *value, "source"); | 89 ExpectDictDictionaryValue(*expected_source_value, *value, "source"); |
90 ExpectDictBooleanValue(false, *value, "notificationsEnabled"); | 90 ExpectDictBooleanValue(false, *value, "notificationsEnabled"); |
91 } | 91 } |
92 | 92 |
93 } // namespace | 93 } // namespace |
94 } // namespace sessions | 94 } // namespace sessions |
95 } // namespace syncer | 95 } // namespace syncer |
OLD | NEW |