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

Side by Side Diff: chrome/browser/password_manager/simple_password_store_mac_unittest.cc

Issue 1213043003: Start the migration of passwords from the Keychain. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added a comment Created 5 years, 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/password_manager/simple_password_store_mac.h" 5 #include "chrome/browser/password_manager/simple_password_store_mac.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "components/os_crypt/os_crypt.h" 10 #include "components/os_crypt/os_crypt.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // Setup LoginDatabase. 43 // Setup LoginDatabase.
44 scoped_ptr<password_manager::LoginDatabase> login_db( 44 scoped_ptr<password_manager::LoginDatabase> login_db(
45 new password_manager::LoginDatabase(test_login_db_file_path())); 45 new password_manager::LoginDatabase(test_login_db_file_path()));
46 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = 46 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner =
47 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE); 47 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE);
48 ASSERT_TRUE(file_task_runner); 48 ASSERT_TRUE(file_task_runner);
49 file_task_runner->PostTask( 49 file_task_runner->PostTask(
50 FROM_HERE, 50 FROM_HERE,
51 base::Bind(&InitOnBackgroundThread, base::Unretained(login_db.get()))); 51 base::Bind(&InitOnBackgroundThread, base::Unretained(login_db.get())));
52 store_ = new SimplePasswordStoreMac( 52 store_ = new SimplePasswordStoreMac(
53 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 53 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), nullptr,
54 file_task_runner, login_db.Pass()); 54 scoped_ptr<password_manager::LoginDatabase>());
55 ASSERT_TRUE(store_->Init(syncer::SyncableService::StartSyncFlare())); 55 file_task_runner->PostTask(
56 FROM_HERE,
57 base::Bind(&SimplePasswordStoreMac::InitWithTaskRunner, store_,
58 file_task_runner, base::Passed(&login_db)));
56 // Make sure deferred initialization is finished. 59 // Make sure deferred initialization is finished.
57 FinishAsyncProcessing(); 60 FinishAsyncProcessing();
58 } 61 }
59 62
60 void TearDown() override { 63 void TearDown() override {
61 store_->Shutdown(); 64 store_->Shutdown();
62 EXPECT_TRUE(store_->GetBackgroundTaskRunner()); 65 EXPECT_TRUE(store_->GetBackgroundTaskRunner());
63 store_ = nullptr; 66 store_ = nullptr;
64 } 67 }
65 68
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 PasswordStoreChange(PasswordStoreChange::ADD, form), 107 PasswordStoreChange(PasswordStoreChange::ADD, form),
105 }; 108 };
106 EXPECT_CALL(observer, 109 EXPECT_CALL(observer,
107 OnLoginsChanged(ElementsAreArray(expected_add_changes))); 110 OnLoginsChanged(ElementsAreArray(expected_add_changes)));
108 // Adding a login should trigger a notification. 111 // Adding a login should trigger a notification.
109 store()->AddLogin(form); 112 store()->AddLogin(form);
110 FinishAsyncProcessing(); 113 FinishAsyncProcessing();
111 } 114 }
112 115
113 } // namespace 116 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/simple_password_store_mac.cc ('k') | components/password_manager.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698