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

Side by Side Diff: chrome/browser/sync/profile_sync_service_typed_url_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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) 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 <vector> 5 #include <vector>
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 &model_associator)); 223 &model_associator));
224 EXPECT_CALL(*components, CreateDataTypeManager(_, _, _, _, _)). 224 EXPECT_CALL(*components, CreateDataTypeManager(_, _, _, _, _)).
225 WillOnce(ReturnNewDataTypeManager()); 225 WillOnce(ReturnNewDataTypeManager());
226 226
227 token_service_->IssueAuthTokenForTest( 227 token_service_->IssueAuthTokenForTest(
228 GaiaConstants::kSyncService, "token"); 228 GaiaConstants::kSyncService, "token");
229 229
230 sync_service_->RegisterDataTypeController(data_type_controller); 230 sync_service_->RegisterDataTypeController(data_type_controller);
231 231
232 sync_service_->Initialize(); 232 sync_service_->Initialize();
233 MessageLoop::current()->Run(); 233 base::MessageLoop::current()->Run();
234 } 234 }
235 return model_associator; 235 return model_associator;
236 } 236 }
237 237
238 void GetTypedUrlsFromSyncDB(history::URLRows* urls) { 238 void GetTypedUrlsFromSyncDB(history::URLRows* urls) {
239 urls->clear(); 239 urls->clear();
240 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); 240 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare());
241 syncer::ReadNode typed_url_root(&trans); 241 syncer::ReadNode typed_url_root(&trans);
242 if (typed_url_root.InitByTagLookup(browser_sync::kTypedUrlTag) != 242 if (typed_url_root.InitByTagLookup(browser_sync::kTypedUrlTag) !=
243 syncer::BaseNode::INIT_OK) 243 syncer::BaseNode::INIT_OK)
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 content::Source<Profile>(&profile_), 1043 content::Source<Profile>(&profile_),
1044 content::Details<history::URLsModifiedDetails>(&details)); 1044 content::Details<history::URLsModifiedDetails>(&details));
1045 1045
1046 history::URLRows new_sync_entries; 1046 history::URLRows new_sync_entries;
1047 GetTypedUrlsFromSyncDB(&new_sync_entries); 1047 GetTypedUrlsFromSyncDB(&new_sync_entries);
1048 1048
1049 // We should ignore the localhost urls and left only with http url. 1049 // We should ignore the localhost urls and left only with http url.
1050 ASSERT_EQ(1U, new_sync_entries.size()); 1050 ASSERT_EQ(1U, new_sync_entries.size());
1051 EXPECT_TRUE(URLsEqual(updated_url_entry, new_sync_entries[0])); 1051 EXPECT_TRUE(URLsEqual(updated_url_entry, new_sync_entries[0]));
1052 } 1052 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_startup_unittest.cc ('k') | chrome/browser/sync/profile_sync_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698