| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 CheckUint32Attribute(item, "preferred", form.preferred); | 493 CheckUint32Attribute(item, "preferred", form.preferred); |
| 494 // We don't check the date created. It varies. | 494 // We don't check the date created. It varies. |
| 495 CheckUint32Attribute(item, "blacklisted_by_user", form.blacklisted_by_user); | 495 CheckUint32Attribute(item, "blacklisted_by_user", form.blacklisted_by_user); |
| 496 CheckUint32Attribute(item, "type", form.type); | 496 CheckUint32Attribute(item, "type", form.type); |
| 497 CheckUint32Attribute(item, "times_used", form.times_used); | 497 CheckUint32Attribute(item, "times_used", form.times_used); |
| 498 CheckUint32Attribute(item, "scheme", form.scheme); | 498 CheckUint32Attribute(item, "scheme", form.scheme); |
| 499 CheckStringAttribute(item, "date_synced", base::Int64ToString( | 499 CheckStringAttribute(item, "date_synced", base::Int64ToString( |
| 500 form.date_synced.ToInternalValue())); | 500 form.date_synced.ToInternalValue())); |
| 501 CheckStringAttribute(item, "display_name", UTF16ToUTF8(form.display_name)); | 501 CheckStringAttribute(item, "display_name", UTF16ToUTF8(form.display_name)); |
| 502 CheckStringAttribute(item, "avatar_url", form.icon_url.spec()); | 502 CheckStringAttribute(item, "avatar_url", form.icon_url.spec()); |
| 503 // We serialize unique origins as "", in order to make other systems that | 503 // We serialize opaque origins as "", in order to make other systems that |
| 504 // read from the login database happy. https://crbug.com/591310 | 504 // read from the login database happy. https://crbug.com/591310 |
| 505 CheckStringAttribute(item, "federation_url", | 505 CheckStringAttribute(item, "federation_url", |
| 506 form.federation_origin.unique() | 506 form.federation_origin.opaque() |
| 507 ? "" | 507 ? "" |
| 508 : form.federation_origin.Serialize()); | 508 : form.federation_origin.Serialize()); |
| 509 CheckUint32Attribute(item, "should_skip_zero_click", form.skip_zero_click); | 509 CheckUint32Attribute(item, "should_skip_zero_click", form.skip_zero_click); |
| 510 CheckUint32Attribute(item, "generation_upload_status", | 510 CheckUint32Attribute(item, "generation_upload_status", |
| 511 form.generation_upload_status); | 511 form.generation_upload_status); |
| 512 CheckStringAttribute(item, "application", app_string); | 512 CheckStringAttribute(item, "application", app_string); |
| 513 autofill::FormData actual; | 513 autofill::FormData actual; |
| 514 DeserializeFormDataFromBase64String( | 514 DeserializeFormDataFromBase64String( |
| 515 item->attributes.at("form_data").value_string, &actual); | 515 item->attributes.at("form_data").value_string, &actual); |
| 516 EXPECT_TRUE(form.form_data.SameFormAs(actual)); | 516 EXPECT_TRUE(form.form_data.SameFormAs(actual)); |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1325 base::Bind(&CheckTrue)); | 1325 base::Bind(&CheckTrue)); |
| 1326 | 1326 |
| 1327 RunBothThreads(); | 1327 RunBothThreads(); |
| 1328 | 1328 |
| 1329 EXPECT_EQ(2u, form_list.size()); | 1329 EXPECT_EQ(2u, form_list.size()); |
| 1330 EXPECT_THAT(form_list, UnorderedElementsAre(Pointee(form_google_), | 1330 EXPECT_THAT(form_list, UnorderedElementsAre(Pointee(form_google_), |
| 1331 Pointee(form_facebook_))); | 1331 Pointee(form_facebook_))); |
| 1332 } | 1332 } |
| 1333 | 1333 |
| 1334 // TODO(mdm): add more basic tests here at some point. | 1334 // TODO(mdm): add more basic tests here at some point. |
| OLD | NEW |