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

Side by Side Diff: chrome/test/live_sync/live_passwords_sync_test.cc

Issue 6902101: Refactor sync passphrase setup flow and fix passphrase tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 9 years, 7 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/test/live_sync/live_passwords_sync_test.h" 5 #include "chrome/test/live_sync/live_passwords_sync_test.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/synchronization/waitable_event.h" 8 #include "base/synchronization/waitable_event.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/password_manager/password_store_consumer.h" 10 #include "chrome/browser/password_manager/password_store_consumer.h"
11 #include "chrome/browser/password_manager/password_store.h" 11 #include "chrome/browser/password_manager/password_store.h"
12 #include "chrome/browser/sync/profile_sync_service_harness.h" 12 #include "chrome/browser/sync/profile_sync_service_harness.h"
13 #include "chrome/test/ui_test_utils.h" 13 #include "chrome/test/ui_test_utils.h"
14 #include "content/browser/browser_thread.h" 14 #include "content/browser/browser_thread.h"
15 15
16 using webkit_glue::PasswordForm; 16 using webkit_glue::PasswordForm;
17 17
18 const std::string kFakeSignonRealm = "http://fake-domain.google.com/"; 18 const std::string kFakeSignonRealm = "http://fake-signon-realm.google.com/";
19 19
20 // We use a WaitableEvent to wait on AddLogin instead of running the UI message 20 // We use a WaitableEvent to wait on AddLogin instead of running the UI message
21 // loop because of a restriction that prevents a DB thread from initiating a 21 // loop because of a restriction that prevents a DB thread from initiating a
22 // quit of the UI message loop. 22 // quit of the UI message loop.
23 void PasswordStoreCallback(base::WaitableEvent* wait_event) { 23 void PasswordStoreCallback(base::WaitableEvent* wait_event) {
24 // Wake up LivePasswordsSyncTest::AddLogin. 24 // Wake up LivePasswordsSyncTest::AddLogin.
25 wait_event->Signal(); 25 wait_event->Signal();
26 } 26 }
27 27
28 class PasswordStoreConsumerHelper : public PasswordStoreConsumer { 28 class PasswordStoreConsumerHelper : public PasswordStoreConsumer {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 std::vector<PasswordForm> forms; 115 std::vector<PasswordForm> forms;
116 GetLogins(GetVerifierPasswordStore(), forms); 116 GetLogins(GetVerifierPasswordStore(), forms);
117 for (std::vector<PasswordForm>::iterator it = forms.begin(); 117 for (std::vector<PasswordForm>::iterator it = forms.begin();
118 it != forms.end(); ++it) { 118 it != forms.end(); ++it) {
119 GetVerifierPasswordStore()->RemoveLogin(*it); 119 GetVerifierPasswordStore()->RemoveLogin(*it);
120 } 120 }
121 forms.clear(); 121 forms.clear();
122 GetLogins(GetVerifierPasswordStore(), forms); 122 GetLogins(GetVerifierPasswordStore(), forms);
123 ASSERT_EQ(0U, forms.size()); 123 ASSERT_EQ(0U, forms.size());
124 } 124 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698