| 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/chrome_plugin_lib.h" | |
| 10 #include "chrome/common/net/url_fetcher.h" | 9 #include "chrome/common/net/url_fetcher.h" |
| 11 #include "chrome/common/net/url_request_context_getter.h" | 10 #include "chrome/common/net/url_request_context_getter.h" |
| 12 #include "net/http/http_response_headers.h" | 11 #include "net/http/http_response_headers.h" |
| 13 #include "net/test/test_server.h" | 12 #include "net/test/test_server.h" |
| 14 #include "net/url_request/url_request_test_util.h" | 13 #include "net/url_request/url_request_test_util.h" |
| 15 #include "net/url_request/url_request_throttler_manager.h" | 14 #include "net/url_request/url_request_throttler_manager.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 16 |
| 18 #if defined(USE_NSS) | 17 #if defined(USE_NSS) |
| 19 #include "net/ocsp/nss_ocsp.h" | 18 #include "net/ocsp/nss_ocsp.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy() { | 69 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy() { |
| 71 return io_message_loop_proxy_; | 70 return io_message_loop_proxy_; |
| 72 } | 71 } |
| 73 | 72 |
| 74 protected: | 73 protected: |
| 75 virtual void SetUp() { | 74 virtual void SetUp() { |
| 76 testing::Test::SetUp(); | 75 testing::Test::SetUp(); |
| 77 | 76 |
| 78 io_message_loop_proxy_ = base::MessageLoopProxy::CreateForCurrentThread(); | 77 io_message_loop_proxy_ = base::MessageLoopProxy::CreateForCurrentThread(); |
| 79 | 78 |
| 80 // Ensure that any plugin operations done by other tests are cleaned up. | |
| 81 ChromePluginLib::UnloadAllPlugins(); | |
| 82 #if defined(USE_NSS) | 79 #if defined(USE_NSS) |
| 83 net::EnsureOCSPInit(); | 80 net::EnsureOCSPInit(); |
| 84 #endif | 81 #endif |
| 85 } | 82 } |
| 86 | 83 |
| 87 virtual void TearDown() { | 84 virtual void TearDown() { |
| 88 #if defined(USE_NSS) | 85 #if defined(USE_NSS) |
| 89 net::ShutdownOCSP(); | 86 net::ShutdownOCSP(); |
| 90 #endif | 87 #endif |
| 91 } | 88 } |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 | 693 |
| 697 // Create the fetcher on the main thread. Since IO will happen on the main | 694 // Create the fetcher on the main thread. Since IO will happen on the main |
| 698 // thread, this will test URLFetcher's ability to do everything on one | 695 // thread, this will test URLFetcher's ability to do everything on one |
| 699 // thread. | 696 // thread. |
| 700 CreateFetcher(test_server.GetURL("defaultresponse")); | 697 CreateFetcher(test_server.GetURL("defaultresponse")); |
| 701 | 698 |
| 702 MessageLoop::current()->Run(); | 699 MessageLoop::current()->Run(); |
| 703 } | 700 } |
| 704 | 701 |
| 705 } // namespace. | 702 } // namespace. |
| OLD | NEW |