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 "content/renderer/media/buffered_data_source_host_impl.h" | 5 #include "media/blink/buffered_data_source_host_impl.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
7 | 7 |
8 namespace content { | 8 namespace media { |
9 | 9 |
10 class BufferedDataSourceHostImplTest : public testing::Test { | 10 class BufferedDataSourceHostImplTest : public testing::Test { |
11 public: | 11 public: |
12 BufferedDataSourceHostImplTest() {} | 12 BufferedDataSourceHostImplTest() {} |
13 | 13 |
14 void Add() { | 14 void Add() { |
15 host_.AddBufferedTimeRanges(&ranges_, base::TimeDelta::FromSeconds(10)); | 15 host_.AddBufferedTimeRanges(&ranges_, base::TimeDelta::FromSeconds(10)); |
16 } | 16 } |
17 | 17 |
18 protected: | 18 protected: |
19 BufferedDataSourceHostImpl host_; | 19 BufferedDataSourceHostImpl host_; |
20 media::Ranges<base::TimeDelta> ranges_; | 20 Ranges<base::TimeDelta> ranges_; |
21 | 21 |
22 DISALLOW_COPY_AND_ASSIGN(BufferedDataSourceHostImplTest); | 22 DISALLOW_COPY_AND_ASSIGN(BufferedDataSourceHostImplTest); |
23 }; | 23 }; |
24 | 24 |
25 TEST_F(BufferedDataSourceHostImplTest, Empty) { | 25 TEST_F(BufferedDataSourceHostImplTest, Empty) { |
26 EXPECT_FALSE(host_.DidLoadingProgress()); | 26 EXPECT_FALSE(host_.DidLoadingProgress()); |
27 Add(); | 27 Add(); |
28 EXPECT_EQ(0u, ranges_.size()); | 28 EXPECT_EQ(0u, ranges_.size()); |
29 } | 29 } |
30 | 30 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 Add(); | 65 Add(); |
66 EXPECT_EQ(1u, ranges_.size()); | 66 EXPECT_EQ(1u, ranges_.size()); |
67 } | 67 } |
68 | 68 |
69 TEST_F(BufferedDataSourceHostImplTest, DidLoadingProgress) { | 69 TEST_F(BufferedDataSourceHostImplTest, DidLoadingProgress) { |
70 host_.AddBufferedByteRange(10, 20); | 70 host_.AddBufferedByteRange(10, 20); |
71 EXPECT_TRUE(host_.DidLoadingProgress()); | 71 EXPECT_TRUE(host_.DidLoadingProgress()); |
72 EXPECT_FALSE(host_.DidLoadingProgress()); | 72 EXPECT_FALSE(host_.DidLoadingProgress()); |
73 } | 73 } |
74 | 74 |
75 } // namespace content | 75 } // namespace media |
OLD | NEW |