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

Unified Diff: mojo/common/common_custom_types_unittest.cc

Issue 2180093002: [Autofill] Switch on use_new_wrapper_types mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nit Created 4 years, 5 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/common/common_custom_types.typemap ('k') | mojo/common/test_common_custom_types.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « mojo/common/common_custom_types.typemap ('k') | mojo/common/test_common_custom_types.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698