| OLD | NEW |
| (Empty) |
| 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 #ifndef CONTENT_BROWSER_MOCK_RESOURCE_CONTEXT_H_ | |
| 6 #define CONTENT_BROWSER_MOCK_RESOURCE_CONTEXT_H_ | |
| 7 | |
| 8 #include "base/compiler_specific.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "content/public/browser/resource_context.h" | |
| 12 #include "net/url_request/url_request_context.h" | |
| 13 | |
| 14 namespace content { | |
| 15 | |
| 16 class MockResourceContext : public ResourceContext { | |
| 17 public: | |
| 18 MockResourceContext(); | |
| 19 explicit MockResourceContext(net::URLRequestContext* context); | |
| 20 virtual ~MockResourceContext(); | |
| 21 | |
| 22 void set_request_context(net::URLRequestContext* context) { | |
| 23 test_request_context_ = context; | |
| 24 } | |
| 25 | |
| 26 void set_media_observer(MediaObserver* observer) { | |
| 27 media_observer_ = observer; | |
| 28 } | |
| 29 | |
| 30 // ResourceContext implementation: | |
| 31 virtual net::HostResolver* GetHostResolver() OVERRIDE; | |
| 32 virtual net::URLRequestContext* GetRequestContext() OVERRIDE; | |
| 33 virtual MediaObserver* GetMediaObserver() OVERRIDE; | |
| 34 | |
| 35 private: | |
| 36 scoped_refptr<net::URLRequestContext> test_request_context_; | |
| 37 MediaObserver* media_observer_; | |
| 38 }; | |
| 39 | |
| 40 } // namespace content | |
| 41 | |
| 42 #endif // CONTENT_BROWSER_MOCK_RESOURCE_CONTEXT_H_ | |
| OLD | NEW |