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

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

Issue 11316293: Replace WaitableEvents and ConditionalVariables in VideoRendererBase tests with MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bustage Created 8 years 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/mock_callback.h ('k') | media/base/pipeline_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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.
4
5 #include "media/base/mock_callback.h"
6
7 #include "base/bind.h"
8
9 using ::testing::_;
10 using ::testing::StrictMock;
11
12 namespace media {
13
14 MockClosure::MockClosure() {}
15 MockClosure::~MockClosure() {}
16
17 base::Closure NewExpectedClosure() {
18 StrictMock<MockClosure>* callback = new StrictMock<MockClosure>();
19 EXPECT_CALL(*callback, Run());
20 return base::Bind(&MockClosure::Run, callback);
21 }
22
23 class MockStatusCB : public base::RefCountedThreadSafe<MockStatusCB> {
24 public:
25 MockStatusCB() {}
26 MOCK_METHOD1(Run, void(PipelineStatus));
27
28 protected:
29 friend class base::RefCountedThreadSafe<MockStatusCB>;
30 virtual ~MockStatusCB() {}
31
32 private:
33 DISALLOW_COPY_AND_ASSIGN(MockStatusCB);
34 };
35
36 base::Callback<void(PipelineStatus)> NewExpectedStatusCB(
37 PipelineStatus status) {
38 StrictMock<MockStatusCB>* callback = new StrictMock<MockStatusCB>();
39 EXPECT_CALL(*callback, Run(status));
40 return base::Bind(&MockStatusCB::Run, callback);
41 }
42
43 } // namespace media
OLDNEW
« no previous file with comments | « media/base/mock_callback.h ('k') | media/base/pipeline_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698