Index: mojo/public/cpp/bindings/tests/sync_method_unittest.cc |
diff --git a/mojo/public/cpp/bindings/tests/sync_method_unittest.cc b/mojo/public/cpp/bindings/tests/sync_method_unittest.cc |
index 7a18f7d692d9be361d9f1fb54677b02fd39c6490..36c8b2be8b458684d0135d74b01b64d778bd7793 100644 |
--- a/mojo/public/cpp/bindings/tests/sync_method_unittest.cc |
+++ b/mojo/public/cpp/bindings/tests/sync_method_unittest.cc |
@@ -85,6 +85,29 @@ class TestSyncImpl : public TestSync, public TestSyncCommonImpl { |
DISALLOW_COPY_AND_ASSIGN(TestSyncImpl); |
}; |
+class TestSyncMasterImpl : public TestSyncMaster, public TestSyncCommonImpl { |
+ public: |
+ explicit TestSyncMasterImpl(TestSyncMasterRequest request) |
+ : binding_(this, std::move(request)) {} |
+ |
+ // TestSyncMaster implementation: |
+ void Ping(const PingCallback& callback) override { PingImpl(callback); } |
+ void Echo(int32_t value, const EchoCallback& callback) override { |
+ EchoImpl(value, callback); |
+ } |
+ void AsyncEcho(int32_t value, const AsyncEchoCallback& callback) override { |
+ AsyncEchoImpl(value, callback); |
+ } |
+ void SendInterface(TestSyncAssociatedPtrInfo ptr) override {} |
+ |
+ Binding<TestSyncMaster>* binding() { return &binding_; } |
+ |
+ private: |
+ Binding<TestSyncMaster> binding_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(TestSyncMasterImpl); |
+}; |
+ |
template <typename Interface> |
struct ImplTraits; |
@@ -93,6 +116,11 @@ struct ImplTraits<TestSync> { |
using Type = TestSyncImpl; |
}; |
+template <> |
+struct ImplTraits<TestSyncMaster> { |
+ using Type = TestSyncMasterImpl; |
+}; |
+ |
template <typename Interface> |
class TestSyncServiceThread { |
public: |
@@ -148,7 +176,9 @@ class SyncMethodCommonTest : public testing::Test { |
base::MessageLoop loop_; |
}; |
-using InterfaceTypes = testing::Types<TestSync>; |
+// TestSync and TestSyncMaster exercise Router and MultiplexRouter, |
+// respectively. |
+using InterfaceTypes = testing::Types<TestSync, TestSyncMaster>; |
TYPED_TEST_CASE(SyncMethodCommonTest, InterfaceTypes); |
TYPED_TEST(SyncMethodCommonTest, CallSyncMethodAsynchronously) { |