| OLD | NEW |
| 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 Loading... |
| 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 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 EXPECT_EQ(form_google_, *form_list[0]); | 976 EXPECT_EQ(form_google_, *form_list[0]); |
| 976 | 977 |
| 977 EXPECT_EQ(1u, global_mock_libsecret_items->size()); | 978 EXPECT_EQ(1u, global_mock_libsecret_items->size()); |
| 978 if (!global_mock_libsecret_items->empty()) { | 979 if (!global_mock_libsecret_items->empty()) { |
| 979 CheckMockSecretItem((*global_mock_libsecret_items)[0], form_google_, | 980 CheckMockSecretItem((*global_mock_libsecret_items)[0], form_google_, |
| 980 "chrome-42"); | 981 "chrome-42"); |
| 981 } | 982 } |
| 982 } | 983 } |
| 983 | 984 |
| 984 // TODO(mdm): add more basic tests here at some point. | 985 // TODO(mdm): add more basic tests here at some point. |
| OLD | NEW |