| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 ScopedVector<MockSecretItem>* global_mock_libsecret_items; | 91 ScopedVector<MockSecretItem>* global_mock_libsecret_items; |
| 92 bool global_mock_libsecret_reject_local_ids = false; | 92 bool global_mock_libsecret_reject_local_ids = false; |
| 93 | 93 |
| 94 gboolean mock_secret_password_store_sync(const SecretSchema* schema, | 94 gboolean mock_secret_password_store_sync(const SecretSchema* schema, |
| 95 const gchar* collection, | 95 const gchar* collection, |
| 96 const gchar* label, | 96 const gchar* label, |
| 97 const gchar* password, | 97 const gchar* password, |
| 98 GCancellable* cancellable, | 98 GCancellable* cancellable, |
| 99 GError** error, | 99 GError** error, |
| 100 ...) { | 100 ...) { |
| 101 // TODO(crbug.com/660005) We don't read the dummy we store to unlock keyring. |
| 102 if (strcmp("_chrome_dummy_schema_for_unlocking", schema->name) == 0) |
| 103 return true; |
| 104 |
| 101 GHashTable* attributes = | 105 GHashTable* attributes = |
| 102 g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); | 106 g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); |
| 103 va_list ap; | 107 va_list ap; |
| 104 va_start(ap, error); | 108 va_start(ap, error); |
| 105 char* name; | 109 char* name; |
| 106 while ((name = va_arg(ap, gchar*))) { | 110 while ((name = va_arg(ap, gchar*))) { |
| 107 char* value; | 111 char* value; |
| 108 if (IsStringAttribute(schema, name)) { | 112 if (IsStringAttribute(schema, name)) { |
| 109 value = g_strdup(va_arg(ap, gchar*)); | 113 value = g_strdup(va_arg(ap, gchar*)); |
| 110 VLOG(1) << "Adding item attribute " << name << ", value '" << value | 114 VLOG(1) << "Adding item attribute " << name << ", value '" << value |
| (...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 EXPECT_EQ(form_google_, *form_list[0]); | 980 EXPECT_EQ(form_google_, *form_list[0]); |
| 977 | 981 |
| 978 EXPECT_EQ(1u, global_mock_libsecret_items->size()); | 982 EXPECT_EQ(1u, global_mock_libsecret_items->size()); |
| 979 if (!global_mock_libsecret_items->empty()) { | 983 if (!global_mock_libsecret_items->empty()) { |
| 980 CheckMockSecretItem((*global_mock_libsecret_items)[0], form_google_, | 984 CheckMockSecretItem((*global_mock_libsecret_items)[0], form_google_, |
| 981 "chrome-42"); | 985 "chrome-42"); |
| 982 } | 986 } |
| 983 } | 987 } |
| 984 | 988 |
| 985 // TODO(mdm): add more basic tests here at some point. | 989 // TODO(mdm): add more basic tests here at some point. |
| OLD | NEW |