OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/renderer/test_runner/MockWebRTCDataChannelHandler.h" | 5 #include "content/shell/renderer/test_runner/MockWebRTCDataChannelHandler.h" |
6 | 6 |
7 #include <assert.h> | 7 #include <assert.h> |
8 | 8 |
9 #include "content/shell/renderer/test_runner/WebTestDelegate.h" | 9 #include "content/shell/renderer/test_runner/WebTestDelegate.h" |
10 #include "third_party/WebKit/public/platform/WebRTCDataChannelHandlerClient.h" | 10 #include "third_party/WebKit/public/platform/WebRTCDataChannelHandlerClient.h" |
11 | 11 |
12 using namespace blink; | 12 using namespace blink; |
13 | 13 |
14 namespace WebTestRunner { | 14 namespace content { |
15 | 15 |
16 class DataChannelReadyStateTask : public WebMethodTask<MockWebRTCDataChannelHand
ler> { | 16 class DataChannelReadyStateTask : public WebMethodTask<MockWebRTCDataChannelHand
ler> { |
17 public: | 17 public: |
18 DataChannelReadyStateTask(MockWebRTCDataChannelHandler* object, WebRTCDataCh
annelHandlerClient* dataChannelClient, WebRTCDataChannelHandlerClient::ReadyStat
e state) | 18 DataChannelReadyStateTask(MockWebRTCDataChannelHandler* object, WebRTCDataCh
annelHandlerClient* dataChannelClient, WebRTCDataChannelHandlerClient::ReadyStat
e state) |
19 : WebMethodTask<MockWebRTCDataChannelHandler>(object) | 19 : WebMethodTask<MockWebRTCDataChannelHandler>(object) |
20 , m_dataChannelClient(dataChannelClient) | 20 , m_dataChannelClient(dataChannelClient) |
21 , m_state(state) | 21 , m_state(state) |
22 { | 22 { |
23 } | 23 } |
24 | 24 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 m_client->didReceiveRawData(data, size); | 108 m_client->didReceiveRawData(data, size); |
109 return true; | 109 return true; |
110 } | 110 } |
111 | 111 |
112 void MockWebRTCDataChannelHandler::close() | 112 void MockWebRTCDataChannelHandler::close() |
113 { | 113 { |
114 assert(m_client); | 114 assert(m_client); |
115 m_delegate->postTask(new DataChannelReadyStateTask(this, m_client, WebRTCDat
aChannelHandlerClient::ReadyStateClosed)); | 115 m_delegate->postTask(new DataChannelReadyStateTask(this, m_client, WebRTCDat
aChannelHandlerClient::ReadyStateClosed)); |
116 } | 116 } |
117 | 117 |
118 } | 118 } // namespace content |
OLD | NEW |