Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: content/renderer/media/render_media_log_unittest.cc

Issue 1178423008: Provision to start base::SimpleTestTickClock at initial ticks Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "base/test/simple_test_tick_clock.h" 6 #include "base/test/simple_test_tick_clock.h"
7 #include "base/test/test_mock_time_task_runner.h" 7 #include "base/test/test_mock_time_task_runner.h"
8 #include "content/common/view_messages.h" 8 #include "content/common/view_messages.h"
9 #include "content/public/test/mock_render_thread.h" 9 #include "content/public/test/mock_render_thread.h"
10 #include "content/renderer/media/render_media_log.h" 10 #include "content/renderer/media/render_media_log.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 class RenderMediaLogTest : public testing::Test { 15 class RenderMediaLogTest : public testing::Test {
16 public: 16 public:
17 RenderMediaLogTest() 17 RenderMediaLogTest()
18 : log_(new RenderMediaLog()), 18 : log_(new RenderMediaLog()),
19 tick_clock_(new base::SimpleTestTickClock()), 19 tick_clock_(new base::SimpleTestTickClock(base::TimeTicks())),
20 task_runner_(new base::TestMockTimeTaskRunner()) { 20 task_runner_(new base::TestMockTimeTaskRunner()) {
21 log_->SetTickClockForTesting(scoped_ptr<base::TickClock>(tick_clock_)); 21 log_->SetTickClockForTesting(scoped_ptr<base::TickClock>(tick_clock_));
22 log_->SetTaskRunnerForTesting(task_runner_); 22 log_->SetTaskRunnerForTesting(task_runner_);
23 } 23 }
24 24
25 ~RenderMediaLogTest() override { 25 ~RenderMediaLogTest() override {
26 task_runner_->ClearPendingTasks(); 26 task_runner_->ClearPendingTasks();
27 } 27 }
28 28
29 void AddEvent(media::MediaLogEvent::Type type) { 29 void AddEvent(media::MediaLogEvent::Type type) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // Verify contents. There should only be a single buffered extents changed 115 // Verify contents. There should only be a single buffered extents changed
116 // event. 116 // event.
117 std::vector<media::MediaLogEvent> events = GetMediaLogEvents(); 117 std::vector<media::MediaLogEvent> events = GetMediaLogEvents();
118 ASSERT_EQ(3u, events.size()); 118 ASSERT_EQ(3u, events.size());
119 EXPECT_EQ(media::MediaLogEvent::LOAD, events[0].type); 119 EXPECT_EQ(media::MediaLogEvent::LOAD, events[0].type);
120 EXPECT_EQ(media::MediaLogEvent::SEEK, events[1].type); 120 EXPECT_EQ(media::MediaLogEvent::SEEK, events[1].type);
121 EXPECT_EQ(media::MediaLogEvent::BUFFERED_EXTENTS_CHANGED, events[2].type); 121 EXPECT_EQ(media::MediaLogEvent::BUFFERED_EXTENTS_CHANGED, events[2].type);
122 } 122 }
123 123
124 } // namespace content 124 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/render_media_client_unittest.cc ('k') | google_apis/gcm/engine/connection_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698