Adding support for MediaStream and PeerConnection functionality.
[chromium-blink-merge.git] / content / renderer / media / mock_media_stream_dispatcher.cc
blob16894bf8f938773606911e4502d476d6be74671a
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
3 // found in the LICENSE file.
5 #include "content/renderer/media/mock_media_stream_dispatcher.h"
7 MockMediaStreamDispatcher::MockMediaStreamDispatcher()
8 : MediaStreamDispatcher(NULL),
9 request_id_(-1),
10 event_handler_(NULL),
11 components_(NULL),
12 stop_stream_counter_(0) {
15 MockMediaStreamDispatcher::~MockMediaStreamDispatcher() {}
17 void MockMediaStreamDispatcher::GenerateStream(
18 int request_id,
19 MediaStreamDispatcherEventHandler* event_handler,
20 media_stream::StreamOptions components,
21 const std::string& security_origin) {
22 request_id_ = request_id;
23 event_handler_ = event_handler;
24 delete components_;
25 components_ = new media_stream::StreamOptions(components.audio,
26 components.video_option);
27 security_origin_ = security_origin;
30 void MockMediaStreamDispatcher::StopStream(const std::string& label) {
31 ++stop_stream_counter_;
34 bool MockMediaStreamDispatcher::IsStream(const std::string& label) {
35 NOTIMPLEMENTED();
36 return false;
39 int MockMediaStreamDispatcher::video_session_id(const std::string& label,
40 int index) {
41 NOTIMPLEMENTED();
42 return -1;
45 int MockMediaStreamDispatcher::audio_session_id(const std::string& label,
46 int index) {
47 NOTIMPLEMENTED();
48 return -1;