OLD | NEW |
| (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 | |
OLD | NEW |