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

Side by Side Diff: chrome/browser/sync/engine/download_updates_command_unittest.cc

Issue 2844037: Fix handling of undeletion within the syncer. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Whitespace. Created 10 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/engine/download_updates_command.h" 5 #include "chrome/browser/sync/engine/download_updates_command.h"
6 #include "chrome/browser/sync/protocol/autofill_specifics.pb.h" 6 #include "chrome/browser/sync/protocol/autofill_specifics.pb.h"
7 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" 7 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h"
8 #include "chrome/browser/sync/protocol/preference_specifics.pb.h" 8 #include "chrome/browser/sync/protocol/preference_specifics.pb.h"
9 #include "chrome/browser/sync/protocol/sync.pb.h" 9 #include "chrome/browser/sync/protocol/sync.pb.h"
10 #include "chrome/browser/sync/syncable/directory_manager.h" 10 #include "chrome/browser/sync/syncable/directory_manager.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 << "," << k << ")"); 104 << "," << k << ")");
105 mutable_routing_info()->clear(); 105 mutable_routing_info()->clear();
106 (*mutable_routing_info())[type_i] = browser_sync::GROUP_UI; 106 (*mutable_routing_info())[type_i] = browser_sync::GROUP_UI;
107 (*mutable_routing_info())[type_j] = browser_sync::GROUP_DB; 107 (*mutable_routing_info())[type_j] = browser_sync::GROUP_DB;
108 (*mutable_routing_info())[type_k] = browser_sync::GROUP_UI; 108 (*mutable_routing_info())[type_k] = browser_sync::GROUP_UI;
109 dir->set_last_download_timestamp(type_i, 5000 + j); 109 dir->set_last_download_timestamp(type_i, 5000 + j);
110 dir->set_last_download_timestamp(type_j, 1000 + i); 110 dir->set_last_download_timestamp(type_j, 1000 + i);
111 dir->set_last_download_timestamp(type_k, 1000 + i); 111 dir->set_last_download_timestamp(type_k, 1000 + i);
112 112
113 ConfigureMockServerConnection(); 113 ConfigureMockServerConnection();
114 dir->set_store_birthday(mock_server()->store_birthday());
115
114 syncable::ModelTypeBitSet expected_request_types; 116 syncable::ModelTypeBitSet expected_request_types;
115 expected_request_types[j] = true; 117 expected_request_types[j] = true;
116 expected_request_types[k] = true; 118 expected_request_types[k] = true;
117 mock_server()->ExpectGetUpdatesRequestTypes(expected_request_types); 119 mock_server()->ExpectGetUpdatesRequestTypes(expected_request_types);
118 120
119 command_.Execute(session()); 121 command_.Execute(session());
120 122
121 const sync_pb::ClientToServerMessage& r = mock_server()->last_request(); 123 const sync_pb::ClientToServerMessage& r = mock_server()->last_request();
122 EXPECT_EQ(1, mock_server()->GetAndClearNumGetUpdatesRequests()); 124 EXPECT_EQ(1, mock_server()->GetAndClearNumGetUpdatesRequests());
123 EXPECT_TRUE(r.has_get_updates()); 125 EXPECT_TRUE(r.has_get_updates());
124 EXPECT_TRUE(r.get_updates().has_from_timestamp()); 126 EXPECT_TRUE(r.get_updates().has_from_timestamp());
125 EXPECT_EQ(1000 + i, r.get_updates().from_timestamp()); 127 EXPECT_EQ(1000 + i, r.get_updates().from_timestamp());
126 EXPECT_TRUE(r.get_updates().has_fetch_folders()); 128 EXPECT_TRUE(r.get_updates().has_fetch_folders());
127 EXPECT_TRUE(r.get_updates().fetch_folders()); 129 EXPECT_TRUE(r.get_updates().fetch_folders());
128 EXPECT_TRUE(r.get_updates().has_requested_types()); 130 EXPECT_TRUE(r.get_updates().has_requested_types());
129 } 131 }
130 } 132 }
131 } 133 }
132 } 134 }
133 135
134 } // namespace browser_sync 136 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/download_updates_command.cc ('k') | chrome/browser/sync/engine/post_commit_message_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698