| 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #ifndef MockWebRTCDataChannelHandler_h | 25 #ifndef MockWebRTCDataChannelHandler_h |
| 26 #define MockWebRTCDataChannelHandler_h | 26 #define MockWebRTCDataChannelHandler_h |
| 27 | 27 |
| 28 #include "TestCommon.h" | 28 #include "TestCommon.h" |
| 29 #include "WebTask.h" | 29 #include "WebTask.h" |
| 30 #include "public/platform/WebRTCDataChannelHandler.h" | 30 #include "public/platform/WebRTCDataChannelHandler.h" |
| 31 #include "public/platform/WebString.h" | 31 #include "public/platform/WebString.h" |
| 32 | 32 |
| 33 namespace WebKit { |
| 34 struct WebRTCDataChannelInit; |
| 35 } |
| 36 |
| 33 namespace WebTestRunner { | 37 namespace WebTestRunner { |
| 34 | 38 |
| 35 class WebTestDelegate; | 39 class WebTestDelegate; |
| 36 | 40 |
| 37 class MockWebRTCDataChannelHandler : public WebKit::WebRTCDataChannelHandler { | 41 class MockWebRTCDataChannelHandler : public WebKit::WebRTCDataChannelHandler { |
| 38 public: | 42 public: |
| 39 MockWebRTCDataChannelHandler(WebKit::WebString label, bool reliable, WebTest
Delegate*); | 43 MockWebRTCDataChannelHandler(WebKit::WebString label, const WebKit::WebRTCDa
taChannelInit&, WebTestDelegate*); |
| 40 | 44 |
| 41 virtual void setClient(WebKit::WebRTCDataChannelHandlerClient*) OVERRIDE; | 45 virtual void setClient(WebKit::WebRTCDataChannelHandlerClient*) OVERRIDE; |
| 42 virtual WebKit::WebString label() OVERRIDE { return m_label; } | 46 virtual WebKit::WebString label() OVERRIDE { return m_label; } |
| 43 virtual bool isReliable() OVERRIDE { return m_reliable; } | 47 virtual bool isReliable() OVERRIDE { return m_reliable; } |
| 44 virtual unsigned long bufferedAmount() OVERRIDE; | 48 virtual unsigned long bufferedAmount() OVERRIDE; |
| 45 virtual bool sendStringData(const WebKit::WebString&) OVERRIDE; | 49 virtual bool sendStringData(const WebKit::WebString&) OVERRIDE; |
| 46 virtual bool sendRawData(const char*, size_t) OVERRIDE; | 50 virtual bool sendRawData(const char*, size_t) OVERRIDE; |
| 47 virtual void close() OVERRIDE; | 51 virtual void close() OVERRIDE; |
| 48 | 52 |
| 49 // WebTask related methods | 53 // WebTask related methods |
| 50 WebTaskList* taskList() { return &m_taskList; } | 54 WebTaskList* taskList() { return &m_taskList; } |
| 51 | 55 |
| 52 private: | 56 private: |
| 53 MockWebRTCDataChannelHandler(); | 57 MockWebRTCDataChannelHandler(); |
| 54 | 58 |
| 55 WebKit::WebRTCDataChannelHandlerClient* m_client; | 59 WebKit::WebRTCDataChannelHandlerClient* m_client; |
| 56 WebKit::WebString m_label; | 60 WebKit::WebString m_label; |
| 57 bool m_reliable; | 61 bool m_reliable; |
| 58 WebTaskList m_taskList; | 62 WebTaskList m_taskList; |
| 59 WebTestDelegate* m_delegate; | 63 WebTestDelegate* m_delegate; |
| 60 }; | 64 }; |
| 61 | 65 |
| 62 } | 66 } |
| 63 | 67 |
| 64 #endif // MockWebRTCDataChannelHandler_h | 68 #endif // MockWebRTCDataChannelHandler_h |
| OLD | NEW |