OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/common/net/url_fetcher_impl.h" | 5 #include "content/common/net/url_fetcher_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 58 } |
59 | 59 |
60 protected: | 60 protected: |
61 virtual void SetUp() OVERRIDE { | 61 virtual void SetUp() OVERRIDE { |
62 testing::Test::SetUp(); | 62 testing::Test::SetUp(); |
63 | 63 |
64 io_message_loop_proxy_ = base::MessageLoopProxy::current(); | 64 io_message_loop_proxy_ = base::MessageLoopProxy::current(); |
65 | 65 |
66 #if defined(USE_NSS) | 66 #if defined(USE_NSS) |
67 crypto::EnsureNSSInit(); | 67 crypto::EnsureNSSInit(); |
68 net::EnsureOCSPInit(); | 68 net::EnsureNSSHttpIOInit(); |
69 #endif | 69 #endif |
70 } | 70 } |
71 | 71 |
72 virtual void TearDown() OVERRIDE { | 72 virtual void TearDown() OVERRIDE { |
73 #if defined(USE_NSS) | 73 #if defined(USE_NSS) |
74 net::ShutdownOCSP(); | 74 net::ShutdownNSSHttpIO(); |
75 #endif | 75 #endif |
76 } | 76 } |
77 | 77 |
78 // URLFetcher is designed to run on the main UI thread, but in our tests | 78 // URLFetcher is designed to run on the main UI thread, but in our tests |
79 // we assume that the current thread is the IO thread where the URLFetcher | 79 // we assume that the current thread is the IO thread where the URLFetcher |
80 // dispatches its requests to. When we wish to simulate being used from | 80 // dispatches its requests to. When we wish to simulate being used from |
81 // a UI thread, we dispatch a worker thread to do so. | 81 // a UI thread, we dispatch a worker thread to do so. |
82 MessageLoopForIO io_loop_; | 82 MessageLoopForIO io_loop_; |
83 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; | 83 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
84 | 84 |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 std::string(kTestServerFilePrefix) + kFileToFetch)); | 1043 std::string(kTestServerFilePrefix) + kFileToFetch)); |
1044 | 1044 |
1045 MessageLoop::current()->Run(); // OnURLFetchComplete() will Quit(). | 1045 MessageLoop::current()->Run(); // OnURLFetchComplete() will Quit(). |
1046 | 1046 |
1047 MessageLoop::current()->RunAllPending(); | 1047 MessageLoop::current()->RunAllPending(); |
1048 ASSERT_FALSE(file_util::PathExists(file_path_)) | 1048 ASSERT_FALSE(file_util::PathExists(file_path_)) |
1049 << file_path_.value() << " not removed."; | 1049 << file_path_.value() << " not removed."; |
1050 } | 1050 } |
1051 | 1051 |
1052 } // namespace. | 1052 } // namespace. |
OLD | NEW |