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 // 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 27 matching lines...) Expand all Loading... |
38 #include "chrome/common/chrome_paths.h" | 38 #include "chrome/common/chrome_paths.h" |
39 #include "chrome/test/automation/tab_proxy.h" | 39 #include "chrome/test/automation/tab_proxy.h" |
40 #include "chrome/test/ui/ui_test.h" | 40 #include "chrome/test/ui/ui_test.h" |
41 #include "net/base/capturing_net_log.h" | 41 #include "net/base/capturing_net_log.h" |
42 #include "net/base/cert_verifier.h" | 42 #include "net/base/cert_verifier.h" |
43 #include "net/base/host_resolver.h" | 43 #include "net/base/host_resolver.h" |
44 #include "net/base/net_util.h" | 44 #include "net/base/net_util.h" |
45 #include "net/base/ssl_config_service_defaults.h" | 45 #include "net/base/ssl_config_service_defaults.h" |
46 #include "net/http/http_auth_handler_factory.h" | 46 #include "net/http/http_auth_handler_factory.h" |
47 #include "net/http/http_cache.h" | 47 #include "net/http/http_cache.h" |
48 #include "net/http/http_network_layer.h" | 48 #include "net/http/http_network_session.h" |
| 49 #include "net/socket/client_socket_factory.h" |
| 50 #include "net/spdy/spdy_session_pool.h" |
49 #include "net/url_request/url_request_context.h" | 51 #include "net/url_request/url_request_context.h" |
50 #include "net/url_request/url_request_status.h" | 52 #include "net/url_request/url_request_status.h" |
51 #include "third_party/npapi/bindings/npapi.h" | 53 #include "third_party/npapi/bindings/npapi.h" |
52 #include "webkit/plugins/npapi/plugin_constants_win.h" | 54 #include "webkit/plugins/npapi/plugin_constants_win.h" |
53 #include "webkit/plugins/npapi/plugin_list.h" | 55 #include "webkit/plugins/npapi/plugin_list.h" |
54 #include "webkit/plugins/plugin_switches.h" | 56 #include "webkit/plugins/plugin_switches.h" |
55 | 57 |
56 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
57 #include "base/win/registry.h" | 59 #include "base/win/registry.h" |
58 #endif | 60 #endif |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 const size_t kNetLogBound = 50u; | 279 const size_t kNetLogBound = 50u; |
278 net_log_.reset(new net::CapturingNetLog(kNetLogBound)); | 280 net_log_.reset(new net::CapturingNetLog(kNetLogBound)); |
279 | 281 |
280 proxy_service_ = net::ProxyService::CreateUsingSystemProxyResolver( | 282 proxy_service_ = net::ProxyService::CreateUsingSystemProxyResolver( |
281 proxy_config_service, 0, net_log_.get()); | 283 proxy_config_service, 0, net_log_.get()); |
282 DCHECK(proxy_service_); | 284 DCHECK(proxy_service_); |
283 | 285 |
284 ssl_config_service_ = new net::SSLConfigServiceDefaults; | 286 ssl_config_service_ = new net::SSLConfigServiceDefaults; |
285 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault( | 287 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault( |
286 host_resolver_); | 288 host_resolver_); |
| 289 scoped_refptr<net::HttpNetworkSession> network_session( |
| 290 new net::HttpNetworkSession( |
| 291 host_resolver_, |
| 292 cert_verifier_, |
| 293 NULL /* dnsrr_resolver */, |
| 294 NULL /* dns_cert_checker */, |
| 295 NULL /* ssl_host_info_factory */, |
| 296 proxy_service_, |
| 297 net::ClientSocketFactory::GetDefaultFactory(), |
| 298 ssl_config_service_, |
| 299 new net::SpdySessionPool(NULL), |
| 300 http_auth_handler_factory_, |
| 301 network_delegate_, |
| 302 NULL /* net_log */)); |
287 http_transaction_factory_ = new net::HttpCache( | 303 http_transaction_factory_ = new net::HttpCache( |
288 net::HttpNetworkLayer::CreateFactory(host_resolver_, | 304 network_session, |
289 cert_verifier_, | |
290 NULL /* dnsrr_resolver */, | |
291 NULL /* dns_cert_checker */, | |
292 NULL /* ssl_host_info_factory */, | |
293 proxy_service_, | |
294 ssl_config_service_, | |
295 http_auth_handler_factory_, | |
296 network_delegate_, | |
297 NULL), | |
298 NULL /* net_log */, | |
299 net::HttpCache::DefaultBackend::InMemory(0)); | 305 net::HttpCache::DefaultBackend::InMemory(0)); |
300 } | 306 } |
301 | 307 |
302 private: | 308 private: |
303 scoped_ptr<net::NetLog> net_log_; | 309 scoped_ptr<net::NetLog> net_log_; |
304 scoped_ptr<net::URLSecurityManager> url_security_manager_; | 310 scoped_ptr<net::URLSecurityManager> url_security_manager_; |
305 }; | 311 }; |
306 | 312 |
307 PluginInstallerDownloadTest() | 313 PluginInstallerDownloadTest() |
308 : success_(false), | 314 : success_(false), |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 TEST_F(PluginInstallerDownloadTest, PluginInstallerDownloadPathTest) { | 359 TEST_F(PluginInstallerDownloadTest, PluginInstallerDownloadPathTest) { |
354 MessageLoop loop(MessageLoop::TYPE_IO); | 360 MessageLoop loop(MessageLoop::TYPE_IO); |
355 Start(); | 361 Start(); |
356 loop.Run(); | 362 loop.Run(); |
357 | 363 |
358 EXPECT_TRUE(success()); | 364 EXPECT_TRUE(success()); |
359 EXPECT_TRUE(initial_download_path().BaseName().value() == | 365 EXPECT_TRUE(initial_download_path().BaseName().value() == |
360 final_download_path().BaseName().value()); | 366 final_download_path().BaseName().value()); |
361 } | 367 } |
362 #endif // defined(OS_WIN) | 368 #endif // defined(OS_WIN) |
OLD | NEW |