Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(739)

Side by Side Diff: content/test/mock_resource_context.h

Issue 9584023: Move MockResourceContext to content/test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_MOCK_RESOURCE_CONTEXT_H_ 5 #ifndef CONTENT_TEST_MOCK_RESOURCE_CONTEXT_H_
6 #define CONTENT_BROWSER_MOCK_RESOURCE_CONTEXT_H_ 6 #define CONTENT_TEST_MOCK_RESOURCE_CONTEXT_H_
7 #pragma once
7 8
9 #include "base/basictypes.h"
8 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "content/public/browser/resource_context.h" 12 #include "content/public/browser/resource_context.h"
12 #include "net/url_request/url_request_context.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 class MockResourceContext : public ResourceContext { 16 class MockResourceContext : public ResourceContext {
17 public: 17 public:
18 MockResourceContext(); 18 MockResourceContext();
19 explicit MockResourceContext(net::URLRequestContext* context); 19 explicit MockResourceContext(net::URLRequestContext* context);
20 virtual ~MockResourceContext(); 20 virtual ~MockResourceContext();
21 21
22 void set_request_context(net::URLRequestContext* context) { 22 void set_request_context(net::URLRequestContext* context) {
23 test_request_context_ = context; 23 test_request_context_ = context;
24 } 24 }
25 25
26 void set_media_observer(MediaObserver* observer) { 26 void set_media_observer(MediaObserver* observer) {
27 media_observer_ = observer; 27 media_observer_ = observer;
28 } 28 }
29 29
30 // ResourceContext implementation: 30 // Overridden from ResourceContext:
jam 2012/03/05 06:51:59 nit: no need to change this when moving the file,
tfarina 2012/03/05 12:40:34 Done.
31 virtual net::HostResolver* GetHostResolver() OVERRIDE; 31 virtual net::HostResolver* GetHostResolver() OVERRIDE;
32 virtual net::URLRequestContext* GetRequestContext() OVERRIDE; 32 virtual net::URLRequestContext* GetRequestContext() OVERRIDE;
33 virtual MediaObserver* GetMediaObserver() OVERRIDE; 33 virtual MediaObserver* GetMediaObserver() OVERRIDE;
34 34
35 private: 35 private:
36 scoped_refptr<net::URLRequestContext> test_request_context_; 36 scoped_refptr<net::URLRequestContext> test_request_context_;
37 MediaObserver* media_observer_; 37 MediaObserver* media_observer_;
38
39 DISALLOW_COPY_AND_ASSIGN(MockResourceContext);
38 }; 40 };
39 41
40 } // namespace content 42 } // namespace content
41 43
42 #endif // CONTENT_BROWSER_MOCK_RESOURCE_CONTEXT_H_ 44 #endif // CONTENT_TEST_MOCK_RESOURCE_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698