Chromium Code Reviews| 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/macros.h" | 5 #include "base/macros.h" |
| 6 #include "media/blink/buffered_data_source_host_impl.h" | 6 #include "media/blink/buffered_data_source_host_impl.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace media { | 9 namespace media { |
| 10 | 10 |
| 11 class BufferedDataSourceHostImplTest : public testing::Test { | 11 class BufferedDataSourceHostImplTest : public testing::Test { |
| 12 public: | 12 public: |
| 13 BufferedDataSourceHostImplTest() {} | 13 BufferedDataSourceHostImplTest() : host_(base::Closure()) {} |
|
chcunningham
2017/04/06 16:55:41
Add a test?
hubbe
2017/04/06 21:25:38
Done.
| |
| 14 | 14 |
| 15 void Add() { | 15 void Add() { |
| 16 host_.AddBufferedTimeRanges(&ranges_, base::TimeDelta::FromSeconds(10)); | 16 host_.AddBufferedTimeRanges(&ranges_, base::TimeDelta::FromSeconds(10)); |
| 17 } | 17 } |
| 18 | 18 |
| 19 protected: | 19 protected: |
| 20 BufferedDataSourceHostImpl host_; | 20 BufferedDataSourceHostImpl host_; |
| 21 Ranges<base::TimeDelta> ranges_; | 21 Ranges<base::TimeDelta> ranges_; |
| 22 | 22 |
| 23 DISALLOW_COPY_AND_ASSIGN(BufferedDataSourceHostImplTest); | 23 DISALLOW_COPY_AND_ASSIGN(BufferedDataSourceHostImplTest); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 EXPECT_EQ(1u, ranges_.size()); | 67 EXPECT_EQ(1u, ranges_.size()); |
| 68 } | 68 } |
| 69 | 69 |
| 70 TEST_F(BufferedDataSourceHostImplTest, DidLoadingProgress) { | 70 TEST_F(BufferedDataSourceHostImplTest, DidLoadingProgress) { |
| 71 host_.AddBufferedByteRange(10, 20); | 71 host_.AddBufferedByteRange(10, 20); |
| 72 EXPECT_TRUE(host_.DidLoadingProgress()); | 72 EXPECT_TRUE(host_.DidLoadingProgress()); |
| 73 EXPECT_FALSE(host_.DidLoadingProgress()); | 73 EXPECT_FALSE(host_.DidLoadingProgress()); |
| 74 } | 74 } |
| 75 | 75 |
| 76 } // namespace media | 76 } // namespace media |
| OLD | NEW |