summaryrefslogtreecommitdiffstats
path: root/content/renderer/media/mock_media_constraint_factory.h
blob: e98cb30429b976e192dd0e902c42d29f09bbcef4 (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 CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_CONSTRAINT_H_
#define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_CONSTRAINT_H_

#include <string>
#include <vector>

#include "third_party/WebKit/public/platform/WebMediaConstraints.h"

namespace content {

class MockMediaConstraintFactory {
 public:
  MockMediaConstraintFactory();
  ~MockMediaConstraintFactory();

  blink::WebMediaConstraints CreateWebMediaConstraints();
  void AddMandatory(const std::string& key, int value);
  void AddMandatory(const std::string& key, double value);
  void AddMandatory(const std::string& key, const std::string& value);
  void AddMandatory(const std::string& key, bool value);
  void AddOptional(const std::string& key, int value);
  void AddOptional(const std::string& key, double value);
  void AddOptional(const std::string& key, const std::string& value);
  void AddOptional(const std::string& key, bool value);
  void DisableDefaultAudioConstraints();

 private:
  std::vector<blink::WebMediaConstraint> mandatory_;
  std::vector<blink::WebMediaConstraint> optional_;
};

}  // namespace content

#endif  // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_CONSTRAINT_H_