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

Side by Side Diff: components/autofill/core/common/form_data_unittest.cc

Issue 980583002: Serialize form_data in Gnome keyring password store service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style fix Created 5 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
« no previous file with comments | « components/autofill/core/common/form_data.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/autofill/core/common/form_data.h" 5 #include "components/autofill/core/common/form_data.h"
6 6
7 #include "base/pickle.h" 7 #include "base/pickle.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "components/autofill/core/common/form_field_data.h" 9 #include "components/autofill/core/common/form_field_data.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 FillInDummyFormData(&data); 140 FillInDummyFormData(&data);
141 141
142 Pickle pickle; 142 Pickle pickle;
143 SerializeIncorrectFormat(data, &pickle); 143 SerializeIncorrectFormat(data, &pickle);
144 144
145 PickleIterator iter(pickle); 145 PickleIterator iter(pickle);
146 FormData actual; 146 FormData actual;
147 EXPECT_FALSE(DeserializeFormData(&iter, &actual)); 147 EXPECT_FALSE(DeserializeFormData(&iter, &actual));
148 } 148 }
149 149
150 TEST(FormDataTest, SerializeAndDeserializeInStrings) {
151 FormData data;
152 FillInDummyFormData(&data);
153 data.is_form_tag = false;
154
155 std::string serialized_data;
156 SerializeFormDataToBase64String(data, &serialized_data);
157
158 FormData actual;
159 EXPECT_TRUE(DeserializeFormDataFromBase64String(serialized_data, &actual));
160
161 EXPECT_TRUE(actual.SameFormAs(data));
162 }
163
150 } // namespace autofill 164 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/common/form_data.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698