| 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 "media/base/text_ranges.h" | 5 #include "media/base/text_ranges.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 7 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 11 |
| 10 namespace media { | 12 namespace media { |
| 11 | 13 |
| 12 class TextRangesTest : public ::testing::Test { | 14 class TextRangesTest : public ::testing::Test { |
| 13 protected: | 15 protected: |
| 14 bool AddCue(int seconds) { | 16 bool AddCue(int seconds) { |
| 15 return ranges_.AddCue(base::TimeDelta::FromSeconds(seconds)); | 17 return ranges_.AddCue(base::TimeDelta::FromSeconds(seconds)); |
| 16 } | 18 } |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // Make first range active. | 140 // Make first range active. |
| 139 EXPECT_FALSE(AddCue(0)); | 141 EXPECT_FALSE(AddCue(0)); |
| 140 EXPECT_FALSE(AddCue(2)); | 142 EXPECT_FALSE(AddCue(2)); |
| 141 | 143 |
| 142 // Coalesce first and last ranges. | 144 // Coalesce first and last ranges. |
| 143 EXPECT_FALSE(AddCue(3)); | 145 EXPECT_FALSE(AddCue(3)); |
| 144 EXPECT_EQ(RangeCount(), 1U); | 146 EXPECT_EQ(RangeCount(), 1U); |
| 145 } | 147 } |
| 146 | 148 |
| 147 } // namespace media | 149 } // namespace media |
| OLD | NEW |