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

Side by Side Diff: content/browser/renderer_host/media/audio_renderer_host_unittest.cc

Issue 10790121: First step towards moving AudioDevice from content/ to media/audio. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unnecessary #include Created 8 years, 5 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/environment.h" 6 #include "base/environment.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/sync_socket.h" 10 #include "base/sync_socket.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 #else 111 #else
112 sync_socket_handle = socket_descriptor.fd; 112 sync_socket_handle = socket_descriptor.fd;
113 #endif 113 #endif
114 sync_socket_.reset(new base::SyncSocket(sync_socket_handle)); 114 sync_socket_.reset(new base::SyncSocket(sync_socket_handle));
115 115
116 // And then delegate the call to the mock method. 116 // And then delegate the call to the mock method.
117 OnStreamCreated(stream_id, length); 117 OnStreamCreated(stream_id, length);
118 } 118 }
119 119
120 void OnStreamStateChanged(const IPC::Message& msg, int stream_id, 120 void OnStreamStateChanged(const IPC::Message& msg, int stream_id,
121 AudioStreamState state) { 121 media::AudioStreamState state) {
122 if (state == kAudioStreamPlaying) { 122 if (state == media::kAudioStreamPlaying) {
scherkus (not reviewing) 2012/07/23 22:57:51 seems like a good use case for a switch!
tommi (sloooow) - chröme 2012/07/24 09:49:44 Done.
123 OnStreamPlaying(stream_id); 123 OnStreamPlaying(stream_id);
124 } else if (state == kAudioStreamPaused) { 124 } else if (state == media::kAudioStreamPaused) {
125 OnStreamPaused(stream_id); 125 OnStreamPaused(stream_id);
126 } else if (state == kAudioStreamError) { 126 } else if (state == media::kAudioStreamError) {
127 OnStreamError(stream_id); 127 OnStreamError(stream_id);
128 } else { 128 } else {
129 FAIL() << "Unknown stream state"; 129 FAIL() << "Unknown stream state";
130 } 130 }
131 } 131 }
132 132
133 void OnStreamVolume(const IPC::Message& msg, int stream_id, double volume) { 133 void OnStreamVolume(const IPC::Message& msg, int stream_id, double volume) {
134 OnStreamVolume(stream_id, volume); 134 OnStreamVolume(stream_id, volume);
135 } 135 }
136 136
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 EnableRealDevice(); 398 EnableRealDevice();
399 399
400 Create(); 400 Create();
401 Play(); 401 Play();
402 SimulateError(); 402 SimulateError();
403 Close(); 403 Close();
404 } 404 }
405 405
406 406
407 // TODO(hclam): Add tests for data conversation in low latency mode. 407 // TODO(hclam): Add tests for data conversation in low latency mode.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698