Fix crash on app list start page contents not existing.
[chromium-blink-merge.git] / content / renderer / media / mock_media_constraint_factory.h
blobe98cb30429b976e192dd0e902c42d29f09bbcef4
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 CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_CONSTRAINT_H_
6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_CONSTRAINT_H_
8 #include <string>
9 #include <vector>
11 #include "third_party/WebKit/public/platform/WebMediaConstraints.h"
13 namespace content {
15 class MockMediaConstraintFactory {
16 public:
17 MockMediaConstraintFactory();
18 ~MockMediaConstraintFactory();
20 blink::WebMediaConstraints CreateWebMediaConstraints();
21 void AddMandatory(const std::string& key, int value);
22 void AddMandatory(const std::string& key, double value);
23 void AddMandatory(const std::string& key, const std::string& value);
24 void AddMandatory(const std::string& key, bool value);
25 void AddOptional(const std::string& key, int value);
26 void AddOptional(const std::string& key, double value);
27 void AddOptional(const std::string& key, const std::string& value);
28 void AddOptional(const std::string& key, bool value);
29 void DisableDefaultAudioConstraints();
31 private:
32 std::vector<blink::WebMediaConstraint> mandatory_;
33 std::vector<blink::WebMediaConstraint> optional_;
36 } // namespace content
38 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_CONSTRAINT_H_