| 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 29 matching lines...) Expand all Loading... |
| 40 ACTION_P(InitializeDemuxerWithError, error) { | 40 ACTION_P(InitializeDemuxerWithError, error) { |
| 41 arg1.Run(error); | 41 arg1.Run(error); |
| 42 } | 42 } |
| 43 | 43 |
| 44 ACTION_P(SetDemuxerProperties, duration) { | 44 ACTION_P(SetDemuxerProperties, duration) { |
| 45 arg0->SetTotalBytes(kTotalBytes); | 45 arg0->SetTotalBytes(kTotalBytes); |
| 46 arg0->SetDuration(duration); | 46 arg0->SetDuration(duration); |
| 47 } | 47 } |
| 48 | 48 |
| 49 ACTION_P(DisableAudioRenderer, pipeline) { | 49 ACTION_P(DisableAudioRenderer, pipeline) { |
| 50 FilterHost* host = pipeline; | 50 AudioRendererHost* host = pipeline; |
| 51 host->DisableAudioRenderer(); | 51 host->AudioRendererDisabled(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 // Used for setting expectations on pipeline callbacks. Using a StrictMock | 54 // Used for setting expectations on pipeline callbacks. Using a StrictMock |
| 55 // also lets us test for missing callbacks. | 55 // also lets us test for missing callbacks. |
| 56 class CallbackHelper { | 56 class CallbackHelper { |
| 57 public: | 57 public: |
| 58 CallbackHelper() {} | 58 CallbackHelper() {} |
| 59 virtual ~CallbackHelper() {} | 59 virtual ~CallbackHelper() {} |
| 60 | 60 |
| 61 MOCK_METHOD1(OnStart, void(PipelineStatus)); | 61 MOCK_METHOD1(OnStart, void(PipelineStatus)); |
| (...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 TestPipelineStatusNotification(base::TimeDelta::FromMilliseconds(0)); | 910 TestPipelineStatusNotification(base::TimeDelta::FromMilliseconds(0)); |
| 911 } | 911 } |
| 912 | 912 |
| 913 // Test that different-thread, some-delay callback (the expected common case) | 913 // Test that different-thread, some-delay callback (the expected common case) |
| 914 // works correctly. | 914 // works correctly. |
| 915 TEST(PipelineStatusNotificationTest, DelayedCallback) { | 915 TEST(PipelineStatusNotificationTest, DelayedCallback) { |
| 916 TestPipelineStatusNotification(base::TimeDelta::FromMilliseconds(20)); | 916 TestPipelineStatusNotification(base::TimeDelta::FromMilliseconds(20)); |
| 917 } | 917 } |
| 918 | 918 |
| 919 } // namespace media | 919 } // namespace media |
| OLD | NEW |