| 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/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 // We don't check the date created. It varies. | 391 // We don't check the date created. It varies. |
| 392 CheckUint32Attribute(item, "blacklisted_by_user", form.blacklisted_by_user); | 392 CheckUint32Attribute(item, "blacklisted_by_user", form.blacklisted_by_user); |
| 393 CheckUint32Attribute(item, "type", form.type); | 393 CheckUint32Attribute(item, "type", form.type); |
| 394 CheckUint32Attribute(item, "times_used", form.times_used); | 394 CheckUint32Attribute(item, "times_used", form.times_used); |
| 395 CheckUint32Attribute(item, "scheme", form.scheme); | 395 CheckUint32Attribute(item, "scheme", form.scheme); |
| 396 CheckStringAttribute( | 396 CheckStringAttribute( |
| 397 item, "date_synced", | 397 item, "date_synced", |
| 398 base::Int64ToString(form.date_synced.ToInternalValue())); | 398 base::Int64ToString(form.date_synced.ToInternalValue())); |
| 399 CheckStringAttribute(item, "display_name", UTF16ToUTF8(form.display_name)); | 399 CheckStringAttribute(item, "display_name", UTF16ToUTF8(form.display_name)); |
| 400 CheckStringAttribute(item, "avatar_url", form.icon_url.spec()); | 400 CheckStringAttribute(item, "avatar_url", form.icon_url.spec()); |
| 401 // We serialize unique origins as "", in order to make other systems that |
| 402 // read from the login database happy. https://crbug.com/591310 |
| 401 CheckStringAttribute(item, "federation_url", | 403 CheckStringAttribute(item, "federation_url", |
| 402 form.federation_origin.Serialize()); | 404 form.federation_origin.unique() |
| 405 ? "" |
| 406 : form.federation_origin.Serialize()); |
| 403 CheckUint32Attribute(item, "should_skip_zero_click", form.skip_zero_click); | 407 CheckUint32Attribute(item, "should_skip_zero_click", form.skip_zero_click); |
| 404 CheckUint32Attribute(item, "generation_upload_status", | 408 CheckUint32Attribute(item, "generation_upload_status", |
| 405 form.generation_upload_status); | 409 form.generation_upload_status); |
| 406 CheckStringAttribute(item, "application", app_string); | 410 CheckStringAttribute(item, "application", app_string); |
| 407 autofill::FormData actual; | 411 autofill::FormData actual; |
| 408 DeserializeFormDataFromBase64String( | 412 DeserializeFormDataFromBase64String( |
| 409 static_cast<char*>(g_hash_table_lookup(item->attributes, "form_data")), | 413 static_cast<char*>(g_hash_table_lookup(item->attributes, "form_data")), |
| 410 &actual); | 414 &actual); |
| 411 EXPECT_TRUE(form.form_data.SameFormAs(actual)); | 415 EXPECT_TRUE(form.form_data.SameFormAs(actual)); |
| 412 } | 416 } |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 EXPECT_EQ(form_google_, *form_list[0]); | 962 EXPECT_EQ(form_google_, *form_list[0]); |
| 959 | 963 |
| 960 EXPECT_EQ(1u, global_mock_libsecret_items->size()); | 964 EXPECT_EQ(1u, global_mock_libsecret_items->size()); |
| 961 if (!global_mock_libsecret_items->empty()) { | 965 if (!global_mock_libsecret_items->empty()) { |
| 962 CheckMockSecretItem((*global_mock_libsecret_items)[0], form_google_, | 966 CheckMockSecretItem((*global_mock_libsecret_items)[0], form_google_, |
| 963 "chrome-42"); | 967 "chrome-42"); |
| 964 } | 968 } |
| 965 } | 969 } |
| 966 | 970 |
| 967 // TODO(mdm): add more basic tests here at some point. | 971 // TODO(mdm): add more basic tests here at some point. |
| OLD | NEW |