| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBRTCDATACHANNELHANDLER_H_ | 5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBRTCDATACHANNELHANDLER_H_ |
| 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBRTCDATACHANNELHANDLER_H_ | 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBRTCDATACHANNELHANDLER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "content/shell/renderer/test_runner/TestCommon.h" | 9 #include "content/shell/renderer/test_runner/TestCommon.h" |
| 10 #include "content/shell/renderer/test_runner/WebTask.h" | 10 #include "content/shell/renderer/test_runner/WebTask.h" |
| 11 #include "third_party/WebKit/public/platform/WebRTCDataChannelHandler.h" | 11 #include "third_party/WebKit/public/platform/WebRTCDataChannelHandler.h" |
| 12 #include "third_party/WebKit/public/platform/WebRTCDataChannelInit.h" | 12 #include "third_party/WebKit/public/platform/WebRTCDataChannelInit.h" |
| 13 #include "third_party/WebKit/public/platform/WebString.h" | 13 #include "third_party/WebKit/public/platform/WebString.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 class WebTestDelegate; | 17 class WebTestDelegate; |
| 18 | 18 |
| 19 class MockWebRTCDataChannelHandler : public blink::WebRTCDataChannelHandler { | 19 class MockWebRTCDataChannelHandler : public blink::WebRTCDataChannelHandler { |
| 20 public: | 20 public: |
| 21 MockWebRTCDataChannelHandler(blink::WebString label, | 21 MockWebRTCDataChannelHandler(blink::WebString label, |
| 22 const blink::WebRTCDataChannelInit&, | 22 const blink::WebRTCDataChannelInit& init, |
| 23 WebTestDelegate*); | 23 WebTestDelegate* delegate); |
| 24 | 24 |
| 25 virtual void setClient(blink::WebRTCDataChannelHandlerClient*) OVERRIDE; | 25 // WebRTCDataChannelHandler related methods |
| 26 virtual void setClient( |
| 27 blink::WebRTCDataChannelHandlerClient* client) OVERRIDE; |
| 26 virtual blink::WebString label() OVERRIDE; | 28 virtual blink::WebString label() OVERRIDE; |
| 27 virtual bool isReliable() OVERRIDE; | 29 virtual bool isReliable() OVERRIDE; |
| 28 virtual bool ordered() const OVERRIDE; | 30 virtual bool ordered() const OVERRIDE; |
| 29 virtual unsigned short maxRetransmitTime() const OVERRIDE; | 31 virtual unsigned short maxRetransmitTime() const OVERRIDE; |
| 30 virtual unsigned short maxRetransmits() const OVERRIDE; | 32 virtual unsigned short maxRetransmits() const OVERRIDE; |
| 31 virtual blink::WebString protocol() const OVERRIDE; | 33 virtual blink::WebString protocol() const OVERRIDE; |
| 32 virtual bool negotiated() const OVERRIDE; | 34 virtual bool negotiated() const OVERRIDE; |
| 33 virtual unsigned short id() const OVERRIDE; | 35 virtual unsigned short id() const OVERRIDE; |
| 34 virtual unsigned long bufferedAmount() OVERRIDE; | 36 virtual unsigned long bufferedAmount() OVERRIDE; |
| 35 virtual bool sendStringData(const blink::WebString&) OVERRIDE; | 37 virtual bool sendStringData(const blink::WebString& data) OVERRIDE; |
| 36 virtual bool sendRawData(const char*, size_t) OVERRIDE; | 38 virtual bool sendRawData(const char* data, size_t size) OVERRIDE; |
| 37 virtual void close() OVERRIDE; | 39 virtual void close() OVERRIDE; |
| 38 | 40 |
| 39 // WebTask related methods | 41 // WebTask related methods |
| 40 WebTaskList* mutable_task_list() { return &task_list_; } | 42 WebTaskList* mutable_task_list() { return &task_list_; } |
| 41 | 43 |
| 42 private: | 44 private: |
| 43 MockWebRTCDataChannelHandler(); | 45 MockWebRTCDataChannelHandler(); |
| 44 | 46 |
| 45 blink::WebRTCDataChannelHandlerClient* client_; | 47 blink::WebRTCDataChannelHandlerClient* client_; |
| 46 blink::WebString label_; | 48 blink::WebString label_; |
| 47 blink::WebRTCDataChannelInit init_; | 49 blink::WebRTCDataChannelInit init_; |
| 48 bool reliable_; | 50 bool reliable_; |
| 49 WebTaskList task_list_; | 51 WebTaskList task_list_; |
| 50 WebTestDelegate* delegate_; | 52 WebTestDelegate* delegate_; |
| 51 | 53 |
| 52 DISALLOW_COPY_AND_ASSIGN(MockWebRTCDataChannelHandler); | 54 DISALLOW_COPY_AND_ASSIGN(MockWebRTCDataChannelHandler); |
| 53 }; | 55 }; |
| 54 | 56 |
| 55 } // namespace content | 57 } // namespace content |
| 56 | 58 |
| 57 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBRTCDATACHANNELHANDLER_H_ | 59 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBRTCDATACHANNELHANDLER_H_ |
| OLD | NEW |