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

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

Issue 2441653002: Always unlock all libsecret items in Password Manager and OSCrypt (Closed)
Patch Set: Error handling Created 4 years, 1 month 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 (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <stdarg.h> 5 #include <stdarg.h>
6 #include <stddef.h> 6 #include <stddef.h>
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 global_mock_libsecret_items->push_back(item); 122 global_mock_libsecret_items->push_back(item);
123 return true; 123 return true;
124 } 124 }
125 125
126 GList* mock_secret_service_search_sync(SecretService* service, 126 GList* mock_secret_service_search_sync(SecretService* service,
127 const SecretSchema* schema, 127 const SecretSchema* schema,
128 GHashTable* attributes, 128 GHashTable* attributes,
129 SecretSearchFlags flags, 129 SecretSearchFlags flags,
130 GCancellable* cancellable, 130 GCancellable* cancellable,
131 GError** error) { 131 GError** error) {
132 EXPECT_TRUE(flags & SECRET_SEARCH_UNLOCK);
132 GList* result = nullptr; 133 GList* result = nullptr;
133 for (MockSecretItem* item : *global_mock_libsecret_items) { 134 for (MockSecretItem* item : *global_mock_libsecret_items) {
134 if (Matches(item, attributes)) 135 if (Matches(item, attributes))
135 result = g_list_append(result, item); 136 result = g_list_append(result, item);
136 } 137 }
137 return result; 138 return result;
138 } 139 }
139 140
140 gboolean mock_secret_password_clear_sync(const SecretSchema* schema, 141 gboolean mock_secret_password_clear_sync(const SecretSchema* schema,
141 GCancellable* cancellable, 142 GCancellable* cancellable,
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 EXPECT_EQ(form_google_, *form_list[0]); 977 EXPECT_EQ(form_google_, *form_list[0]);
977 978
978 EXPECT_EQ(1u, global_mock_libsecret_items->size()); 979 EXPECT_EQ(1u, global_mock_libsecret_items->size());
979 if (!global_mock_libsecret_items->empty()) { 980 if (!global_mock_libsecret_items->empty()) {
980 CheckMockSecretItem((*global_mock_libsecret_items)[0], form_google_, 981 CheckMockSecretItem((*global_mock_libsecret_items)[0], form_google_,
981 "chrome-42"); 982 "chrome-42");
982 } 983 }
983 } 984 }
984 985
985 // TODO(mdm): add more basic tests here at some point. 986 // TODO(mdm): add more basic tests here at some point.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698