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

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

Issue 1682113003: Mojo C++ bindings: Generate InterfaceHandle<> instead of InterfacePtr<>. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase ontop of master, address trung's comments Created 4 years, 10 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/strong_binding.h ('k') | mojo/public/cpp/bindings/tests/binding_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/tests/array_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/array_unittest.cc b/mojo/public/cpp/bindings/tests/array_unittest.cc
index 38917809ecb45db3c9faa7b28975bdd12d242436..e81b5eeef110b1f876e4d91bac7dc08cf21ee4d9 100644
--- a/mojo/public/cpp/bindings/tests/array_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/array_unittest.cc
@@ -395,7 +395,7 @@ TEST_F(ArrayTest, Serialization_StructWithArraysOfHandles) {
// Test serializing and deserializing an Array<InterfacePtr>.
TEST_F(ArrayTest, Serialization_ArrayOfInterfacePtr) {
- auto iface_array = Array<TestInterfacePtr>::New(1);
+ auto iface_array = Array<mojo::InterfaceHandle<TestInterface>>::New(1);
size_t size = GetSerializedSize_(iface_array);
EXPECT_EQ(8U // array header
+ (8U * 1), // Interface_Data * number of elements
@@ -409,28 +409,28 @@ TEST_F(ArrayTest, Serialization_ArrayOfInterfacePtr) {
EXPECT_EQ(
mojo::internal::ValidationError::UNEXPECTED_INVALID_HANDLE,
SerializeArray_(&iface_array, &buf, &output, &validate_non_nullable));
- EXPECT_FALSE(iface_array[0].is_bound());
+ EXPECT_FALSE(iface_array[0].is_valid());
// 2. Invalid InterfacePtr should pass if array elements are nullable.
ArrayValidateParams validate_nullable(1, true, nullptr);
EXPECT_EQ(mojo::internal::ValidationError::NONE,
SerializeArray_(&iface_array, &buf, &output, &validate_nullable));
- EXPECT_FALSE(iface_array[0].is_bound());
+ EXPECT_FALSE(iface_array[0].is_valid());
// 3. Should serialize successfully if InterfacePtr is valid.
TestInterfacePtr iface_ptr;
auto iface_req = GetProxy(&iface_ptr);
iface_array[0] = iface_ptr.Pass();
- EXPECT_TRUE(iface_array[0].is_bound());
+ EXPECT_TRUE(iface_array[0].is_valid());
EXPECT_EQ(
mojo::internal::ValidationError::NONE,
SerializeArray_(&iface_array, &buf, &output, &validate_non_nullable));
- EXPECT_FALSE(iface_array[0].is_bound());
+ EXPECT_FALSE(iface_array[0].is_valid());
Deserialize_(output, &iface_array);
- EXPECT_TRUE(iface_array[0].is_bound());
+ EXPECT_TRUE(iface_array[0].is_valid());
}
// Test serializing and deserializing a struct with an Array<> of another struct
@@ -468,14 +468,14 @@ TEST_F(ArrayTest, Serialization_StructWithArrayOfInterfacePtr) {
iface_struct->iptr = iface_ptr.Pass();
struct_arr_iface.structs_array[0] = iface_struct.Pass();
- ASSERT_TRUE(struct_arr_iface.structs_array[0]->iptr.is_bound());
+ ASSERT_TRUE(struct_arr_iface.structs_array[0]->iptr.is_valid());
EXPECT_EQ(mojo::internal::ValidationError::NONE,
Serialize_(&struct_arr_iface, &buf, &struct_arr_iface_data));
- EXPECT_FALSE(struct_arr_iface.structs_array[0]->iptr.is_bound());
+ EXPECT_FALSE(struct_arr_iface.structs_array[0]->iptr.is_valid());
Deserialize_(struct_arr_iface_data, &struct_arr_iface);
- EXPECT_TRUE(struct_arr_iface.structs_array[0]->iptr.is_bound());
+ EXPECT_TRUE(struct_arr_iface.structs_array[0]->iptr.is_valid());
}
// Test serializing and deserializing a struct with an Array<> of interface
« no previous file with comments | « mojo/public/cpp/bindings/strong_binding.h ('k') | mojo/public/cpp/bindings/tests/binding_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698