roll skia to 4057
[chromium-blink-merge.git] / media / base / mock_callback.h
blob00d8276067cb441763d23544f8eff69ba0d43159
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.
5 #ifndef MEDIA_BASE_MOCK_CALLBACK_H_
6 #define MEDIA_BASE_MOCK_CALLBACK_H_
8 #include "base/callback.h"
9 #include "media/base/pipeline_status.h"
10 #include "testing/gmock/include/gmock/gmock.h"
12 namespace media {
14 // Utility mock for testing methods expecting Closures. See
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).
17 class MockClosure : public base::RefCountedThreadSafe<MockClosure> {
18 public:
19 MockClosure();
20 MOCK_METHOD0(Run, void());
22 protected:
23 friend class base::RefCountedThreadSafe<MockClosure>;
24 virtual ~MockClosure();
26 private:
27 DISALLOW_COPY_AND_ASSIGN(MockClosure);
30 // Return a callback that expects to be run once.
31 base::Closure NewExpectedClosure();
32 base::Callback<void(PipelineStatus)> NewExpectedStatusCB(PipelineStatus status);
34 } // namespace media
36 #endif // MEDIA_BASE_MOCK_CALLBACK_H_