| Index: chrome/browser/extensions/xhr_apitest.cc
|
| diff --git a/chrome/browser/extensions/xhr_apitest.cc b/chrome/browser/extensions/xhr_apitest.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..abb80e9b136239898683a1bb929487a37642eaf2
|
| --- /dev/null
|
| +++ b/chrome/browser/extensions/xhr_apitest.cc
|
| @@ -0,0 +1,29 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/extensions/extension_apitest.h"
|
| +#include "net/test/spawned_test_server/spawned_test_server.h"
|
| +
|
| +// Test that fetching a URL using TLS client auth doesn't crash, hang, or
|
| +// prompt.
|
| +IN_PROC_BROWSER_TEST_F(ExtensionApiTest, XhrTlsClientAuth) {
|
| + // Launch HTTPS server.
|
| + net::SpawnedTestServer::SSLOptions ssl_options;
|
| + ssl_options.request_client_certificate = true;
|
| + net::SpawnedTestServer https_server(
|
| + net::SpawnedTestServer::TYPE_HTTPS, ssl_options,
|
| + base::FilePath(FILE_PATH_LITERAL("content/test/data")));
|
| + ASSERT_TRUE(https_server.Start());
|
| +
|
| + std::string url = https_server.GetURL("").spec();
|
| + ASSERT_TRUE(RunExtensionTestWithArg("xhr_fail", url.c_str())) << message_;
|
| +}
|
| +
|
| +// Test that fetching a URL using HTTP auth doesn't crash, hang, or prompt.
|
| +IN_PROC_BROWSER_TEST_F(ExtensionApiTest, XhrHttpAuth) {
|
| + ASSERT_TRUE(StartSpawnedTestServer());
|
| +
|
| + std::string url = test_server()->GetURL("/auth-basic").spec();
|
| + ASSERT_TRUE(RunExtensionTestWithArg("xhr_fail", url.c_str())) << message_;
|
| +}
|
|
|