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

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

Issue 6686061: PipelineError is dead. Long live PipelineStatus! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: responses to 2nd CR Created 9 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 | Annotate | Revision Log
« no previous file with comments | « media/base/filter_host.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"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // Convenience function to set expectations for the callback to execute and 44 // Convenience function to set expectations for the callback to execute and
45 // deleted. 45 // deleted.
46 void ExpectRunAndDelete(); 46 void ExpectRunAndDelete();
47 47
48 private: 48 private:
49 DISALLOW_COPY_AND_ASSIGN(MockCallback); 49 DISALLOW_COPY_AND_ASSIGN(MockCallback);
50 }; 50 };
51 51
52 // Helper class similar to MockCallback but is used where a 52 // Helper class similar to MockCallback but is used where a
53 // PipelineStatusCallback is needed. 53 // PipelineStatusCallback is needed.
54 class MockStatusCallback : public CallbackRunner<Tuple1<PipelineError> > { 54 class MockStatusCallback : public CallbackRunner<Tuple1<PipelineStatus> > {
55 public: 55 public:
56 MockStatusCallback(); 56 MockStatusCallback();
57 virtual ~MockStatusCallback(); 57 virtual ~MockStatusCallback();
58 58
59 MOCK_METHOD1(RunWithParams, void(const Tuple1<PipelineError>& params)); 59 MOCK_METHOD1(RunWithParams, void(const Tuple1<PipelineStatus>& params));
60 60
61 // Can be used to verify the object is destroyed. 61 // Can be used to verify the object is destroyed.
62 MOCK_METHOD0(Destructor, void()); 62 MOCK_METHOD0(Destructor, void());
63 63
64 // Convenience function to set expectations for the callback to execute and 64 // Convenience function to set expectations for the callback to execute and
65 // deleted. 65 // deleted.
66 void ExpectRunAndDelete(PipelineError error); 66 void ExpectRunAndDelete(PipelineStatus status);
67 67
68 private: 68 private:
69 DISALLOW_COPY_AND_ASSIGN(MockStatusCallback); 69 DISALLOW_COPY_AND_ASSIGN(MockStatusCallback);
70 }; 70 };
71 71
72 // Convenience functions that automatically create and set an expectation for 72 // Convenience functions that automatically create and set an expectation for
73 // the callback to run. 73 // the callback to run.
74 MockCallback* NewExpectedCallback(); 74 MockCallback* NewExpectedCallback();
75 MockStatusCallback* NewExpectedStatusCallback(PipelineError error); 75 MockStatusCallback* NewExpectedStatusCallback(PipelineStatus status);
76 76
77 } // namespace media 77 } // namespace media
78 78
79 #endif // MEDIA_BASE_MOCK_CALLBACK_H_ 79 #endif // MEDIA_BASE_MOCK_CALLBACK_H_
OLDNEW
« no previous file with comments | « media/base/filter_host.h ('k') | media/base/mock_callback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698