Chromium Code Reviews| 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 "base/threading/simple_thread.h" | 9 #include "base/threading/simple_thread.h" |
| 10 #include "media/base/pipeline_impl.h" | 10 #include "media/base/pipeline_impl.h" |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 | 27 |
| 28 namespace media { | 28 namespace media { |
| 29 | 29 |
| 30 // Total bytes of the data source. | 30 // Total bytes of the data source. |
| 31 static const int kTotalBytes = 1024; | 31 static const int kTotalBytes = 1024; |
| 32 | 32 |
| 33 // Buffered bytes of the data source. | 33 // Buffered bytes of the data source. |
| 34 static const int kBufferedBytes = 1024; | 34 static const int kBufferedBytes = 1024; |
| 35 | 35 |
| 36 // Test url for raw video pipeline. | 36 // Test url for raw video pipeline. |
| 37 static const std::string kUrlMedia = "media://raw_video_stream"; | 37 static const std::string kUrlMedia = std::string(kRawVideoScheme) + |
|
scherkus (not reviewing)
2011/06/24 21:33:39
this really shouldn't be a std::string (we only us
Ronghua
2011/06/27 22:34:51
Done.
| |
| 38 std::string("://raw_video_stream"); | |
| 38 | 39 |
| 39 // Used for setting expectations on pipeline callbacks. Using a StrictMock | 40 // Used for setting expectations on pipeline callbacks. Using a StrictMock |
| 40 // also lets us test for missing callbacks. | 41 // also lets us test for missing callbacks. |
| 41 class CallbackHelper { | 42 class CallbackHelper { |
| 42 public: | 43 public: |
| 43 CallbackHelper() {} | 44 CallbackHelper() {} |
| 44 virtual ~CallbackHelper() {} | 45 virtual ~CallbackHelper() {} |
| 45 | 46 |
| 46 MOCK_METHOD1(OnStart, void(PipelineStatus)); | 47 MOCK_METHOD1(OnStart, void(PipelineStatus)); |
| 47 MOCK_METHOD1(OnSeek, void(PipelineStatus)); | 48 MOCK_METHOD1(OnSeek, void(PipelineStatus)); |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 892 TestPipelineStatusNotification(0); | 893 TestPipelineStatusNotification(0); |
| 893 } | 894 } |
| 894 | 895 |
| 895 // Test that different-thread, some-delay callback (the expected common case) | 896 // Test that different-thread, some-delay callback (the expected common case) |
| 896 // works correctly. | 897 // works correctly. |
| 897 TEST(PipelineStatusNotificationTest, DelayedCallback) { | 898 TEST(PipelineStatusNotificationTest, DelayedCallback) { |
| 898 TestPipelineStatusNotification(20); | 899 TestPipelineStatusNotification(20); |
| 899 } | 900 } |
| 900 | 901 |
| 901 } // namespace media | 902 } // namespace media |
| OLD | NEW |