| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "MockWebRTCPeerConnectionHandler.h" | 32 #include "MockWebRTCPeerConnectionHandler.h" |
| 33 | 33 |
| 34 #include "MockConstraints.h" | 34 #include "MockConstraints.h" |
| 35 #include "MockWebRTCDTMFSenderHandler.h" | 35 #include "MockWebRTCDTMFSenderHandler.h" |
| 36 #include "MockWebRTCDataChannelHandler.h" | 36 #include "MockWebRTCDataChannelHandler.h" |
| 37 #include "TestInterfaces.h" | 37 #include "TestInterfaces.h" |
| 38 #include "WebTestDelegate.h" | 38 #include "WebTestDelegate.h" |
| 39 #include "public/platform/WebMediaConstraints.h" | 39 #include "public/platform/WebMediaConstraints.h" |
| 40 #include "public/platform/WebMediaStream.h" | 40 #include "public/platform/WebMediaStream.h" |
| 41 #include "public/platform/WebMediaStreamTrack.h" | 41 #include "public/platform/WebMediaStreamTrack.h" |
| 42 #include "public/platform/WebRTCDataChannelInit.h" |
| 42 #include "public/platform/WebRTCPeerConnectionHandlerClient.h" | 43 #include "public/platform/WebRTCPeerConnectionHandlerClient.h" |
| 43 #include "public/platform/WebRTCSessionDescription.h" | 44 #include "public/platform/WebRTCSessionDescription.h" |
| 44 #include "public/platform/WebRTCSessionDescriptionRequest.h" | 45 #include "public/platform/WebRTCSessionDescriptionRequest.h" |
| 45 #include "public/platform/WebRTCStatsRequest.h" | 46 #include "public/platform/WebRTCStatsRequest.h" |
| 46 #include "public/platform/WebRTCStatsResponse.h" | 47 #include "public/platform/WebRTCStatsResponse.h" |
| 47 #include "public/platform/WebRTCVoidRequest.h" | 48 #include "public/platform/WebRTCVoidRequest.h" |
| 48 #include "public/platform/WebString.h" | 49 #include "public/platform/WebString.h" |
| 49 #include "public/platform/WebVector.h" | 50 #include "public/platform/WebVector.h" |
| 50 | 51 |
| 51 using namespace WebKit; | 52 using namespace WebKit; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 public: | 156 public: |
| 156 RemoteDataChannelTask(MockWebRTCPeerConnectionHandler* object, WebRTCPeerCon
nectionHandlerClient* client, WebTestDelegate* delegate) | 157 RemoteDataChannelTask(MockWebRTCPeerConnectionHandler* object, WebRTCPeerCon
nectionHandlerClient* client, WebTestDelegate* delegate) |
| 157 : WebMethodTask<MockWebRTCPeerConnectionHandler>(object) | 158 : WebMethodTask<MockWebRTCPeerConnectionHandler>(object) |
| 158 , m_client(client) | 159 , m_client(client) |
| 159 , m_delegate(delegate) | 160 , m_delegate(delegate) |
| 160 { | 161 { |
| 161 } | 162 } |
| 162 | 163 |
| 163 virtual void runIfValid() OVERRIDE | 164 virtual void runIfValid() OVERRIDE |
| 164 { | 165 { |
| 165 WebRTCDataChannelHandler* remoteDataChannel = new MockWebRTCDataChannelH
andler("MockRemoteDataChannel", true, m_delegate); | 166 WebRTCDataChannelInit init; |
| 167 WebRTCDataChannelHandler* remoteDataChannel = new MockWebRTCDataChannelH
andler("MockRemoteDataChannel", init, m_delegate); |
| 166 m_client->didAddRemoteDataChannel(remoteDataChannel); | 168 m_client->didAddRemoteDataChannel(remoteDataChannel); |
| 167 } | 169 } |
| 168 | 170 |
| 169 private: | 171 private: |
| 170 WebRTCPeerConnectionHandlerClient* m_client; | 172 WebRTCPeerConnectionHandlerClient* m_client; |
| 171 WebTestDelegate* m_delegate; | 173 WebTestDelegate* m_delegate; |
| 172 }; | 174 }; |
| 173 | 175 |
| 174 ///////////////////// | 176 ///////////////////// |
| 175 | 177 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 for (int i = 0; i < m_streamCount; ++i) { | 279 for (int i = 0; i < m_streamCount; ++i) { |
| 278 size_t reportIndex = response.addReport("Mock audio", "ssrc", curren
tDate); | 280 size_t reportIndex = response.addReport("Mock audio", "ssrc", curren
tDate); |
| 279 response.addStatistic(reportIndex, "type", "audio"); | 281 response.addStatistic(reportIndex, "type", "audio"); |
| 280 reportIndex = response.addReport("Mock video", "ssrc", currentDate); | 282 reportIndex = response.addReport("Mock video", "ssrc", currentDate); |
| 281 response.addStatistic(reportIndex, "type", "video"); | 283 response.addStatistic(reportIndex, "type", "video"); |
| 282 } | 284 } |
| 283 } | 285 } |
| 284 m_interfaces->delegate()->postTask(new RTCStatsRequestSucceededTask(this, re
quest, response)); | 286 m_interfaces->delegate()->postTask(new RTCStatsRequestSucceededTask(this, re
quest, response)); |
| 285 } | 287 } |
| 286 | 288 |
| 287 WebRTCDataChannelHandler* MockWebRTCPeerConnectionHandler::createDataChannel(con
st WebString& label, bool reliable) | 289 WebRTCDataChannelHandler* MockWebRTCPeerConnectionHandler::createDataChannel(con
st WebString& label, const WebKit::WebRTCDataChannelInit& init) |
| 288 { | 290 { |
| 289 m_interfaces->delegate()->postTask(new RemoteDataChannelTask(this, m_client,
m_interfaces->delegate())); | 291 m_interfaces->delegate()->postTask(new RemoteDataChannelTask(this, m_client,
m_interfaces->delegate())); |
| 290 | 292 |
| 291 return new MockWebRTCDataChannelHandler(label, reliable, m_interfaces->deleg
ate()); | 293 return new MockWebRTCDataChannelHandler(label, init, m_interfaces->delegate(
)); |
| 292 } | 294 } |
| 293 | 295 |
| 294 WebRTCDTMFSenderHandler* MockWebRTCPeerConnectionHandler::createDTMFSender(const
WebMediaStreamTrack& track) | 296 WebRTCDTMFSenderHandler* MockWebRTCPeerConnectionHandler::createDTMFSender(const
WebMediaStreamTrack& track) |
| 295 { | 297 { |
| 296 return new MockWebRTCDTMFSenderHandler(track, m_interfaces->delegate()); | 298 return new MockWebRTCDTMFSenderHandler(track, m_interfaces->delegate()); |
| 297 } | 299 } |
| 298 | 300 |
| 299 void MockWebRTCPeerConnectionHandler::stop() | 301 void MockWebRTCPeerConnectionHandler::stop() |
| 300 { | 302 { |
| 301 m_stopped = true; | 303 m_stopped = true; |
| 302 } | 304 } |
| 303 | 305 |
| 304 } | 306 } |
| OLD | NEW |