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 7e8252dbc613a33b6c0acc69c0730a3041837d69..d6ec8f7f855c5b5756ee1fafb07b745f01563461 100644 |
--- a/mojo/common/common_custom_types_unittest.cc |
+++ b/mojo/common/common_custom_types_unittest.cc |
@@ -90,6 +90,21 @@ class TestFilePathImpl : public TestFilePath { |
mojo::Binding<TestFilePath> binding_; |
}; |
+class TestUnguessableTokenImpl : public TestUnguessableToken { |
+ public: |
+ explicit TestUnguessableTokenImpl(TestUnguessableTokenRequest request) |
+ : binding_(this, std::move(request)) {} |
+ |
+ // TestUnguessableToken implementation: |
+ void BounceNonce(const base::UnguessableToken& in, |
+ const BounceNonceCallback& callback) override { |
+ callback.Run(in); |
+ } |
+ |
+ private: |
+ mojo::Binding<TestUnguessableToken> binding_; |
+}; |
+ |
class TestTimeImpl : public TestTime { |
public: |
explicit TestTimeImpl(TestTimeRequest request) |
@@ -176,6 +191,19 @@ TEST_F(CommonCustomTypesTest, FilePath) { |
run_loop.Run(); |
} |
+TEST_F(CommonCustomTypesTest, UnguessableToken) { |
+ base::RunLoop run_loop; |
+ |
+ TestUnguessableTokenPtr ptr; |
+ TestUnguessableTokenImpl impl(GetProxy(&ptr)); |
+ |
+ base::UnguessableToken token = base::UnguessableToken::Create(); |
+ |
+ ptr->BounceNonce(token, ExpectResponse(&token, run_loop.QuitClosure())); |
+ |
+ run_loop.Run(); |
+} |
+ |
TEST_F(CommonCustomTypesTest, Time) { |
base::RunLoop run_loop; |