1// Copyright (c) 2012 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#include "content/public/test/mock_resource_context.h"
6
7#include "net/url_request/url_request_context.h"
8
9namespace content {
10
11MockResourceContext::MockResourceContext()
12  : test_request_context_(NULL) {
13}
14
15MockResourceContext::MockResourceContext(
16    net::URLRequestContext* test_request_context)
17  : test_request_context_(test_request_context),
18    mic_allowed_(false),
19    camera_allowed_(false) {
20}
21
22MockResourceContext::~MockResourceContext() {}
23
24net::HostResolver* MockResourceContext::GetHostResolver()  {
25  return NULL;
26}
27
28net::URLRequestContext* MockResourceContext::GetRequestContext()  {
29  CHECK(test_request_context_);
30  return test_request_context_;
31}
32
33bool MockResourceContext::AllowMicAccess(const GURL& origin)  {
34  return mic_allowed_;
35}
36
37bool MockResourceContext::AllowCameraAccess(const GURL& origin)  {
38  return camera_allowed_;
39}
40
41}  // namespace content
42