Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Side by Side Diff: components/test_runner/mock_webrtc_data_channel_handler.h

Issue 2707183003: Move //components/test_runner back into //content/shell (Closed)
Patch Set: Trim DEPS Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_TEST_RUNNER_MOCK_WEBRTC_DATA_CHANNEL_HANDLER_H_
6 #define COMPONENTS_TEST_RUNNER_MOCK_WEBRTC_DATA_CHANNEL_HANDLER_H_
7
8 #include <stddef.h>
9
10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h"
12 #include "third_party/WebKit/public/platform/WebRTCDataChannelHandler.h"
13 #include "third_party/WebKit/public/platform/WebRTCDataChannelHandlerClient.h"
14 #include "third_party/WebKit/public/platform/WebRTCDataChannelInit.h"
15 #include "third_party/WebKit/public/platform/WebString.h"
16
17 namespace test_runner {
18
19 class WebTestDelegate;
20
21 class MockWebRTCDataChannelHandler : public blink::WebRTCDataChannelHandler {
22 public:
23 MockWebRTCDataChannelHandler(blink::WebString label,
24 const blink::WebRTCDataChannelInit& init,
25 WebTestDelegate* delegate);
26 ~MockWebRTCDataChannelHandler() override;
27
28 // WebRTCDataChannelHandler related methods
29 void setClient(blink::WebRTCDataChannelHandlerClient* client) override;
30 blink::WebString label() override;
31 bool isReliable() override;
32 bool ordered() const override;
33 unsigned short maxRetransmitTime() const override;
34 unsigned short maxRetransmits() const override;
35 blink::WebString protocol() const override;
36 bool negotiated() const override;
37 unsigned short id() const override;
38 blink::WebRTCDataChannelHandlerClient::ReadyState state() const override;
39 unsigned long bufferedAmount() override;
40 bool sendStringData(const blink::WebString& data) override;
41 bool sendRawData(const char* data, size_t size) override;
42 void close() override;
43
44 private:
45 MockWebRTCDataChannelHandler();
46 void ReportOpenedState();
47 void ReportClosedState();
48
49 blink::WebRTCDataChannelHandlerClient* client_;
50 blink::WebString label_;
51 blink::WebRTCDataChannelInit init_;
52 bool reliable_;
53 WebTestDelegate* delegate_;
54
55 base::WeakPtrFactory<MockWebRTCDataChannelHandler> weak_factory_;
56
57 DISALLOW_COPY_AND_ASSIGN(MockWebRTCDataChannelHandler);
58 };
59
60 } // namespace test_runner
61
62 #endif // COMPONENTS_TEST_RUNNER_MOCK_WEBRTC_DATA_CHANNEL_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698