OLD | NEW |
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 #include <string> | 5 #include <string> |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/stl_util-inl.h" | 8 #include "base/stl_util-inl.h" |
9 #include "media/base/pipeline_impl.h" | 9 #include "media/base/pipeline_impl.h" |
10 #include "media/base/media_format.h" | 10 #include "media/base/media_format.h" |
11 #include "media/base/filters.h" | 11 #include "media/base/filters.h" |
12 #include "media/base/filter_host.h" | 12 #include "media/base/filter_host.h" |
13 #include "media/base/mock_callback.h" | 13 #include "media/base/mock_callback.h" |
14 #include "media/base/mock_filters.h" | 14 #include "media/base/mock_filters.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 using ::testing::_; | 17 using ::testing::_; |
18 using ::testing::DeleteArg; | 18 using ::testing::DeleteArg; |
19 using ::testing::InSequence; | 19 using ::testing::InSequence; |
20 using ::testing::Invoke; | 20 using ::testing::Invoke; |
21 using ::testing::Mock; | 21 using ::testing::Mock; |
22 using ::testing::NotNull; | 22 using ::testing::NotNull; |
23 using ::testing::Return; | 23 using ::testing::Return; |
24 using ::testing::ReturnRef; | 24 using ::testing::ReturnRef; |
25 using ::testing::StrictMock; | 25 using ::testing::StrictMock; |
26 | 26 |
27 namespace { | 27 namespace media { |
28 | 28 |
29 // Total bytes of the data source. | 29 // Total bytes of the data source. |
30 const int kTotalBytes = 1024; | 30 static const int kTotalBytes = 1024; |
31 | 31 |
32 // Buffered bytes of the data source. | 32 // Buffered bytes of the data source. |
33 const int kBufferedBytes = 1024; | 33 static const int kBufferedBytes = 1024; |
34 | |
35 } // namespace | |
36 | |
37 namespace media { | |
38 | 34 |
39 // Used for setting expectations on pipeline callbacks. Using a StrictMock | 35 // Used for setting expectations on pipeline callbacks. Using a StrictMock |
40 // also lets us test for missing callbacks. | 36 // also lets us test for missing callbacks. |
41 class CallbackHelper { | 37 class CallbackHelper { |
42 public: | 38 public: |
43 CallbackHelper() {} | 39 CallbackHelper() {} |
44 virtual ~CallbackHelper() {} | 40 virtual ~CallbackHelper() {} |
45 | 41 |
46 MOCK_METHOD0(OnStart, void()); | 42 MOCK_METHOD0(OnStart, void()); |
47 MOCK_METHOD0(OnSeek, void()); | 43 MOCK_METHOD0(OnSeek, void()); |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 .WillOnce(DoAll(SetError(mocks_->demuxer(), | 828 .WillOnce(DoAll(SetError(mocks_->demuxer(), |
833 PIPELINE_ERROR_READ), | 829 PIPELINE_ERROR_READ), |
834 Invoke(&RunFilterCallback))); | 830 Invoke(&RunFilterCallback))); |
835 | 831 |
836 pipeline_->Seek(seek_time, NewExpectedCallback()); | 832 pipeline_->Seek(seek_time, NewExpectedCallback()); |
837 EXPECT_CALL(callbacks_, OnError()); | 833 EXPECT_CALL(callbacks_, OnError()); |
838 message_loop_.RunAllPending(); | 834 message_loop_.RunAllPending(); |
839 } | 835 } |
840 | 836 |
841 } // namespace media | 837 } // namespace media |
OLD | NEW |