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 b0943783879967e50a947624e50cb1e64aa79506..c019d38c2204a4b7796e153073d413c580a01cd3 100644 |
--- a/mojo/common/common_custom_types_unittest.cc |
+++ b/mojo/common/common_custom_types_unittest.cc |
@@ -7,6 +7,7 @@ |
#include "base/memory/ptr_util.h" |
#include "base/message_loop/message_loop.h" |
#include "base/numerics/safe_math.h" |
+#include "base/process/process_handle.h" |
#include "base/run_loop.h" |
#include "base/strings/utf_string_conversions.h" |
#include "base/values.h" |
@@ -32,6 +33,11 @@ struct PassTraits { |
}; |
template <> |
+struct PassTraits<base::ProcessId> { |
+ using Type = base::ProcessId; |
+}; |
+ |
+template <> |
struct PassTraits<base::Time> { |
using Type = base::Time; |
}; |
@@ -91,6 +97,21 @@ class TestUnguessableTokenImpl : public TestUnguessableToken { |
mojo::Binding<TestUnguessableToken> binding_; |
}; |
+class TestProcessIdImpl : public TestProcessId { |
+ public: |
+ explicit TestProcessIdImpl(TestProcessIdRequest request) |
+ : binding_(this, std::move(request)) {} |
+ |
+ // TestProcessId implementation: |
+ void BounceProcessId(base::ProcessId in, |
+ const BounceProcessIdCallback& callback) override { |
+ callback.Run(in); |
+ } |
+ |
+ private: |
+ mojo::Binding<TestProcessId> binding_; |
+}; |
+ |
class TestTimeImpl : public TestTime { |
public: |
explicit TestTimeImpl(TestTimeRequest request) |
@@ -226,6 +247,19 @@ TEST_F(CommonCustomTypesTest, UnguessableToken) { |
run_loop.Run(); |
} |
+TEST_F(CommonCustomTypesTest, ProcessId) { |
+ base::RunLoop run_loop; |
+ |
+ TestProcessIdPtr ptr; |
+ TestProcessIdImpl impl(MakeRequest(&ptr)); |
+ |
+ base::ProcessId pid = base::GetCurrentProcId(); |
+ |
+ ptr->BounceProcessId(pid, ExpectResponse(&pid, run_loop.QuitClosure())); |
+ |
+ run_loop.Run(); |
+} |
+ |
TEST_F(CommonCustomTypesTest, Time) { |
base::RunLoop run_loop; |