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

Side by Side Diff: sync/sessions/session_state_unittest.cc

Issue 10795018: [Sync] Remove unneeded 'using syncer::' lines and 'syncer::' scopings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fiix indent Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/sessions/ordered_commit_set_unittest.cc ('k') | sync/sessions/status_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/sessions/session_state.h" 5 #include "sync/sessions/session_state.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 12 matching lines...) Expand all
23 using base::ExpectDictDictionaryValue; 23 using base::ExpectDictDictionaryValue;
24 using base::ExpectDictIntegerValue; 24 using base::ExpectDictIntegerValue;
25 using base::ExpectDictListValue; 25 using base::ExpectDictListValue;
26 using base::ExpectDictStringValue; 26 using base::ExpectDictStringValue;
27 27
28 class SessionStateTest : public testing::Test {}; 28 class SessionStateTest : public testing::Test {};
29 29
30 TEST_F(SessionStateTest, SyncSourceInfoToValue) { 30 TEST_F(SessionStateTest, SyncSourceInfoToValue) {
31 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source = 31 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source =
32 sync_pb::GetUpdatesCallerInfo::PERIODIC; 32 sync_pb::GetUpdatesCallerInfo::PERIODIC;
33 syncer::ModelTypePayloadMap types; 33 ModelTypePayloadMap types;
34 types[syncer::PREFERENCES] = "preferencespayload"; 34 types[PREFERENCES] = "preferencespayload";
35 types[syncer::EXTENSIONS] = ""; 35 types[EXTENSIONS] = "";
36 scoped_ptr<DictionaryValue> expected_types_value( 36 scoped_ptr<DictionaryValue> expected_types_value(
37 syncer::ModelTypePayloadMapToValue(types)); 37 ModelTypePayloadMapToValue(types));
38 38
39 SyncSourceInfo source_info(updates_source, types); 39 SyncSourceInfo source_info(updates_source, types);
40 40
41 scoped_ptr<DictionaryValue> value(source_info.ToValue()); 41 scoped_ptr<DictionaryValue> value(source_info.ToValue());
42 EXPECT_EQ(2u, value->size()); 42 EXPECT_EQ(2u, value->size());
43 ExpectDictStringValue("PERIODIC", *value, "updatesSource"); 43 ExpectDictStringValue("PERIODIC", *value, "updatesSource");
44 ExpectDictDictionaryValue(*expected_types_value, *value, "types"); 44 ExpectDictDictionaryValue(*expected_types_value, *value, "types");
45 } 45 }
46 46
47 TEST_F(SessionStateTest, SyncSessionSnapshotToValue) { 47 TEST_F(SessionStateTest, SyncSessionSnapshotToValue) {
48 ModelNeutralState model_neutral; 48 ModelNeutralState model_neutral;
49 model_neutral.num_server_changes_remaining = 105; 49 model_neutral.num_server_changes_remaining = 105;
50 model_neutral.num_successful_commits = 5; 50 model_neutral.num_successful_commits = 5;
51 model_neutral.num_successful_bookmark_commits = 10; 51 model_neutral.num_successful_bookmark_commits = 10;
52 model_neutral.num_updates_downloaded_total = 100; 52 model_neutral.num_updates_downloaded_total = 100;
53 model_neutral.num_tombstone_updates_downloaded_total = 200; 53 model_neutral.num_tombstone_updates_downloaded_total = 200;
54 model_neutral.num_reflected_updates_downloaded_total = 50; 54 model_neutral.num_reflected_updates_downloaded_total = 50;
55 model_neutral.num_local_overwrites = 15; 55 model_neutral.num_local_overwrites = 15;
56 model_neutral.num_server_overwrites = 18; 56 model_neutral.num_server_overwrites = 18;
57 57
58 const bool kIsShareUsable = true; 58 const bool kIsShareUsable = true;
59 59
60 const syncer::ModelTypeSet initial_sync_ended( 60 const ModelTypeSet initial_sync_ended(BOOKMARKS, PREFERENCES);
61 syncer::BOOKMARKS, syncer::PREFERENCES);
62 scoped_ptr<ListValue> expected_initial_sync_ended_value( 61 scoped_ptr<ListValue> expected_initial_sync_ended_value(
63 syncer::ModelTypeSetToValue(initial_sync_ended)); 62 ModelTypeSetToValue(initial_sync_ended));
64 63
65 syncer::ModelTypePayloadMap download_progress_markers; 64 ModelTypePayloadMap download_progress_markers;
66 download_progress_markers[syncer::BOOKMARKS] = "test"; 65 download_progress_markers[BOOKMARKS] = "test";
67 download_progress_markers[syncer::APPS] = "apps"; 66 download_progress_markers[APPS] = "apps";
68 scoped_ptr<DictionaryValue> expected_download_progress_markers_value( 67 scoped_ptr<DictionaryValue> expected_download_progress_markers_value(
69 syncer::ModelTypePayloadMapToValue(download_progress_markers)); 68 ModelTypePayloadMapToValue(download_progress_markers));
70 69
71 const bool kHasMoreToSync = false; 70 const bool kHasMoreToSync = false;
72 const bool kIsSilenced = true; 71 const bool kIsSilenced = true;
73 const int kNumEncryptionConflicts = 1054; 72 const int kNumEncryptionConflicts = 1054;
74 const int kNumHierarchyConflicts = 1055; 73 const int kNumHierarchyConflicts = 1055;
75 const int kNumSimpleConflicts = 1056; 74 const int kNumSimpleConflicts = 1056;
76 const int kNumServerConflicts = 1057; 75 const int kNumServerConflicts = 1057;
77 76
78 SyncSourceInfo source; 77 SyncSourceInfo source;
79 scoped_ptr<DictionaryValue> expected_source_value(source.ToValue()); 78 scoped_ptr<DictionaryValue> expected_source_value(source.ToValue());
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 "numSimpleConflicts"); 125 "numSimpleConflicts");
127 ExpectDictIntegerValue(kNumServerConflicts, *value, 126 ExpectDictIntegerValue(kNumServerConflicts, *value,
128 "numServerConflicts"); 127 "numServerConflicts");
129 ExpectDictDictionaryValue(*expected_source_value, *value, "source"); 128 ExpectDictDictionaryValue(*expected_source_value, *value, "source");
130 ExpectDictBooleanValue(false, *value, "notificationsEnabled"); 129 ExpectDictBooleanValue(false, *value, "notificationsEnabled");
131 } 130 }
132 131
133 } // namespace 132 } // namespace
134 } // namespace sessions 133 } // namespace sessions
135 } // namespace syncer 134 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/sessions/ordered_commit_set_unittest.cc ('k') | sync/sessions/status_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698