Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: chrome/browser/password_manager/native_backend_gnome_x_unittest.cc

Issue 1752383004: CREDENTIAL: Serialize 'PasswordCredential' objects with "" as the federation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 CheckUint32Attribute(item, "preferred", form.preferred); 484 CheckUint32Attribute(item, "preferred", form.preferred);
485 // We don't check the date created. It varies. 485 // We don't check the date created. It varies.
486 CheckUint32Attribute(item, "blacklisted_by_user", form.blacklisted_by_user); 486 CheckUint32Attribute(item, "blacklisted_by_user", form.blacklisted_by_user);
487 CheckUint32Attribute(item, "type", form.type); 487 CheckUint32Attribute(item, "type", form.type);
488 CheckUint32Attribute(item, "times_used", form.times_used); 488 CheckUint32Attribute(item, "times_used", form.times_used);
489 CheckUint32Attribute(item, "scheme", form.scheme); 489 CheckUint32Attribute(item, "scheme", form.scheme);
490 CheckStringAttribute(item, "date_synced", base::Int64ToString( 490 CheckStringAttribute(item, "date_synced", base::Int64ToString(
491 form.date_synced.ToInternalValue())); 491 form.date_synced.ToInternalValue()));
492 CheckStringAttribute(item, "display_name", UTF16ToUTF8(form.display_name)); 492 CheckStringAttribute(item, "display_name", UTF16ToUTF8(form.display_name));
493 CheckStringAttribute(item, "avatar_url", form.icon_url.spec()); 493 CheckStringAttribute(item, "avatar_url", form.icon_url.spec());
494 // We serialize unique origins as "", in order to make other systems that
495 // read from the login database happy. https://crbug.com/591310
494 CheckStringAttribute(item, "federation_url", 496 CheckStringAttribute(item, "federation_url",
495 form.federation_origin.Serialize()); 497 form.federation_origin.unique()
498 ? ""
499 : form.federation_origin.Serialize());
496 CheckUint32Attribute(item, "should_skip_zero_click", form.skip_zero_click); 500 CheckUint32Attribute(item, "should_skip_zero_click", form.skip_zero_click);
497 CheckUint32Attribute(item, "generation_upload_status", 501 CheckUint32Attribute(item, "generation_upload_status",
498 form.generation_upload_status); 502 form.generation_upload_status);
499 CheckStringAttribute(item, "application", app_string); 503 CheckStringAttribute(item, "application", app_string);
500 autofill::FormData actual; 504 autofill::FormData actual;
501 DeserializeFormDataFromBase64String( 505 DeserializeFormDataFromBase64String(
502 item->attributes.at("form_data").value_string, &actual); 506 item->attributes.at("form_data").value_string, &actual);
503 EXPECT_TRUE(form.form_data.SameFormAs(actual)); 507 EXPECT_TRUE(form.form_data.SameFormAs(actual));
504 } 508 }
505 509
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
1280 base::Bind(&CheckTrue)); 1284 base::Bind(&CheckTrue));
1281 1285
1282 RunBothThreads(); 1286 RunBothThreads();
1283 1287
1284 EXPECT_EQ(2u, form_list.size()); 1288 EXPECT_EQ(2u, form_list.size());
1285 EXPECT_THAT(form_list, UnorderedElementsAre(Pointee(form_google_), 1289 EXPECT_THAT(form_list, UnorderedElementsAre(Pointee(form_google_),
1286 Pointee(form_facebook_))); 1290 Pointee(form_facebook_)));
1287 } 1291 }
1288 1292
1289 // TODO(mdm): add more basic tests here at some point. 1293 // TODO(mdm): add more basic tests here at some point.
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/native_backend_gnome_x.cc ('k') | chrome/browser/password_manager/native_backend_kwallet_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698