| 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/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 // We don't check the date created. It varies. | 389 // We don't check the date created. It varies. |
| 390 CheckUint32Attribute(item, "blacklisted_by_user", form.blacklisted_by_user); | 390 CheckUint32Attribute(item, "blacklisted_by_user", form.blacklisted_by_user); |
| 391 CheckUint32Attribute(item, "type", form.type); | 391 CheckUint32Attribute(item, "type", form.type); |
| 392 CheckUint32Attribute(item, "times_used", form.times_used); | 392 CheckUint32Attribute(item, "times_used", form.times_used); |
| 393 CheckUint32Attribute(item, "scheme", form.scheme); | 393 CheckUint32Attribute(item, "scheme", form.scheme); |
| 394 CheckStringAttribute( | 394 CheckStringAttribute( |
| 395 item, "date_synced", | 395 item, "date_synced", |
| 396 base::Int64ToString(form.date_synced.ToInternalValue())); | 396 base::Int64ToString(form.date_synced.ToInternalValue())); |
| 397 CheckStringAttribute(item, "display_name", UTF16ToUTF8(form.display_name)); | 397 CheckStringAttribute(item, "display_name", UTF16ToUTF8(form.display_name)); |
| 398 CheckStringAttribute(item, "avatar_url", form.icon_url.spec()); | 398 CheckStringAttribute(item, "avatar_url", form.icon_url.spec()); |
| 399 // We serialize unique origins as "", in order to make other systems that | 399 // We serialize opaque origins as "", in order to make other systems that |
| 400 // read from the login database happy. https://crbug.com/591310 | 400 // read from the login database happy. https://crbug.com/591310 |
| 401 CheckStringAttribute(item, "federation_url", | 401 CheckStringAttribute(item, "federation_url", |
| 402 form.federation_origin.unique() | 402 form.federation_origin.opaque() |
| 403 ? "" | 403 ? "" |
| 404 : form.federation_origin.Serialize()); | 404 : form.federation_origin.Serialize()); |
| 405 CheckUint32Attribute(item, "should_skip_zero_click", form.skip_zero_click); | 405 CheckUint32Attribute(item, "should_skip_zero_click", form.skip_zero_click); |
| 406 CheckUint32Attribute(item, "generation_upload_status", | 406 CheckUint32Attribute(item, "generation_upload_status", |
| 407 form.generation_upload_status); | 407 form.generation_upload_status); |
| 408 CheckStringAttribute(item, "application", app_string); | 408 CheckStringAttribute(item, "application", app_string); |
| 409 autofill::FormData actual; | 409 autofill::FormData actual; |
| 410 DeserializeFormDataFromBase64String( | 410 DeserializeFormDataFromBase64String( |
| 411 static_cast<char*>(g_hash_table_lookup(item->attributes, "form_data")), | 411 static_cast<char*>(g_hash_table_lookup(item->attributes, "form_data")), |
| 412 &actual); | 412 &actual); |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 EXPECT_EQ(form_google_, *form_list[0]); | 1011 EXPECT_EQ(form_google_, *form_list[0]); |
| 1012 | 1012 |
| 1013 EXPECT_EQ(1u, global_mock_libsecret_items->size()); | 1013 EXPECT_EQ(1u, global_mock_libsecret_items->size()); |
| 1014 if (!global_mock_libsecret_items->empty()) { | 1014 if (!global_mock_libsecret_items->empty()) { |
| 1015 CheckMockSecretItem((*global_mock_libsecret_items)[0].get(), form_google_, | 1015 CheckMockSecretItem((*global_mock_libsecret_items)[0].get(), form_google_, |
| 1016 "chrome-42"); | 1016 "chrome-42"); |
| 1017 } | 1017 } |
| 1018 } | 1018 } |
| 1019 | 1019 |
| 1020 // TODO(mdm): add more basic tests here at some point. | 1020 // TODO(mdm): add more basic tests here at some point. |
| OLD | NEW |