| Index: mojo/common/common_custom_types_unittest.cc
|
| diff --git a/mojo/common/common_custom_types_unittest.cc b/mojo/common/common_custom_types_unittest.cc
|
| index 04ef5fea37b9842fcde50dee3690fcd4712bc536..7e8252dbc613a33b6c0acc69c0730a3041837d69 100644
|
| --- a/mojo/common/common_custom_types_unittest.cc
|
| +++ b/mojo/common/common_custom_types_unittest.cc
|
| @@ -5,6 +5,7 @@
|
| #include "base/files/file_path.h"
|
| #include "base/message_loop/message_loop.h"
|
| #include "base/run_loop.h"
|
| +#include "base/strings/utf_string_conversions.h"
|
| #include "base/values.h"
|
| #include "mojo/common/common_custom_types.mojom.h"
|
| #include "mojo/common/test_common_custom_types.mojom.h"
|
| @@ -133,6 +134,21 @@ class TestValueImpl : public TestValue {
|
| mojo::Binding<TestValue> binding_;
|
| };
|
|
|
| +class TestString16Impl : public TestString16 {
|
| + public:
|
| + explicit TestString16Impl(TestString16Request request)
|
| + : binding_(this, std::move(request)) {}
|
| +
|
| + // TestString16 implementation:
|
| + void BounceString16(const base::string16& in,
|
| + const BounceString16Callback& callback) override {
|
| + callback.Run(in);
|
| + }
|
| +
|
| + private:
|
| + mojo::Binding<TestString16> binding_;
|
| +};
|
| +
|
| class CommonCustomTypesTest : public testing::Test {
|
| protected:
|
| CommonCustomTypesTest() {}
|
| @@ -241,6 +257,19 @@ TEST_F(CommonCustomTypesTest, Value) {
|
| }
|
| }
|
|
|
| +TEST_F(CommonCustomTypesTest, String16) {
|
| + base::RunLoop run_loop;
|
| +
|
| + TestString16Ptr ptr;
|
| + TestString16Impl impl(GetProxy(&ptr));
|
| +
|
| + base::string16 str16 = base::ASCIIToUTF16("hello world");
|
| +
|
| + ptr->BounceString16(str16, ExpectResponse(&str16, run_loop.QuitClosure()));
|
| +
|
| + run_loop.Run();
|
| +}
|
| +
|
| } // namespace test
|
| } // namespace common
|
| } // namespace mojo
|
|
|