OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/threading/simple_thread.h" | 10 #include "base/threading/simple_thread.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 using ::testing::Return; | 27 using ::testing::Return; |
28 using ::testing::ReturnRef; | 28 using ::testing::ReturnRef; |
29 using ::testing::SaveArg; | 29 using ::testing::SaveArg; |
30 using ::testing::StrictMock; | 30 using ::testing::StrictMock; |
31 using ::testing::WithArg; | 31 using ::testing::WithArg; |
32 | 32 |
33 namespace media { | 33 namespace media { |
34 | 34 |
35 // Demuxer properties. | 35 // Demuxer properties. |
36 static const int kTotalBytes = 1024; | 36 static const int kTotalBytes = 1024; |
37 static const int kBufferedBytes = 1024; | |
38 static const int kBitrate = 1234; | 37 static const int kBitrate = 1234; |
39 | 38 |
40 ACTION_P(SetDemuxerProperties, duration) { | 39 ACTION_P(SetDemuxerProperties, duration) { |
41 arg0->SetTotalBytes(kTotalBytes); | 40 arg0->SetTotalBytes(kTotalBytes); |
42 arg0->SetDuration(duration); | 41 arg0->SetDuration(duration); |
43 } | 42 } |
44 | 43 |
45 ACTION(RunPipelineStatusCB1) { | 44 ACTION(RunPipelineStatusCB1) { |
46 arg1.Run(PIPELINE_OK); | 45 arg1.Run(PIPELINE_OK); |
47 } | 46 } |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 TestPipelineStatusNotification(base::TimeDelta::FromMilliseconds(0)); | 955 TestPipelineStatusNotification(base::TimeDelta::FromMilliseconds(0)); |
957 } | 956 } |
958 | 957 |
959 // Test that different-thread, some-delay callback (the expected common case) | 958 // Test that different-thread, some-delay callback (the expected common case) |
960 // works correctly. | 959 // works correctly. |
961 TEST(PipelineStatusNotificationTest, DelayedCallback) { | 960 TEST(PipelineStatusNotificationTest, DelayedCallback) { |
962 TestPipelineStatusNotification(base::TimeDelta::FromMilliseconds(20)); | 961 TestPipelineStatusNotification(base::TimeDelta::FromMilliseconds(20)); |
963 } | 962 } |
964 | 963 |
965 } // namespace media | 964 } // namespace media |
OLD | NEW |