| 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 <stdint.h> |
| 6 |
| 5 #include <vector> | 7 #include <vector> |
| 6 | 8 |
| 7 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 8 #include "base/test/simple_test_tick_clock.h" | 10 #include "base/test/simple_test_tick_clock.h" |
| 9 #include "base/time/tick_clock.h" | 11 #include "base/time/tick_clock.h" |
| 10 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 11 #include "media/cast/logging/logging_defines.h" | 13 #include "media/cast/logging/logging_defines.h" |
| 12 #include "media/cast/logging/logging_impl.h" | 14 #include "media/cast/logging/logging_impl.h" |
| 13 #include "media/cast/logging/simple_event_subscriber.h" | 15 #include "media/cast/logging/simple_event_subscriber.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 17 |
| 16 namespace media { | 18 namespace media { |
| 17 namespace cast { | 19 namespace cast { |
| 18 | 20 |
| 19 // Insert frame duration- one second. | 21 // Insert frame duration- one second. |
| 20 const int64 kIntervalTime1S = 1; | 22 const int64 kIntervalTime1S = 1; |
| 21 // Test frame rate goal - 30fps. | 23 // Test frame rate goal - 30fps. |
| 22 const int kFrameIntervalMs = 33; | 24 const int kFrameIntervalMs = 33; |
| 23 | 25 |
| 24 static const int64 kStartMillisecond = GG_INT64_C(12345678900000); | 26 static const int64 kStartMillisecond = INT64_C(12345678900000); |
| 25 | 27 |
| 26 class LoggingImplTest : public ::testing::Test { | 28 class LoggingImplTest : public ::testing::Test { |
| 27 protected: | 29 protected: |
| 28 LoggingImplTest() { | 30 LoggingImplTest() { |
| 29 testing_clock_.Advance( | 31 testing_clock_.Advance( |
| 30 base::TimeDelta::FromMilliseconds(kStartMillisecond)); | 32 base::TimeDelta::FromMilliseconds(kStartMillisecond)); |
| 31 logging_.AddRawEventSubscriber(&event_subscriber_); | 33 logging_.AddRawEventSubscriber(&event_subscriber_); |
| 32 } | 34 } |
| 33 | 35 |
| 34 virtual ~LoggingImplTest() { | 36 virtual ~LoggingImplTest() { |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 EXPECT_EQ(1u, frame_events.size()); | 282 EXPECT_EQ(1u, frame_events.size()); |
| 281 frame_events.clear(); | 283 frame_events.clear(); |
| 282 event_subscriber_2.GetFrameEventsAndReset(&frame_events); | 284 event_subscriber_2.GetFrameEventsAndReset(&frame_events); |
| 283 EXPECT_EQ(1u, frame_events.size()); | 285 EXPECT_EQ(1u, frame_events.size()); |
| 284 | 286 |
| 285 logging_.RemoveRawEventSubscriber(&event_subscriber_2); | 287 logging_.RemoveRawEventSubscriber(&event_subscriber_2); |
| 286 } | 288 } |
| 287 | 289 |
| 288 } // namespace cast | 290 } // namespace cast |
| 289 } // namespace media | 291 } // namespace media |
| OLD | NEW |