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

Unified Diff: mojo/public/cpp/bindings/tests/wtf_types_unittest.cc

Issue 2604113002: Remove mojo::WTFArray. (Closed)
Patch Set: rebase Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/cpp/bindings/tests/wtf_array_unittest.cc ('k') | mojo/public/cpp/bindings/wtf_array.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/tests/wtf_types_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc b/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc
index 8d9709c6c1c70c51ac2225e7627e8ad21cb73639..9a20cc45a4b7cbea09a0199d03a6022dfd6e96cb 100644
--- a/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc
@@ -106,11 +106,11 @@ void ExpectStringMap(
} // namespace
-TEST_F(WTFTypesTest, Serialization_WTFArrayToWTFArray) {
+TEST_F(WTFTypesTest, Serialization_WTFVectorToWTFVector) {
using MojomType = ArrayDataView<StringDataView>;
- WTFArray<WTF::String> strs = ConstructStringArray();
- auto cloned_strs = strs.Clone();
+ WTF::Vector<WTF::String> strs = ConstructStringArray();
+ auto cloned_strs = strs;
mojo::internal::SerializationContext context;
size_t size =
@@ -123,13 +123,13 @@ TEST_F(WTFTypesTest, Serialization_WTFArrayToWTFArray) {
mojo::internal::Serialize<MojomType>(cloned_strs, &buf, &data,
&validate_params, &context);
- WTFArray<WTF::String> strs2;
+ WTF::Vector<WTF::String> strs2;
mojo::internal::Deserialize<MojomType>(data, &strs2, &context);
- EXPECT_TRUE(strs.Equals(strs2));
+ EXPECT_EQ(strs, strs2);
}
-TEST_F(WTFTypesTest, Serialization_WTFVectorToWTFVector) {
+TEST_F(WTFTypesTest, Serialization_WTFVectorToStlVector) {
using MojomType = ArrayDataView<StringDataView>;
WTF::Vector<WTF::String> strs = ConstructStringArray();
@@ -146,28 +146,7 @@ TEST_F(WTFTypesTest, Serialization_WTFVectorToWTFVector) {
mojo::internal::Serialize<MojomType>(cloned_strs, &buf, &data,
&validate_params, &context);
- WTF::Vector<WTF::String> strs2;
- mojo::internal::Deserialize<MojomType>(data, &strs2, &context);
-
- EXPECT_EQ(strs, strs2);
-}
-
-TEST_F(WTFTypesTest, Serialization_WTFArrayToMojoArray) {
- using MojomType = ArrayDataView<StringDataView>;
-
- WTFArray<WTF::String> strs = ConstructStringArray();
-
- mojo::internal::SerializationContext context;
- size_t size = mojo::internal::PrepareToSerialize<MojomType>(strs, &context);
-
- mojo::internal::FixedBufferForTesting buf(size);
- typename mojo::internal::MojomTypeTraits<MojomType>::Data* data;
- mojo::internal::ContainerValidateParams validate_params(
- 0, true, new mojo::internal::ContainerValidateParams(0, false, nullptr));
- mojo::internal::Serialize<MojomType>(strs, &buf, &data, &validate_params,
- &context);
-
- Array<base::Optional<std::string>> strs2;
+ std::vector<base::Optional<std::string>> strs2;
mojo::internal::Deserialize<MojomType>(data, &strs2, &context);
ASSERT_EQ(4u, strs2.size());
« no previous file with comments | « mojo/public/cpp/bindings/tests/wtf_array_unittest.cc ('k') | mojo/public/cpp/bindings/wtf_array.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698