1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef REMOTING_HOST_MOCK_CALLBACK_H_
6 #define REMOTING_HOST_MOCK_CALLBACK_H_
8 // TODO(lukasza): If possible, move this header file to base/mock_callback.h
10 #include "base/bind.h"
11 #include "base/bind_helpers.h"
12 #include "base/callback.h"
14 #include "testing/gmock/include/gmock/gmock.h"
18 template <typename Sig
>
22 class MockCallback
<R()> {
24 MOCK_CONST_METHOD0_T(Run
, R());
29 // Caller of GetCallback has to guarantee that the returned callback
30 // will not be run after |this| is destroyed.
31 base::Callback
<R()> GetCallback() {
32 return base::Bind(&MockCallback
<R()>::Run
, base::Unretained(this));
36 DISALLOW_COPY_AND_ASSIGN(MockCallback
);
39 typedef MockCallback
<void(void)> MockClosure
;
41 } // namespace remoting
43 #endif // REMOTING_HOST_MOCK_CALLBACK_H_