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

Unified Diff: jingle/notifier/base/xmpp_connection_unittest.cc

Issue 9562037: Move TestURLRequestContextGetter to url_request_test_util.{h,cc} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change comment Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: jingle/notifier/base/xmpp_connection_unittest.cc
diff --git a/jingle/notifier/base/xmpp_connection_unittest.cc b/jingle/notifier/base/xmpp_connection_unittest.cc
index e2c88cd5cd3ef5b979f0385f122a94063e8e790f..1c37bde7e85519fa6a6b596d35b76198de63bd7e 100644
--- a/jingle/notifier/base/xmpp_connection_unittest.cc
+++ b/jingle/notifier/base/xmpp_connection_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,6 +8,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop.h"
#include "jingle/notifier/base/mock_task.h"
@@ -32,32 +33,6 @@ class SocketAddress;
class Task;
} // namespace talk_base
-namespace {
-// TODO(sanjeevr): Move this to net_test_support.
-// Used to return a dummy context.
-class TestURLRequestContextGetter : public net::URLRequestContextGetter {
- public:
- TestURLRequestContextGetter()
- : message_loop_proxy_(base::MessageLoopProxy::current()) {
- }
- virtual ~TestURLRequestContextGetter() { }
-
- // net::URLRequestContextGetter:
- virtual net::URLRequestContext* GetURLRequestContext() {
- if (!context_)
- context_ = new TestURLRequestContext();
- return context_.get();
- }
- virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const {
- return message_loop_proxy_;
- }
-
- private:
- scoped_refptr<net::URLRequestContext> context_;
- scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
-};
-} // namespace
-
namespace notifier {
using ::testing::_;
@@ -98,7 +73,8 @@ class XmppConnectionTest : public testing::Test {
protected:
XmppConnectionTest()
: mock_pre_xmpp_auth_(new MockPreXmppAuth()),
- url_request_context_getter_(new TestURLRequestContextGetter()) {}
+ url_request_context_getter_(new TestURLRequestContextGetter(
+ message_loop_.message_loop_proxy())) {}
virtual ~XmppConnectionTest() {}
« no previous file with comments | « jingle/notifier/base/proxy_resolving_client_socket_unittest.cc ('k') | jingle/notifier/listener/mediator_thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698