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

Unified Diff: chrome/browser/password_manager/native_backend_gnome_x_unittest.cc

Issue 299443002: Password Login Database: report correct changes from UpdateLogin(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respect primary key in the UpdateLogin() Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/password_manager/native_backend_gnome_x_unittest.cc
diff --git a/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc b/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc
index bf648f9d1ba75eef8ab058c840d6476e067fc5fe..71f3a8548b4b086bc6b1536deee8dedbc59701ac 100644
--- a/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc
+++ b/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc
@@ -556,7 +556,8 @@ class NativeBackendGnomeTest : public testing::Test {
FROM_HERE,
base::Bind(base::IgnoreResult(&NativeBackendGnome::UpdateLogin),
base::Unretained(&backend),
- new_facebook));
+ new_facebook,
+ base::Owned(new PasswordStoreChangeList)));
break;
case UPDATE_BY_ADDLOGIN:
BrowserThread::PostTask(
@@ -753,13 +754,19 @@ TEST_F(NativeBackendGnomeTest, BasicUpdateLogin) {
CheckMockKeyringItem(&mock_keyring_items[0], form_google_, "chrome-42");
// Update login
+ PasswordStoreChangeList changes;
BrowserThread::PostTask(
BrowserThread::DB, FROM_HERE,
base::Bind(base::IgnoreResult(&NativeBackendGnome::UpdateLogin),
- base::Unretained(&backend), new_form_google));
+ base::Unretained(&backend),
+ new_form_google,
+ base::Unretained(&changes)));
RunBothThreads();
+ ASSERT_EQ(1u, changes.size());
+ EXPECT_EQ(PasswordStoreChange::UPDATE, changes.front().type());
+ EXPECT_EQ(new_form_google, changes.front().form());
EXPECT_EQ(1u, mock_keyring_items.size());
if (mock_keyring_items.size() > 0)
CheckMockKeyringItem(&mock_keyring_items[0], new_form_google, "chrome-42");

Powered by Google App Engine
This is Rietveld 408576698