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/message_loop_proxy.h" | 5 #include "base/message_loop_proxy.h" |
6 #include "base/synchronization/waitable_event.h" | 6 #include "base/synchronization/waitable_event.h" |
7 #include "base/threading/thread.h" | 7 #include "base/threading/thread.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "content/common/url_fetcher.h" | 9 #include "content/common/url_fetcher.h" |
10 #include "crypto/nss_util.h" | 10 #include "crypto/nss_util.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 const std::string& data); | 88 const std::string& data); |
89 | 89 |
90 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy() { | 90 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy() { |
91 return io_message_loop_proxy_; | 91 return io_message_loop_proxy_; |
92 } | 92 } |
93 | 93 |
94 protected: | 94 protected: |
95 virtual void SetUp() { | 95 virtual void SetUp() { |
96 testing::Test::SetUp(); | 96 testing::Test::SetUp(); |
97 | 97 |
98 io_message_loop_proxy_ = base::MessageLoopProxy::CreateForCurrentThread(); | 98 io_message_loop_proxy_ = base::MessageLoopProxy::current(); |
99 | 99 |
100 #if defined(USE_NSS) | 100 #if defined(USE_NSS) |
101 crypto::EnsureNSSInit(); | 101 crypto::EnsureNSSInit(); |
102 net::EnsureOCSPInit(); | 102 net::EnsureOCSPInit(); |
103 #endif | 103 #endif |
104 } | 104 } |
105 | 105 |
106 virtual void TearDown() { | 106 virtual void TearDown() { |
107 #if defined(USE_NSS) | 107 #if defined(USE_NSS) |
108 net::ShutdownOCSP(); | 108 net::ShutdownOCSP(); |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 FROM_HERE, | 897 FROM_HERE, |
898 new CurriedTask(new MessageLoop::QuitTask(), MessageLoop::current())); | 898 new CurriedTask(new MessageLoop::QuitTask(), MessageLoop::current())); |
899 MessageLoop::current()->Run(); | 899 MessageLoop::current()->Run(); |
900 EXPECT_EQ(1, GetNumFetcherCores()); | 900 EXPECT_EQ(1, GetNumFetcherCores()); |
901 URLFetcher::CancelAll(); | 901 URLFetcher::CancelAll(); |
902 EXPECT_EQ(0, GetNumFetcherCores()); | 902 EXPECT_EQ(0, GetNumFetcherCores()); |
903 delete fetcher_; | 903 delete fetcher_; |
904 } | 904 } |
905 | 905 |
906 } // namespace. | 906 } // namespace. |
OLD | NEW |