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

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

Issue 11037007: [Sync] Require ProfileSyncService to have an uninitialized backend on shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 &profile_, BuildHistoryService).get()); 178 &profile_, BuildHistoryService).get());
179 EXPECT_CALL((*history_service_), ScheduleDBTask(_, _)) 179 EXPECT_CALL((*history_service_), ScheduleDBTask(_, _))
180 .WillRepeatedly(RunTaskOnDBThread(&history_thread_, 180 .WillRepeatedly(RunTaskOnDBThread(&history_thread_,
181 history_backend_.get())); 181 history_backend_.get()));
182 history_thread_.Start(); 182 history_thread_.Start();
183 } 183 }
184 184
185 virtual void TearDown() { 185 virtual void TearDown() {
186 history_backend_ = NULL; 186 history_backend_ = NULL;
187 history_service_ = NULL; 187 history_service_ = NULL;
188 service_->Shutdown();
188 service_.reset(); 189 service_.reset();
189 history_thread_.Stop(); 190 history_thread_.Stop();
190 profile_.ResetRequestContext(); 191 profile_.ResetRequestContext();
191 AbstractProfileSyncServiceTest::TearDown(); 192 AbstractProfileSyncServiceTest::TearDown();
192 } 193 }
193 194
194 TypedUrlModelAssociator* StartSyncService(const base::Closure& callback) { 195 TypedUrlModelAssociator* StartSyncService(const base::Closure& callback) {
195 TypedUrlModelAssociator* model_associator = NULL; 196 TypedUrlModelAssociator* model_associator = NULL;
196 if (!service_.get()) { 197 if (!service_.get()) {
197 SigninManager* signin = SigninManagerFactory::GetForProfile(&profile_); 198 SigninManager* signin = SigninManagerFactory::GetForProfile(&profile_);
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 content::Details<history::URLsModifiedDetails>(&details)); 991 content::Details<history::URLsModifiedDetails>(&details));
991 992
992 history::URLRows new_sync_entries; 993 history::URLRows new_sync_entries;
993 GetTypedUrlsFromSyncDB(&new_sync_entries); 994 GetTypedUrlsFromSyncDB(&new_sync_entries);
994 995
995 // We should ignore the local file urls (existing and updated), 996 // We should ignore the local file urls (existing and updated),
996 // and only be left with the updated http url. 997 // and only be left with the updated http url.
997 ASSERT_EQ(1U, new_sync_entries.size()); 998 ASSERT_EQ(1U, new_sync_entries.size());
998 EXPECT_TRUE(URLsEqual(updated_url_entry, new_sync_entries[0])); 999 EXPECT_TRUE(URLsEqual(updated_url_entry, new_sync_entries[0]));
999 } 1000 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698