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

Side by Side Diff: jingle/notifier/base/xmpp_connection_unittest.cc

Issue 7583053: Add MessageLoopProxy::current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No need for MessageLoopProxy destruction observer. Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "jingle/notifier/base/xmpp_connection.h" 5 #include "jingle/notifier/base/xmpp_connection.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 20 matching lines...) Expand all
31 class SocketAddress; 31 class SocketAddress;
32 class Task; 32 class Task;
33 } // namespace talk_base 33 } // namespace talk_base
34 34
35 namespace { 35 namespace {
36 // TODO(sanjeevr): Move this to net_test_support. 36 // TODO(sanjeevr): Move this to net_test_support.
37 // Used to return a dummy context. 37 // Used to return a dummy context.
38 class TestURLRequestContextGetter : public net::URLRequestContextGetter { 38 class TestURLRequestContextGetter : public net::URLRequestContextGetter {
39 public: 39 public:
40 TestURLRequestContextGetter() 40 TestURLRequestContextGetter()
41 : message_loop_proxy_(base::MessageLoopProxy::CreateForCurrentThread()) { 41 : message_loop_proxy_(base::MessageLoopProxy::current()) {
42 } 42 }
43 virtual ~TestURLRequestContextGetter() { } 43 virtual ~TestURLRequestContextGetter() { }
44 44
45 // net::URLRequestContextGetter: 45 // net::URLRequestContextGetter:
46 virtual net::URLRequestContext* GetURLRequestContext() { 46 virtual net::URLRequestContext* GetURLRequestContext() {
47 if (!context_) 47 if (!context_)
48 context_ = new TestURLRequestContext(); 48 context_ = new TestURLRequestContext();
49 return context_.get(); 49 return context_.get();
50 } 50 }
51 virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const { 51 virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const {
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 .WillByDefault(Return(TASK_STATE_ERROR)); 260 .WillByDefault(Return(TASK_STATE_ERROR));
261 EXPECT_CALL(*task, ProcessStart()).Times(0); 261 EXPECT_CALL(*task, ProcessStart()).Times(0);
262 task->Start(); 262 task->Start();
263 } 263 }
264 264
265 // This should destroy |task_pump|, but |task| still shouldn't run. 265 // This should destroy |task_pump|, but |task| still shouldn't run.
266 message_loop_.RunAllPending(); 266 message_loop_.RunAllPending();
267 } 267 }
268 268
269 } // namespace notifier 269 } // namespace notifier
OLDNEW
« no previous file with comments | « jingle/notifier/base/proxy_resolving_client_socket_unittest.cc ('k') | jingle/notifier/listener/mediator_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698