| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Tests for the top plugins to catch regressions in our plugin host code, as | 5 // Tests for the top plugins to catch regressions in our plugin host code, as |
| 6 // well as in the out of process code. Currently this tests: | 6 // well as in the out of process code. Currently this tests: |
| 7 // Flash | 7 // Flash |
| 8 // Real | 8 // Real |
| 9 // QuickTime | 9 // QuickTime |
| 10 // Windows Media Player | 10 // Windows Media Player |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "base/file_util.h" | 31 #include "base/file_util.h" |
| 32 #include "base/message_loop.h" | 32 #include "base/message_loop.h" |
| 33 #include "base/path_service.h" | 33 #include "base/path_service.h" |
| 34 #include "chrome/browser/net/url_request_mock_http_job.h" | 34 #include "chrome/browser/net/url_request_mock_http_job.h" |
| 35 #include "chrome/browser/plugin_download_helper.h" | 35 #include "chrome/browser/plugin_download_helper.h" |
| 36 #include "chrome/common/chrome_switches.h" | 36 #include "chrome/common/chrome_switches.h" |
| 37 #include "chrome/common/chrome_paths.h" | 37 #include "chrome/common/chrome_paths.h" |
| 38 #include "chrome/test/automation/tab_proxy.h" | 38 #include "chrome/test/automation/tab_proxy.h" |
| 39 #include "chrome/test/ui/ui_test.h" | 39 #include "chrome/test/ui/ui_test.h" |
| 40 #include "net/base/capturing_net_log.h" | 40 #include "net/base/capturing_net_log.h" |
| 41 #include "net/base/cert_verifier.h" |
| 41 #include "net/base/host_resolver.h" | 42 #include "net/base/host_resolver.h" |
| 42 #include "net/base/net_util.h" | 43 #include "net/base/net_util.h" |
| 43 #include "net/base/ssl_config_service_defaults.h" | 44 #include "net/base/ssl_config_service_defaults.h" |
| 44 #include "net/http/http_auth_handler_factory.h" | 45 #include "net/http/http_auth_handler_factory.h" |
| 45 #include "net/http/http_cache.h" | 46 #include "net/http/http_cache.h" |
| 46 #include "net/http/http_network_layer.h" | 47 #include "net/http/http_network_layer.h" |
| 47 #include "net/url_request/url_request_context.h" | 48 #include "net/url_request/url_request_context.h" |
| 48 #include "net/url_request/url_request_status.h" | 49 #include "net/url_request/url_request_status.h" |
| 49 #include "third_party/npapi/bindings/npapi.h" | 50 #include "third_party/npapi/bindings/npapi.h" |
| 50 #include "webkit/glue/plugins/plugin_constants_win.h" | 51 #include "webkit/glue/plugins/plugin_constants_win.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 class UploadRequestContext : public URLRequestContext { | 252 class UploadRequestContext : public URLRequestContext { |
| 252 public: | 253 public: |
| 253 UploadRequestContext() { | 254 UploadRequestContext() { |
| 254 Initialize(); | 255 Initialize(); |
| 255 } | 256 } |
| 256 | 257 |
| 257 ~UploadRequestContext() { | 258 ~UploadRequestContext() { |
| 258 DVLOG(1) << __FUNCTION__; | 259 DVLOG(1) << __FUNCTION__; |
| 259 delete http_transaction_factory_; | 260 delete http_transaction_factory_; |
| 260 delete http_auth_handler_factory_; | 261 delete http_auth_handler_factory_; |
| 262 delete cert_verifier_; |
| 263 delete host_resolver_; |
| 261 } | 264 } |
| 262 | 265 |
| 263 void Initialize() { | 266 void Initialize() { |
| 264 host_resolver_ = | 267 host_resolver_ = |
| 265 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, | 268 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, |
| 266 NULL, NULL); | 269 NULL, NULL); |
| 270 cert_verifier_ = new net::CertVerifier; |
| 267 net::ProxyConfigService* proxy_config_service = | 271 net::ProxyConfigService* proxy_config_service = |
| 268 net::ProxyService::CreateSystemProxyConfigService(NULL, NULL); | 272 net::ProxyService::CreateSystemProxyConfigService(NULL, NULL); |
| 269 DCHECK(proxy_config_service); | 273 DCHECK(proxy_config_service); |
| 270 | 274 |
| 271 const size_t kNetLogBound = 50u; | 275 const size_t kNetLogBound = 50u; |
| 272 net_log_.reset(new net::CapturingNetLog(kNetLogBound)); | 276 net_log_.reset(new net::CapturingNetLog(kNetLogBound)); |
| 273 | 277 |
| 274 proxy_service_ = net::ProxyService::CreateUsingSystemProxyResolver( | 278 proxy_service_ = net::ProxyService::CreateUsingSystemProxyResolver( |
| 275 proxy_config_service, 0, net_log_.get()); | 279 proxy_config_service, 0, net_log_.get()); |
| 276 DCHECK(proxy_service_); | 280 DCHECK(proxy_service_); |
| 277 | 281 |
| 278 ssl_config_service_ = new net::SSLConfigServiceDefaults; | 282 ssl_config_service_ = new net::SSLConfigServiceDefaults; |
| 279 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault( | 283 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault( |
| 280 host_resolver_); | 284 host_resolver_); |
| 281 http_transaction_factory_ = new net::HttpCache( | 285 http_transaction_factory_ = new net::HttpCache( |
| 282 net::HttpNetworkLayer::CreateFactory(host_resolver_, | 286 net::HttpNetworkLayer::CreateFactory(host_resolver_, |
| 287 cert_verifier_, |
| 283 NULL /* dnsrr_resolver */, | 288 NULL /* dnsrr_resolver */, |
| 284 NULL /* dns_cert_checker */, | 289 NULL /* dns_cert_checker */, |
| 285 NULL /* ssl_host_info_factory */, | 290 NULL /* ssl_host_info_factory */, |
| 286 proxy_service_, | 291 proxy_service_, |
| 287 ssl_config_service_, | 292 ssl_config_service_, |
| 288 http_auth_handler_factory_, | 293 http_auth_handler_factory_, |
| 289 network_delegate_, | 294 network_delegate_, |
| 290 NULL), | 295 NULL), |
| 291 net::HttpCache::DefaultBackend::InMemory(0)); | 296 net::HttpCache::DefaultBackend::InMemory(0)); |
| 292 } | 297 } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 TEST_F(PluginInstallerDownloadTest, PluginInstallerDownloadPathTest) { | 350 TEST_F(PluginInstallerDownloadTest, PluginInstallerDownloadPathTest) { |
| 346 MessageLoop loop(MessageLoop::TYPE_IO); | 351 MessageLoop loop(MessageLoop::TYPE_IO); |
| 347 Start(); | 352 Start(); |
| 348 loop.Run(); | 353 loop.Run(); |
| 349 | 354 |
| 350 EXPECT_TRUE(success()); | 355 EXPECT_TRUE(success()); |
| 351 EXPECT_TRUE(initial_download_path().BaseName().value() == | 356 EXPECT_TRUE(initial_download_path().BaseName().value() == |
| 352 final_download_path().BaseName().value()); | 357 final_download_path().BaseName().value()); |
| 353 } | 358 } |
| 354 #endif // defined(OS_WIN) | 359 #endif // defined(OS_WIN) |
| OLD | NEW |