summaryrefslogtreecommitdiffstats
path: root/components/test_runner/mock_web_user_media_client.h
blob: 33b55d5ae06b62391085c2e59cc5a849b62a0a32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_TEST_RUNNER_MOCK_WEB_USER_MEDIA_CLIENT_H_
#define COMPONENTS_TEST_RUNNER_MOCK_WEB_USER_MEDIA_CLIENT_H_

#include "components/test_runner/web_task.h"
#include "third_party/WebKit/public/web/WebUserMediaClient.h"

namespace test_runner {

class WebTestDelegate;

class MockWebUserMediaClient : public blink::WebUserMediaClient {
 public:
  explicit MockWebUserMediaClient(WebTestDelegate* delegate);
  ~MockWebUserMediaClient() override {}

  void requestUserMedia(const blink::WebUserMediaRequest&) override;
  void cancelUserMediaRequest(const blink::WebUserMediaRequest&) override;
  void requestMediaDevices(const blink::WebMediaDevicesRequest&) override;
  void cancelMediaDevicesRequest(const blink::WebMediaDevicesRequest&) override;
  void requestSources(const blink::WebMediaStreamTrackSourcesRequest&) override;

  // Task related methods
  WebTaskList* mutable_task_list() { return &task_list_; }

 private:
  WebTaskList task_list_;
  WebTestDelegate* delegate_;

  DISALLOW_COPY_AND_ASSIGN(MockWebUserMediaClient);
};

}  // namespace test_runner

#endif  // COMPONENTS_TEST_RUNNER_MOCK_WEB_USER_MEDIA_CLIENT_H_