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

Side by Side Diff: testing/gmock_mutant.h

Issue 2758713002: Avoid to use the method pointer to Callback<>::Run on gmock tests (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « media/renderers/video_renderer_impl_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef TESTING_GMOCK_MUTANT_H_ 5 #ifndef TESTING_GMOCK_MUTANT_H_
6 #define TESTING_GMOCK_MUTANT_H_ 6 #define TESTING_GMOCK_MUTANT_H_
7 7
8 // The intention of this file is to make possible using GMock actions in 8 // The intention of this file is to make possible using GMock actions in
9 // all of its syntactic beauty. 9 // all of its syntactic beauty.
10 // 10 //
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 private: 106 private:
107 base::Callback<R(Args...)> cb_; 107 base::Callback<R(Args...)> cb_;
108 }; 108 };
109 109
110 template <typename Signature> 110 template <typename Signature>
111 CallbackToFunctorHelper<Signature> 111 CallbackToFunctorHelper<Signature>
112 CallbackToFunctor(const base::Callback<Signature>& cb) { 112 CallbackToFunctor(const base::Callback<Signature>& cb) {
113 return CallbackToFunctorHelper<Signature>(cb); 113 return CallbackToFunctorHelper<Signature>(cb);
114 } 114 }
115 115
116 template <typename Functor>
117 CallbackToFunctorHelper<typename Functor::RunType> CreateFunctor(
118 Functor functor) {
119 return CallbackToFunctor(functor);
120 }
121
116 template <typename Functor, typename... BoundArgs> 122 template <typename Functor, typename... BoundArgs>
117 CallbackToFunctorHelper<base::MakeUnboundRunType<Functor, BoundArgs...>> 123 CallbackToFunctorHelper<base::MakeUnboundRunType<Functor, BoundArgs...>>
118 CreateFunctor(Functor functor, const BoundArgs&... args) { 124 CreateFunctor(Functor functor, const BoundArgs&... args) {
119 return CallbackToFunctor(base::Bind(functor, args...)); 125 return CallbackToFunctor(base::Bind(functor, args...));
120 } 126 }
121 127
122 } // namespace testing 128 } // namespace testing
123 129
124 #endif // TESTING_GMOCK_MUTANT_H_ 130 #endif // TESTING_GMOCK_MUTANT_H_
OLDNEW
« no previous file with comments | « media/renderers/video_renderer_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698