Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / content / public / test / mock_resource_context.cc
blob342766c5f4faeae1e853d0df780b5e4726a6cac7
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.
5 #include "content/public/test/mock_resource_context.h"
7 #include "net/url_request/url_request_context.h"
9 namespace content {
11 MockResourceContext::MockResourceContext()
12 : test_request_context_(NULL) {
15 MockResourceContext::MockResourceContext(
16 net::URLRequestContext* test_request_context)
17 : test_request_context_(test_request_context),
18 mic_allowed_(false),
19 camera_allowed_(false) {
22 MockResourceContext::~MockResourceContext() {}
24 net::HostResolver* MockResourceContext::GetHostResolver() {
25 return NULL;
28 net::URLRequestContext* MockResourceContext::GetRequestContext() {
29 CHECK(test_request_context_);
30 return test_request_context_;
33 bool MockResourceContext::AllowMicAccess(const GURL& origin) {
34 return mic_allowed_;
37 bool MockResourceContext::AllowCameraAccess(const GURL& origin) {
38 return camera_allowed_;
41 } // namespace content