| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/message_loop_proxy.h" | 7 #include "base/message_loop_proxy.h" |
| 8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } | 89 } |
| 90 | 90 |
| 91 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy() { | 91 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy() { |
| 92 return io_message_loop_proxy_; | 92 return io_message_loop_proxy_; |
| 93 } | 93 } |
| 94 | 94 |
| 95 protected: | 95 protected: |
| 96 virtual void SetUp() { | 96 virtual void SetUp() { |
| 97 testing::Test::SetUp(); | 97 testing::Test::SetUp(); |
| 98 | 98 |
| 99 io_message_loop_proxy_ = base::MessageLoopProxy::CreateForCurrentThread(); | 99 io_message_loop_proxy_ = base::MessageLoopProxy::current(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 virtual void TearDown() { | 102 virtual void TearDown() { |
| 103 fetcher_ = NULL; | 103 fetcher_ = NULL; |
| 104 // Deleting the fetcher causes a task to be posted to the IO thread to | 104 // Deleting the fetcher causes a task to be posted to the IO thread to |
| 105 // release references to the URLRequestContextGetter. We need to run all | 105 // release references to the URLRequestContextGetter. We need to run all |
| 106 // pending tasks to execute that (this is the IO thread). | 106 // pending tasks to execute that (this is the IO thread). |
| 107 MessageLoop::current()->RunAllPending(); | 107 MessageLoop::current()->RunAllPending(); |
| 108 EXPECT_EQ(0, g_request_context_getter_instances); | 108 EXPECT_EQ(0, g_request_context_getter_instances); |
| 109 } | 109 } |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 manager->OverrideEntryForTests(url, entry); | 353 manager->OverrideEntryForTests(url, entry); |
| 354 | 354 |
| 355 CreateFetcher(url, 11); | 355 CreateFetcher(url, 11); |
| 356 | 356 |
| 357 MessageLoop::current()->Run(); | 357 MessageLoop::current()->Run(); |
| 358 | 358 |
| 359 net::URLRequestThrottlerManager::GetInstance()->EraseEntryForTests(url); | 359 net::URLRequestThrottlerManager::GetInstance()->EraseEntryForTests(url); |
| 360 } | 360 } |
| 361 | 361 |
| 362 } // namespace. | 362 } // namespace. |
| OLD | NEW |