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

Unified Diff: content/test/webrtc_audio_device_test.cc

Issue 11232014: Move a bunch of code in content\renderer to the content namespace. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/webrtc_audio_device_test.h ('k') | webkit/plugins/ppapi/fullscreen_container.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/webrtc_audio_device_test.cc
===================================================================
--- content/test/webrtc_audio_device_test.cc (revision 163045)
+++ content/test/webrtc_audio_device_test.cc (working copy)
@@ -45,6 +45,8 @@
using testing::Return;
using testing::StrEq;
+namespace content {
+
// This class is a mock of the child process singleton which is needed
// to be able to create a RenderThread object.
class WebRTCMockRenderProcess : public RenderProcess {
@@ -72,26 +74,23 @@
// duration of the test.
class ReplaceContentClientRenderer {
public:
- explicit ReplaceContentClientRenderer(
- content::ContentRendererClient* new_renderer) {
- saved_renderer_ = content::GetContentClient()->renderer();
- content::GetContentClient()->set_renderer_for_testing(new_renderer);
+ explicit ReplaceContentClientRenderer(ContentRendererClient* new_renderer) {
+ saved_renderer_ = GetContentClient()->renderer();
+ GetContentClient()->set_renderer_for_testing(new_renderer);
}
~ReplaceContentClientRenderer() {
// Restore the original renderer.
- content::GetContentClient()->set_renderer_for_testing(saved_renderer_);
+ GetContentClient()->set_renderer_for_testing(saved_renderer_);
}
private:
- content::ContentRendererClient* saved_renderer_;
+ ContentRendererClient* saved_renderer_;
DISALLOW_COPY_AND_ASSIGN(ReplaceContentClientRenderer);
};
-namespace {
-
-class MockResourceContext : public content::ResourceContext {
+class MockRTCResourceContext : public ResourceContext {
public:
- MockResourceContext() : test_request_context_(NULL) {}
- virtual ~MockResourceContext() {}
+ MockRTCResourceContext() : test_request_context_(NULL) {}
+ virtual ~MockRTCResourceContext() {}
void set_request_context(net::URLRequestContext* request_context) {
test_request_context_ = request_context;
@@ -108,15 +107,13 @@
private:
net::URLRequestContext* test_request_context_;
- DISALLOW_COPY_AND_ASSIGN(MockResourceContext);
+ DISALLOW_COPY_AND_ASSIGN(MockRTCResourceContext);
};
ACTION_P(QuitMessageLoop, loop_or_proxy) {
loop_or_proxy->PostTask(FROM_HERE, MessageLoop::QuitClosure());
}
-} // namespace
-
WebRTCAudioDeviceTest::WebRTCAudioDeviceTest()
: render_thread_(NULL), audio_util_callback_(NULL),
has_input_devices_(false), has_output_devices_(false) {
@@ -132,8 +129,8 @@
saved_content_renderer_.reset(
new ReplaceContentClientRenderer(&content_renderer_client_));
mock_process_.reset(new WebRTCMockRenderProcess());
- ui_thread_.reset(new content::TestBrowserThread(content::BrowserThread::UI,
- MessageLoop::current()));
+ ui_thread_.reset(new TestBrowserThread(BrowserThread::UI,
+ MessageLoop::current()));
// Create our own AudioManager and MediaStreamManager.
audio_manager_.reset(media::AudioManager::Create());
@@ -141,7 +138,7 @@
new media_stream::MediaStreamManager(audio_manager_.get()));
// Construct the resource context on the UI thread.
- resource_context_.reset(new MockResourceContext);
+ resource_context_.reset(new MockRTCResourceContext);
static const char kThreadName[] = "RenderThread";
ChildProcess::current()->io_message_loop()->PostTask(FROM_HERE,
@@ -205,13 +202,13 @@
#endif
// Set the current thread as the IO thread.
- io_thread_.reset(new content::TestBrowserThread(content::BrowserThread::IO,
- MessageLoop::current()));
+ io_thread_.reset(new TestBrowserThread(BrowserThread::IO,
+ MessageLoop::current()));
// Populate our resource context.
test_request_context_.reset(new TestURLRequestContext());
- MockResourceContext* resource_context =
- static_cast<MockResourceContext*>(resource_context_.get());
+ MockRTCResourceContext* resource_context =
+ static_cast<MockRTCResourceContext*>(resource_context_.get());
resource_context->set_request_context(test_request_context_.get());
media_observer_.reset(new MockMediaObserver());
@@ -233,7 +230,7 @@
}
void WebRTCAudioDeviceTest::CreateChannel(const char* name) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
audio_render_host_ = new AudioRendererHost(
audio_manager_.get(), media_observer_.get());
audio_render_host_->OnChannelConnected(base::GetCurrentProcId());
@@ -250,7 +247,7 @@
}
void WebRTCAudioDeviceTest::DestroyChannel() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
audio_render_host_->OnChannelClosing();
audio_render_host_->OnFilterRemoved();
audio_input_renderer_host_->OnChannelClosing();
@@ -351,7 +348,7 @@
std::string WebRTCAudioDeviceTest::GetTestDataPath(
const FilePath::StringType& file_name) {
FilePath path;
- EXPECT_TRUE(PathService::Get(content::DIR_TEST_DATA, &path));
+ EXPECT_TRUE(PathService::Get(DIR_TEST_DATA, &path));
path = path.Append(file_name);
EXPECT_TRUE(file_util::PathExists(path));
#ifdef OS_WIN
@@ -375,3 +372,5 @@
int len) {
return network_->ReceivedRTCPPacket(channel, data, len);
}
+
+} // namespace content
« no previous file with comments | « content/test/webrtc_audio_device_test.h ('k') | webkit/plugins/ppapi/fullscreen_container.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698