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 "media/base/download_rate_monitor.h" | 5 #include "media/base/download_rate_monitor.h" |
6 | 6 |
| 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" |
7 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
9 | 11 |
10 using ::testing::Mock; | 12 using ::testing::Mock; |
11 | 13 |
12 namespace media { | 14 namespace media { |
13 | 15 |
14 class DownloadRateMonitorTest : public ::testing::Test { | 16 class DownloadRateMonitorTest : public ::testing::Test { |
15 public: | 17 public: |
16 DownloadRateMonitorTest() { | 18 DownloadRateMonitorTest() { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 static const int seconds_of_data = 20; | 156 static const int seconds_of_data = 20; |
155 static const int media_bitrate = kMediaSizeInBytes * 8 / seconds_of_data; | 157 static const int media_bitrate = kMediaSizeInBytes * 8 / seconds_of_data; |
156 | 158 |
157 // Simulate downloading entire video at half the bitrate of the video. | 159 // Simulate downloading entire video at half the bitrate of the video. |
158 StartMonitor(media_bitrate); | 160 StartMonitor(media_bitrate); |
159 EXPECT_CALL(*this, CanPlayThrough()); | 161 EXPECT_CALL(*this, CanPlayThrough()); |
160 SimulateNetwork(1, 0, media_bitrate / 8 / 2, 1000, seconds_of_data * 2); | 162 SimulateNetwork(1, 0, media_bitrate / 8 / 2, 1000, seconds_of_data * 2); |
161 } | 163 } |
162 | 164 |
163 } // namespace media | 165 } // namespace media |
OLD | NEW |