OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback_helpers.h" | 6 #include "base/callback_helpers.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "chromecast/media/cma/base/buffering_controller.h" | 10 #include "chromecast/media/cma/base/buffering_controller.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 } | 32 } |
33 | 33 |
34 MockBufferingControllerClient::~MockBufferingControllerClient() { | 34 MockBufferingControllerClient::~MockBufferingControllerClient() { |
35 } | 35 } |
36 | 36 |
37 } // namespace | 37 } // namespace |
38 | 38 |
39 class BufferingControllerTest : public testing::Test { | 39 class BufferingControllerTest : public testing::Test { |
40 public: | 40 public: |
41 BufferingControllerTest(); | 41 BufferingControllerTest(); |
42 virtual ~BufferingControllerTest(); | 42 ~BufferingControllerTest() override; |
43 | 43 |
44 protected: | 44 protected: |
45 scoped_ptr<BufferingController> buffering_controller_; | 45 scoped_ptr<BufferingController> buffering_controller_; |
46 | 46 |
47 MockBufferingControllerClient client_; | 47 MockBufferingControllerClient client_; |
48 | 48 |
49 // Buffer level under the low level threshold. | 49 // Buffer level under the low level threshold. |
50 base::TimeDelta d1_; | 50 base::TimeDelta d1_; |
51 | 51 |
52 // Buffer level between the low and the high level. | 52 // Buffer level between the low and the high level. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 buffering_controller_->AddStream("test"); | 124 buffering_controller_->AddStream("test"); |
125 buffering_state->SetMediaTime(base::TimeDelta()); | 125 buffering_state->SetMediaTime(base::TimeDelta()); |
126 | 126 |
127 EXPECT_CALL(client_, OnBufferingNotification(false)).Times(1); | 127 EXPECT_CALL(client_, OnBufferingNotification(false)).Times(1); |
128 buffering_state->NotifyEos(); | 128 buffering_state->NotifyEos(); |
129 EXPECT_EQ(buffering_state->GetState(), BufferingState::kEosReached); | 129 EXPECT_EQ(buffering_state->GetState(), BufferingState::kEosReached); |
130 } | 130 } |
131 | 131 |
132 } // namespace media | 132 } // namespace media |
133 } // namespace chromecast | 133 } // namespace chromecast |
OLD | NEW |