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

Side by Side Diff: chrome/browser/sync/profile_sync_service_password_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/location.h" 10 #include "base/location.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 virtual void SetUp() { 150 virtual void SetUp() {
151 AbstractProfileSyncServiceTest::SetUp(); 151 AbstractProfileSyncServiceTest::SetUp();
152 profile_.CreateRequestContext(); 152 profile_.CreateRequestContext();
153 password_store_ = static_cast<MockPasswordStore*>( 153 password_store_ = static_cast<MockPasswordStore*>(
154 PasswordStoreFactory::GetInstance()->SetTestingFactoryAndUse( 154 PasswordStoreFactory::GetInstance()->SetTestingFactoryAndUse(
155 &profile_, MockPasswordStore::Build).get()); 155 &profile_, MockPasswordStore::Build).get());
156 } 156 }
157 157
158 virtual void TearDown() { 158 virtual void TearDown() {
159 password_store_->ShutdownOnUIThread(); 159 password_store_->ShutdownOnUIThread();
160 service_->Shutdown();
160 service_.reset(); 161 service_.reset();
161 profile_.ResetRequestContext(); 162 profile_.ResetRequestContext();
162 AbstractProfileSyncServiceTest::TearDown(); 163 AbstractProfileSyncServiceTest::TearDown();
163 } 164 }
164 165
165 static void SignalEvent(base::WaitableEvent* done) { 166 static void SignalEvent(base::WaitableEvent* done) {
166 done->Signal(); 167 done->Signal();
167 } 168 }
168 169
169 void FlushLastDBTask() { 170 void FlushLastDBTask() {
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 CreateRootHelper create_root(this, syncer::PASSWORDS); 564 CreateRootHelper create_root(this, syncer::PASSWORDS);
564 StartSyncService(create_root.callback(), 565 StartSyncService(create_root.callback(),
565 base::Bind(&AddPasswordEntriesCallback, this, sync_forms)); 566 base::Bind(&AddPasswordEntriesCallback, this, sync_forms));
566 567
567 std::vector<PasswordForm> new_sync_forms; 568 std::vector<PasswordForm> new_sync_forms;
568 GetPasswordEntriesFromSyncDB(&new_sync_forms); 569 GetPasswordEntriesFromSyncDB(&new_sync_forms);
569 570
570 EXPECT_EQ(1U, new_sync_forms.size()); 571 EXPECT_EQ(1U, new_sync_forms.size());
571 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); 572 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0]));
572 } 573 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698