| 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 "chrome/common/net/url_fetcher.h" | 9 #include "content/common/url_fetcher.h" |
| 10 #include "crypto/nss_util.h" |
| 10 #include "net/http/http_response_headers.h" | 11 #include "net/http/http_response_headers.h" |
| 11 #include "net/test/test_server.h" | 12 #include "net/test/test_server.h" |
| 12 #include "net/url_request/url_request_context_getter.h" | 13 #include "net/url_request/url_request_context_getter.h" |
| 13 #include "net/url_request/url_request_test_util.h" | 14 #include "net/url_request/url_request_test_util.h" |
| 14 #include "net/url_request/url_request_throttler_manager.h" | 15 #include "net/url_request/url_request_throttler_manager.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 17 |
| 17 #if defined(USE_NSS) | 18 #if defined(USE_NSS) |
| 18 #include "net/ocsp/nss_ocsp.h" | 19 #include "net/ocsp/nss_ocsp.h" |
| 19 #endif | 20 #endif |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 return io_message_loop_proxy_; | 91 return io_message_loop_proxy_; |
| 91 } | 92 } |
| 92 | 93 |
| 93 protected: | 94 protected: |
| 94 virtual void SetUp() { | 95 virtual void SetUp() { |
| 95 testing::Test::SetUp(); | 96 testing::Test::SetUp(); |
| 96 | 97 |
| 97 io_message_loop_proxy_ = base::MessageLoopProxy::CreateForCurrentThread(); | 98 io_message_loop_proxy_ = base::MessageLoopProxy::CreateForCurrentThread(); |
| 98 | 99 |
| 99 #if defined(USE_NSS) | 100 #if defined(USE_NSS) |
| 101 crypto::EnsureNSSInit(); |
| 100 net::EnsureOCSPInit(); | 102 net::EnsureOCSPInit(); |
| 101 #endif | 103 #endif |
| 102 } | 104 } |
| 103 | 105 |
| 104 virtual void TearDown() { | 106 virtual void TearDown() { |
| 105 #if defined(USE_NSS) | 107 #if defined(USE_NSS) |
| 106 net::ShutdownOCSP(); | 108 net::ShutdownOCSP(); |
| 107 #endif | 109 #endif |
| 108 } | 110 } |
| 109 | 111 |
| (...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 FROM_HERE, | 895 FROM_HERE, |
| 894 new CurriedTask(new MessageLoop::QuitTask(), MessageLoop::current())); | 896 new CurriedTask(new MessageLoop::QuitTask(), MessageLoop::current())); |
| 895 MessageLoop::current()->Run(); | 897 MessageLoop::current()->Run(); |
| 896 EXPECT_EQ(1, GetNumFetcherCores()); | 898 EXPECT_EQ(1, GetNumFetcherCores()); |
| 897 URLFetcher::CancelAll(); | 899 URLFetcher::CancelAll(); |
| 898 EXPECT_EQ(0, GetNumFetcherCores()); | 900 EXPECT_EQ(0, GetNumFetcherCores()); |
| 899 delete fetcher_; | 901 delete fetcher_; |
| 900 } | 902 } |
| 901 | 903 |
| 902 } // namespace. | 904 } // namespace. |
| OLD | NEW |