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

Side by Side Diff: media/base/android/media_codec_loop_unittest.cc

Issue 2016213003: Separate MediaCodecLoop from MediaCodecAudioDecoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cl feedback Created 4 years, 6 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
OLDNEW
(Empty)
1 // Copyright 2016 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 "base/macros.h"
6 #include "base/message_loop/message_loop.h"
7 #include "media/base/android/media_codec_bridge.h"
8 #include "media/base/android/media_codec_loop.h"
9 #include "testing/gmock/include/gmock/gmock.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11
12 namespace media {
13
14 class MockMediaCodecLoopClient : public MediaCodecLoop::Client {
15 public:
16 MOCK_CONST_METHOD0(IsAnyInputPending, bool());
17 MOCK_METHOD0(ProvideInputData, MediaCodecLoop::InputData());
18 MOCK_METHOD1(OnDecodedEos, void(const MediaCodecLoop::OutputBuffer&));
19 MOCK_METHOD1(OnDecodedFrame, bool(const MediaCodecLoop::OutputBuffer&));
20 MOCK_METHOD0(OnOutputFormatChanged, bool());
21 MOCK_METHOD0(OnCodecLoopError, void());
22 };
23
24 class MediaCodecLoopTest : public testing::Test {
25 public:
26 MediaCodecLoopTest() : client_(new MockMediaCodecLoopClient) {}
27
28 public:
29 std::unique_ptr<MediaCodecLoop> codec_loop_;
30 std::unique_ptr<MockMediaCodecLoopClient> client_;
31
32 DISALLOW_COPY_AND_ASSIGN(MediaCodecLoopTest);
33 };
34
35 TEST_F(MediaCodecLoopTest, TestConstructionWithNullCodec) {
36 std::unique_ptr<MediaCodecBridge> codec;
37 EXPECT_CALL(*client_, OnCodecLoopError()).Times(1);
38 codec_loop_.reset(new MediaCodecLoop(client_.get(), std::move(codec)));
39
40 ASSERT_FALSE(codec_loop_->GetCodec());
41 }
42
43 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698