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

Side by Side Diff: media/base/mock_callback.h

Issue 10067035: RefCounted types should not have public destructors, media/ and gpu/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « media/base/filters.h ('k') | media/base/mock_callback.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 MEDIA_BASE_MOCK_CALLBACK_H_ 5 #ifndef MEDIA_BASE_MOCK_CALLBACK_H_
6 #define MEDIA_BASE_MOCK_CALLBACK_H_ 6 #define MEDIA_BASE_MOCK_CALLBACK_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "media/base/pipeline_status.h" 9 #include "media/base/pipeline_status.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
11 11
12 namespace media { 12 namespace media {
13 13
14 // Utility mock for testing methods expecting Closures. See 14 // Utility mock for testing methods expecting Closures. See
15 // NewExpectedClosure() below for a helper suitable when expectation order is 15 // NewExpectedClosure() below for a helper suitable when expectation order is
16 // not checked (or when the expectation can be set at mock construction time). 16 // not checked (or when the expectation can be set at mock construction time).
17 class MockClosure : public base::RefCountedThreadSafe<MockClosure> { 17 class MockClosure : public base::RefCountedThreadSafe<MockClosure> {
18 public: 18 public:
19 MockClosure(); 19 MockClosure();
20 MOCK_METHOD0(Run, void());
21
22 protected:
23 friend class base::RefCountedThreadSafe<MockClosure>;
20 virtual ~MockClosure(); 24 virtual ~MockClosure();
21 MOCK_METHOD0(Run, void()); 25
22 private: 26 private:
23 DISALLOW_COPY_AND_ASSIGN(MockClosure); 27 DISALLOW_COPY_AND_ASSIGN(MockClosure);
24 }; 28 };
25 29
26 // Return a callback that expects to be run once. 30 // Return a callback that expects to be run once.
27 base::Closure NewExpectedClosure(); 31 base::Closure NewExpectedClosure();
28 base::Callback<void(PipelineStatus)> NewExpectedStatusCB(PipelineStatus status); 32 base::Callback<void(PipelineStatus)> NewExpectedStatusCB(PipelineStatus status);
29 33
30 } // namespace media 34 } // namespace media
31 35
32 #endif // MEDIA_BASE_MOCK_CALLBACK_H_ 36 #endif // MEDIA_BASE_MOCK_CALLBACK_H_
OLDNEW
« no previous file with comments | « media/base/filters.h ('k') | media/base/mock_callback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698