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

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

Issue 2608503002: Remove mojo::WTFMap. (Closed)
Patch Set: Created 4 years 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_map_unittest.cc ('k') | mojo/public/cpp/bindings/wtf_map.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 cc2963a5ecdf53022c5b79a6f1a5dbe98380d116..d18241e56848829aee7291de44ba0e8bf39273e7 100644
--- a/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc
@@ -177,66 +177,6 @@ TEST_F(WTFTypesTest, Serialization_WTFArrayToMojoArray) {
EXPECT_TRUE(kUTF8HelloWorld == strs2[3]);
}
-TEST_F(WTFTypesTest, Serialization_WTFMapToWTFMap) {
- using WTFType = WTFMap<WTF::String, WTF::String>;
- using MojomType = MapDataView<StringDataView, StringDataView>;
-
- WTFType str_map = ConstructStringMap();
- WTFType cloned_str_map = str_map.Clone();
-
- mojo::internal::SerializationContext context;
- size_t size =
- mojo::internal::PrepareToSerialize<MojomType>(cloned_str_map, &context);
-
- mojo::internal::FixedBufferForTesting buf(size);
- typename mojo::internal::MojomTypeTraits<MojomType>::Data* data;
- mojo::internal::ContainerValidateParams validate_params(
- new mojo::internal::ContainerValidateParams(
- 0, false,
- new mojo::internal::ContainerValidateParams(0, false, nullptr)),
- new mojo::internal::ContainerValidateParams(
- 0, true,
- new mojo::internal::ContainerValidateParams(0, false, nullptr)));
- mojo::internal::Serialize<MojomType>(cloned_str_map, &buf, &data,
- &validate_params, &context);
-
- WTFType str_map2;
- mojo::internal::Deserialize<MojomType>(data, &str_map2, &context);
-
- EXPECT_TRUE(str_map.Equals(str_map2));
-}
-
-TEST_F(WTFTypesTest, Serialization_WTFMapToMojoMap) {
- using WTFType = WTFMap<WTF::String, WTF::String>;
- using MojomType = MapDataView<StringDataView, StringDataView>;
-
- WTFType str_map = ConstructStringMap();
-
- mojo::internal::SerializationContext context;
- size_t size =
- mojo::internal::PrepareToSerialize<MojomType>(str_map, &context);
-
- mojo::internal::FixedBufferForTesting buf(size);
- typename mojo::internal::MojomTypeTraits<MojomType>::Data* data;
- mojo::internal::ContainerValidateParams validate_params(
- new mojo::internal::ContainerValidateParams(
- 0, false,
- new mojo::internal::ContainerValidateParams(0, false, nullptr)),
- new mojo::internal::ContainerValidateParams(
- 0, true,
- new mojo::internal::ContainerValidateParams(0, false, nullptr)));
- mojo::internal::Serialize<MojomType>(str_map, &buf, &data, &validate_params,
- &context);
-
- Map<mojo::String, mojo::String> str_map2;
- mojo::internal::Deserialize<MojomType>(data, &str_map2, &context);
-
- ASSERT_EQ(3u, str_map2.size());
- EXPECT_TRUE(str_map2["0"].is_null());
- EXPECT_TRUE(kHelloWorld == str_map2["1"]);
- EXPECT_TRUE(kUTF8HelloWorld == str_map2["2"]);
-}
-
TEST_F(WTFTypesTest, Serialization_PublicAPI) {
blink::TestWTFStructPtr input(blink::TestWTFStruct::New());
input->str = kHelloWorld;
« no previous file with comments | « mojo/public/cpp/bindings/tests/wtf_map_unittest.cc ('k') | mojo/public/cpp/bindings/wtf_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698