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

Side by Side Diff: chrome/browser/sync/js/js_sync_manager_observer_unittest.cc

Issue 7649006: more changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix another typo Created 9 years, 4 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/js/js_sync_manager_observer.h" 5 #include "chrome/browser/sync/js/js_sync_manager_observer.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 TEST_F(JsSyncManagerObserverTest, OnEncryptionComplete) { 201 TEST_F(JsSyncManagerObserverTest, OnEncryptionComplete) {
202 DictionaryValue expected_details; 202 DictionaryValue expected_details;
203 ListValue* encrypted_type_values = new ListValue(); 203 ListValue* encrypted_type_values = new ListValue();
204 expected_details.Set("encryptedTypes", encrypted_type_values); 204 expected_details.Set("encryptedTypes", encrypted_type_values);
205 syncable::ModelTypeSet encrypted_types; 205 syncable::ModelTypeSet encrypted_types;
206 206
207 for (int i = syncable::FIRST_REAL_MODEL_TYPE; 207 for (int i = syncable::FIRST_REAL_MODEL_TYPE;
208 i < syncable::MODEL_TYPE_COUNT; ++i) { 208 i < syncable::MODEL_TYPE_COUNT; ++i) {
209 syncable::ModelType type = syncable::ModelTypeFromInt(i); 209 syncable::ModelType type = syncable::ModelTypeFromInt(i);
210 encrypted_types.insert(type); 210 encrypted_types.insert(type);
211 encrypted_type_values->Append(Value::CreateStringValue( 211 encrypted_type_values->Append(base::StringValue::New(
212 syncable::ModelTypeToString(type))); 212 syncable::ModelTypeToString(type)));
213 } 213 }
214 214
215 EXPECT_CALL(mock_js_event_handler_, 215 EXPECT_CALL(mock_js_event_handler_,
216 HandleJsEvent("onEncryptionComplete", 216 HandleJsEvent("onEncryptionComplete",
217 HasDetailsAsDictionary(expected_details))); 217 HasDetailsAsDictionary(expected_details)));
218 218
219 js_sync_manager_observer_.OnEncryptionComplete(encrypted_types); 219 js_sync_manager_observer_.OnEncryptionComplete(encrypted_types);
220 PumpLoop(); 220 PumpLoop();
221 } 221 }
222 222
223 TEST_F(JsSyncManagerObserverTest, OnMigrationNeededForTypes) { 223 TEST_F(JsSyncManagerObserverTest, OnMigrationNeededForTypes) {
224 DictionaryValue expected_details; 224 DictionaryValue expected_details;
225 ListValue* type_values = new ListValue(); 225 ListValue* type_values = new ListValue();
226 expected_details.Set("types", type_values); 226 expected_details.Set("types", type_values);
227 syncable::ModelTypeSet types; 227 syncable::ModelTypeSet types;
228 228
229 for (int i = syncable::FIRST_REAL_MODEL_TYPE; 229 for (int i = syncable::FIRST_REAL_MODEL_TYPE;
230 i < syncable::MODEL_TYPE_COUNT; ++i) { 230 i < syncable::MODEL_TYPE_COUNT; ++i) {
231 syncable::ModelType type = syncable::ModelTypeFromInt(i); 231 syncable::ModelType type = syncable::ModelTypeFromInt(i);
232 types.insert(type); 232 types.insert(type);
233 type_values->Append(Value::CreateStringValue( 233 type_values->Append(base::StringValue::New(
234 syncable::ModelTypeToString(type))); 234 syncable::ModelTypeToString(type)));
235 } 235 }
236 236
237 EXPECT_CALL(mock_js_event_handler_, 237 EXPECT_CALL(mock_js_event_handler_,
238 HandleJsEvent("onMigrationNeededForTypes", 238 HandleJsEvent("onMigrationNeededForTypes",
239 HasDetailsAsDictionary(expected_details))); 239 HasDetailsAsDictionary(expected_details)));
240 240
241 js_sync_manager_observer_.OnMigrationNeededForTypes(types); 241 js_sync_manager_observer_.OnMigrationNeededForTypes(types);
242 PumpLoop(); 242 PumpLoop();
243 } 243 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 &trans, &changes[i], 326 &trans, &changes[i],
327 syncable::MODEL_TYPE_COUNT - i); 327 syncable::MODEL_TYPE_COUNT - i);
328 } 328 }
329 329
330 test_user_share.TearDown(); 330 test_user_share.TearDown();
331 PumpLoop(); 331 PumpLoop();
332 } 332 }
333 333
334 } // namespace 334 } // namespace
335 } // namespace browser_sync 335 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/js/js_arg_list_unittest.cc ('k') | chrome/browser/sync/profile_sync_service_preference_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698