OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "chrome/browser/extensions/extension_browsertest.h" | 8 #include "chrome/browser/extensions/extension_browsertest.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/profiles/profile_io_data.h" | 10 #include "chrome/browser/profiles/profile_io_data.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 content::BrowserThread::PostTaskAndReply( | 59 content::BrowserThread::PostTaskAndReply( |
60 content::BrowserThread::IO, FROM_HERE, | 60 content::BrowserThread::IO, FROM_HERE, |
61 base::Bind(&InstallNullCertStoreFactoryOnIOThread, | 61 base::Bind(&InstallNullCertStoreFactoryOnIOThread, |
62 browser()->profile()->GetResourceContext()), | 62 browser()->profile()->GetResourceContext()), |
63 loop.QuitClosure()); | 63 loop.QuitClosure()); |
64 loop.Run(); | 64 loop.Run(); |
65 | 65 |
66 // Launch HTTPS server. | 66 // Launch HTTPS server. |
67 net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS); | 67 net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS); |
68 net::SSLServerConfig ssl_config; | 68 net::SSLServerConfig ssl_config; |
69 ssl_config.require_client_cert = true; | 69 ssl_config.client_cert_type = |
| 70 net::SSLServerConfig::ClientCertType::REQUIRE_CLIENT_CERT; |
70 https_server.SetSSLConfig(net::EmbeddedTestServer::CERT_OK, ssl_config); | 71 https_server.SetSSLConfig(net::EmbeddedTestServer::CERT_OK, ssl_config); |
71 https_server.ServeFilesFromSourceDirectory("content/test/data"); | 72 https_server.ServeFilesFromSourceDirectory("content/test/data"); |
72 ASSERT_TRUE(https_server.Start()); | 73 ASSERT_TRUE(https_server.Start()); |
73 | 74 |
74 ASSERT_NO_FATAL_FAILURE( | 75 ASSERT_NO_FATAL_FAILURE( |
75 RunTest("test_tls_client_auth.html", https_server.GetURL("/"))); | 76 RunTest("test_tls_client_auth.html", https_server.GetURL("/"))); |
76 } | 77 } |
77 | 78 |
78 // Test that fetching a URL using HTTP auth doesn't crash, hang, or prompt. | 79 // Test that fetching a URL using HTTP auth doesn't crash, hang, or prompt. |
79 IN_PROC_BROWSER_TEST_F(BackgroundXhrTest, HttpAuth) { | 80 IN_PROC_BROWSER_TEST_F(BackgroundXhrTest, HttpAuth) { |
80 ASSERT_TRUE(embedded_test_server()->Start()); | 81 ASSERT_TRUE(embedded_test_server()->Start()); |
81 ASSERT_NO_FATAL_FAILURE(RunTest( | 82 ASSERT_NO_FATAL_FAILURE(RunTest( |
82 "test_http_auth.html", embedded_test_server()->GetURL("/auth-basic"))); | 83 "test_http_auth.html", embedded_test_server()->GetURL("/auth-basic"))); |
83 } | 84 } |
OLD | NEW |