OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/extensions/extension_apitest.h" |
| 6 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 7 |
| 8 // Test that fetching a URL using TLS client auth doesn't crash, hang, or |
| 9 // prompt. |
| 10 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, XhrTlsClientAuth) { |
| 11 // Launch HTTPS server. |
| 12 net::SpawnedTestServer::SSLOptions ssl_options; |
| 13 ssl_options.request_client_certificate = true; |
| 14 net::SpawnedTestServer https_server( |
| 15 net::SpawnedTestServer::TYPE_HTTPS, ssl_options, |
| 16 base::FilePath(FILE_PATH_LITERAL("content/test/data"))); |
| 17 ASSERT_TRUE(https_server.Start()); |
| 18 |
| 19 std::string url = https_server.GetURL("").spec(); |
| 20 ASSERT_TRUE(RunExtensionTestWithArg("xhr", url.c_str())) << message_; |
| 21 } |
| 22 |
| 23 // Test that fetching a URL using HTTP auth doesn't crash, hang, or prompt. |
| 24 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, XhrHttpAuth) { |
| 25 ASSERT_TRUE(StartSpawnedTestServer()); |
| 26 |
| 27 std::string url = test_server()->GetURL("/auth-basic").spec(); |
| 28 ASSERT_TRUE(RunExtensionTestWithArg("xhr", url.c_str())) << message_; |
| 29 } |
OLD | NEW |