Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: content/browser/shared_worker/worker_browsertest.cc

Issue 1474983003: Support for client certs in ssl_server_socket. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | net/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 GURL url = embedded_test_server()->GetURL("/workers/shared_worker_auth.html"); 165 GURL url = embedded_test_server()->GetURL("/workers/shared_worker_auth.html");
166 NavigateAndWaitForAuth(url); 166 NavigateAndWaitForAuth(url);
167 } 167 }
168 168
169 // Tests that TLS client auth prompts for normal workers. 169 // Tests that TLS client auth prompts for normal workers.
170 IN_PROC_BROWSER_TEST_F(WorkerTest, WorkerTlsClientAuth) { 170 IN_PROC_BROWSER_TEST_F(WorkerTest, WorkerTlsClientAuth) {
171 // Launch HTTPS server. 171 // Launch HTTPS server.
172 net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS); 172 net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
173 https_server.ServeFilesFromSourceDirectory("content/test/data"); 173 https_server.ServeFilesFromSourceDirectory("content/test/data");
174 net::SSLServerConfig ssl_config; 174 net::SSLServerConfig ssl_config;
175 ssl_config.require_client_cert = true; 175 ssl_config.client_cert_type =
176 net::SSLServerConfig::ClientCertType::REQUIRE_CLIENT_CERT;
176 https_server.SetSSLConfig(net::EmbeddedTestServer::CERT_OK, ssl_config); 177 https_server.SetSSLConfig(net::EmbeddedTestServer::CERT_OK, ssl_config);
177 ASSERT_TRUE(https_server.Start()); 178 ASSERT_TRUE(https_server.Start());
178 179
179 RunTest("worker_tls_client_auth.html", 180 RunTest("worker_tls_client_auth.html",
180 "url=" + net::EscapeQueryParamValue(https_server.GetURL("/").spec(), 181 "url=" + net::EscapeQueryParamValue(https_server.GetURL("/").spec(),
181 true)); 182 true));
182 EXPECT_EQ(1, select_certificate_count()); 183 EXPECT_EQ(1, select_certificate_count());
183 } 184 }
184 185
185 // Tests that TLS client auth does not prompt for a shared worker; shared 186 // Tests that TLS client auth does not prompt for a shared worker; shared
186 // workers are not associated with a WebContents. 187 // workers are not associated with a WebContents.
187 IN_PROC_BROWSER_TEST_F(WorkerTest, SharedWorkerTlsClientAuth) { 188 IN_PROC_BROWSER_TEST_F(WorkerTest, SharedWorkerTlsClientAuth) {
188 if (!SupportsSharedWorker()) 189 if (!SupportsSharedWorker())
189 return; 190 return;
190 191
191 // Launch HTTPS server. 192 // Launch HTTPS server.
192 net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS); 193 net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
193 https_server.ServeFilesFromSourceDirectory("content/test/data"); 194 https_server.ServeFilesFromSourceDirectory("content/test/data");
194 net::SSLServerConfig ssl_config; 195 net::SSLServerConfig ssl_config;
195 ssl_config.require_client_cert = true; 196 ssl_config.client_cert_type =
197 net::SSLServerConfig::ClientCertType::REQUIRE_CLIENT_CERT;
196 https_server.SetSSLConfig(net::EmbeddedTestServer::CERT_OK, ssl_config); 198 https_server.SetSSLConfig(net::EmbeddedTestServer::CERT_OK, ssl_config);
197 ASSERT_TRUE(https_server.Start()); 199 ASSERT_TRUE(https_server.Start());
198 200
199 RunTest("worker_tls_client_auth.html", 201 RunTest("worker_tls_client_auth.html",
200 "shared=true&url=" + net::EscapeQueryParamValue( 202 "shared=true&url=" + net::EscapeQueryParamValue(
201 https_server.GetURL("/").spec(), true)); 203 https_server.GetURL("/").spec(), true));
202 EXPECT_EQ(0, select_certificate_count()); 204 EXPECT_EQ(0, select_certificate_count());
203 } 205 }
204 206
205 IN_PROC_BROWSER_TEST_F(WorkerTest, WebSocketSharedWorker) { 207 IN_PROC_BROWSER_TEST_F(WorkerTest, WebSocketSharedWorker) {
(...skipping 30 matching lines...) Expand all
236 238
237 IN_PROC_BROWSER_TEST_F(WorkerTest, 239 IN_PROC_BROWSER_TEST_F(WorkerTest,
238 PassMessagePortToSharedWorkerDontWaitForConnect) { 240 PassMessagePortToSharedWorkerDontWaitForConnect) {
239 if (!SupportsSharedWorker()) 241 if (!SupportsSharedWorker())
240 return; 242 return;
241 243
242 RunTest("pass_messageport_to_sharedworker_dont_wait_for_connect.html", ""); 244 RunTest("pass_messageport_to_sharedworker_dont_wait_for_connect.html", "");
243 } 245 }
244 246
245 } // namespace content 247 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | net/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698