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

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

Issue 9297022: Change ChildProcess::set_main_thread registration to occur inside the RenderThreadImpl::Init method. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/process_util.h" 8 #include "base/process_util.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "base/test/test_timeouts.h" 10 #include "base/test/test_timeouts.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // Note that, the IPC part is not utilized in this test. 81 // Note that, the IPC part is not utilized in this test.
82 content::GetContentClient()->set_renderer(&mock_content_renderer_client_); 82 content::GetContentClient()->set_renderer(&mock_content_renderer_client_);
83 83
84 static const char kThreadName[] = "RenderThread"; 84 static const char kThreadName[] = "RenderThread";
85 channel_.reset(new IPC::Channel(kThreadName, 85 channel_.reset(new IPC::Channel(kThreadName,
86 IPC::Channel::MODE_SERVER, this)); 86 IPC::Channel::MODE_SERVER, this));
87 ASSERT_TRUE(channel_->Connect()); 87 ASSERT_TRUE(channel_->Connect());
88 88
89 mock_process_.reset(new MockRenderProcess); 89 mock_process_.reset(new MockRenderProcess);
90 render_thread_ = new RenderThreadImpl(kThreadName); 90 render_thread_ = new RenderThreadImpl(kThreadName);
91 mock_process_->set_main_thread(render_thread_);
92 91
93 // Setup expectations for initialization. 92 // Setup expectations for initialization.
94 decoder_ = new media::MockAudioDecoder(); 93 decoder_ = new media::MockAudioDecoder();
95 94
96 EXPECT_CALL(*decoder_, bits_per_channel()) 95 EXPECT_CALL(*decoder_, bits_per_channel())
97 .WillRepeatedly(Return(16)); 96 .WillRepeatedly(Return(16));
98 EXPECT_CALL(*decoder_, channel_layout()) 97 EXPECT_CALL(*decoder_, channel_layout())
99 .WillRepeatedly(Return(CHANNEL_LAYOUT_MONO)); 98 .WillRepeatedly(Return(CHANNEL_LAYOUT_MONO));
100 EXPECT_CALL(*decoder_, samples_per_second()) 99 EXPECT_CALL(*decoder_, samples_per_second())
101 .WillRepeatedly(Return(44100)); 100 .WillRepeatedly(Return(44100));
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 base::Time time_now = base::Time(); // Null time by default. 177 base::Time time_now = base::Time(); // Null time by default.
179 renderer_->set_earliest_end_time(time_now); 178 renderer_->set_earliest_end_time(time_now);
180 renderer_->UpdateEarliestEndTime(renderer_->bytes_per_second(), 179 renderer_->UpdateEarliestEndTime(renderer_->bytes_per_second(),
181 base::TimeDelta::FromMilliseconds(100), 180 base::TimeDelta::FromMilliseconds(100),
182 time_now); 181 time_now);
183 int time_delta = (renderer_->earliest_end_time() - time_now).InMilliseconds(); 182 int time_delta = (renderer_->earliest_end_time() - time_now).InMilliseconds();
184 EXPECT_EQ(1100, time_delta); 183 EXPECT_EQ(1100, time_delta);
185 renderer_->Stop(media::NewExpectedClosure()); 184 renderer_->Stop(media::NewExpectedClosure());
186 WaitForIOThreadCompletion(); 185 WaitForIOThreadCompletion();
187 } 186 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698