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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 CheckUint32Attribute(item, "preferred", form.preferred); | 466 CheckUint32Attribute(item, "preferred", form.preferred); |
467 // We don't check the date created. It varies. | 467 // We don't check the date created. It varies. |
468 CheckUint32Attribute(item, "blacklisted_by_user", form.blacklisted_by_user); | 468 CheckUint32Attribute(item, "blacklisted_by_user", form.blacklisted_by_user); |
469 CheckUint32Attribute(item, "type", form.type); | 469 CheckUint32Attribute(item, "type", form.type); |
470 CheckUint32Attribute(item, "times_used", form.times_used); | 470 CheckUint32Attribute(item, "times_used", form.times_used); |
471 CheckUint32Attribute(item, "scheme", form.scheme); | 471 CheckUint32Attribute(item, "scheme", form.scheme); |
472 CheckStringAttribute(item, "date_synced", base::Int64ToString( | 472 CheckStringAttribute(item, "date_synced", base::Int64ToString( |
473 form.date_synced.ToInternalValue())); | 473 form.date_synced.ToInternalValue())); |
474 CheckStringAttribute(item, "display_name", UTF16ToUTF8(form.display_name)); | 474 CheckStringAttribute(item, "display_name", UTF16ToUTF8(form.display_name)); |
475 CheckStringAttribute(item, "avatar_url", form.icon_url.spec()); | 475 CheckStringAttribute(item, "avatar_url", form.icon_url.spec()); |
476 // We serialize unique origins as "", in order to make other systems that | 476 // We serialize opaque origins as "", in order to make other systems that |
477 // read from the login database happy. https://crbug.com/591310 | 477 // read from the login database happy. https://crbug.com/591310 |
478 CheckStringAttribute(item, "federation_url", | 478 CheckStringAttribute(item, "federation_url", |
479 form.federation_origin.unique() | 479 form.federation_origin.opaque() |
480 ? "" | 480 ? "" |
481 : form.federation_origin.Serialize()); | 481 : form.federation_origin.Serialize()); |
482 CheckUint32Attribute(item, "should_skip_zero_click", form.skip_zero_click); | 482 CheckUint32Attribute(item, "should_skip_zero_click", form.skip_zero_click); |
483 CheckUint32Attribute(item, "generation_upload_status", | 483 CheckUint32Attribute(item, "generation_upload_status", |
484 form.generation_upload_status); | 484 form.generation_upload_status); |
485 CheckStringAttribute(item, "application", app_string); | 485 CheckStringAttribute(item, "application", app_string); |
486 autofill::FormData actual; | 486 autofill::FormData actual; |
487 DeserializeFormDataFromBase64String( | 487 DeserializeFormDataFromBase64String( |
488 item->attributes.at("form_data").value_string, &actual); | 488 item->attributes.at("form_data").value_string, &actual); |
489 EXPECT_TRUE(form.form_data.SameFormAs(actual)); | 489 EXPECT_TRUE(form.form_data.SameFormAs(actual)); |
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1298 base::Bind(&CheckTrue)); | 1298 base::Bind(&CheckTrue)); |
1299 | 1299 |
1300 scoped_task_environment_.RunUntilIdle(); | 1300 scoped_task_environment_.RunUntilIdle(); |
1301 | 1301 |
1302 EXPECT_EQ(2u, form_list.size()); | 1302 EXPECT_EQ(2u, form_list.size()); |
1303 EXPECT_THAT(form_list, UnorderedElementsAre(Pointee(form_google_), | 1303 EXPECT_THAT(form_list, UnorderedElementsAre(Pointee(form_google_), |
1304 Pointee(form_facebook_))); | 1304 Pointee(form_facebook_))); |
1305 } | 1305 } |
1306 | 1306 |
1307 // TODO(mdm): add more basic tests here at some point. | 1307 // TODO(mdm): add more basic tests here at some point. |
OLD | NEW |