OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |