Extension syncing: Introduce a NeedsSync pref
[chromium-blink-merge.git] / components / test_runner / mock_webrtc_dtmf_sender_handler.h
bloba42c197e338bf5db9a0536ece3bb6cc859e3a414
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.
5 #ifndef COMPONENTS_TEST_RUNNER_MOCK_WEBRTC_DTMF_SENDER_HANDLER_H_
6 #define COMPONENTS_TEST_RUNNER_MOCK_WEBRTC_DTMF_SENDER_HANDLER_H_
8 #include "base/basictypes.h"
9 #include "components/test_runner/web_task.h"
10 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
11 #include "third_party/WebKit/public/platform/WebRTCDTMFSenderHandler.h"
12 #include "third_party/WebKit/public/platform/WebString.h"
14 namespace test_runner {
16 class WebTestDelegate;
18 class MockWebRTCDTMFSenderHandler : public blink::WebRTCDTMFSenderHandler {
19 public:
20 MockWebRTCDTMFSenderHandler(const blink::WebMediaStreamTrack& track,
21 WebTestDelegate* delegate);
23 // WebRTCDTMFSenderHandler related methods
24 virtual void setClient(blink::WebRTCDTMFSenderHandlerClient* client) override;
25 virtual blink::WebString currentToneBuffer() override;
26 virtual bool canInsertDTMF() override;
27 virtual bool insertDTMF(const blink::WebString& tones,
28 long duration,
29 long inter_tone_gap) override;
31 // WebTask related methods
32 WebTaskList* mutable_task_list() { return &task_list_; }
34 void ClearToneBuffer() { tone_buffer_.reset(); }
36 private:
37 MockWebRTCDTMFSenderHandler();
39 blink::WebRTCDTMFSenderHandlerClient* client_;
40 blink::WebMediaStreamTrack track_;
41 blink::WebString tone_buffer_;
42 WebTaskList task_list_;
43 WebTestDelegate* delegate_;
45 DISALLOW_COPY_AND_ASSIGN(MockWebRTCDTMFSenderHandler);
48 } // namespace test_runner
50 #endif // COMPONENTS_TEST_RUNNER_MOCK_WEBRTC_DTMF_SENDER_HANDLER_H_