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

Unified Diff: jingle/notifier/listener/mediator_thread_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
« no previous file with comments | « jingle/notifier/base/xmpp_connection_unittest.cc ('k') | net/net.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: jingle/notifier/listener/mediator_thread_unittest.cc
diff --git a/jingle/notifier/listener/mediator_thread_unittest.cc b/jingle/notifier/listener/mediator_thread_unittest.cc
index 1d6767fbdcacefcfb94af6987ae582f1fb91cf31..afb8ce1f73e5589d2207760527b15dd3f87fae6c 100644
--- a/jingle/notifier/listener/mediator_thread_unittest.cc
+++ b/jingle/notifier/listener/mediator_thread_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.
@@ -22,30 +22,6 @@ namespace {
using ::testing::StrictMock;
-// 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_;
-};
-
class MockObserver : public MediatorThread::Observer {
public:
MOCK_METHOD1(OnConnectionStateChange, void(bool));
@@ -60,7 +36,7 @@ class MediatorThreadTest : public testing::Test {
protected:
MediatorThreadTest() {
notifier_options_.request_context_getter =
- new TestURLRequestContextGetter();
+ new TestURLRequestContextGetter(message_loop_.message_loop_proxy());
}
virtual ~MediatorThreadTest() {}
@@ -78,8 +54,7 @@ class MediatorThreadTest : public testing::Test {
mediator_thread_.reset();
}
- // Needed by TestURLRequestContextGetter.
- MessageLoopForIO message_loop_;
+ MessageLoop message_loop_;
NotifierOptions notifier_options_;
StrictMock<MockObserver> mock_observer_;
scoped_ptr<MediatorThreadImpl> mediator_thread_;
« no previous file with comments | « jingle/notifier/base/xmpp_connection_unittest.cc ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698