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 "base/macros.h" |
| 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "chrome/browser/extensions/extension_apitest.h" |
| 8 #include "chromeos/chromeos_switches.h" |
| 9 #include "content/public/test/test_utils.h" |
| 10 #include "net/base/test_data_directory.h" |
| 11 #include "net/cert/test_root_certs.h" |
| 12 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 13 #include "base/files/file_path.h" |
| 14 #include "net/base/escape.h" |
| 15 #include "chrome/test/base/ui_test_utils.h" |
| 16 |
| 17 namespace { |
| 18 |
| 19 class CertificateProviderApiTest : public ExtensionApiTest { |
| 20 public: |
| 21 CertificateProviderApiTest() {} |
| 22 |
| 23 void SetUp() override { |
| 24 ExtensionApiTest::SetUp(); |
| 25 } |
| 26 |
| 27 private: |
| 28 }; |
| 29 |
| 30 } // namespace |
| 31 |
| 32 IN_PROC_BROWSER_TEST_F(CertificateProviderApiTest, Basic) { |
| 33 net::SpawnedTestServer::SSLOptions ssl_options; |
| 34 ssl_options.request_client_certificate = true; |
| 35 /* ssl_options.client_authorities.push_back(base::FilePath(FILE_PATH_LITERAL( |
| 36 "chrome/test/data/extensions/api_test/certificate_provider/root.pem"))); |
| 37 */ |
| 38 net::SpawnedTestServer https_server( |
| 39 net::SpawnedTestServer::TYPE_HTTPS, ssl_options, |
| 40 base::FilePath(FILE_PATH_LITERAL("chrome/test/data"))); |
| 41 ASSERT_TRUE(https_server.Start()); |
| 42 |
| 43 ASSERT_TRUE(RunExtensionSubtest("certificate_provider", "basic.html")) |
| 44 << message_; |
| 45 |
| 46 GURL url(https_server.GetURL("client-cert")); |
| 47 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( |
| 48 browser(), url, 1); |
| 49 |
| 50 /* |
| 51 GURL::Replacements replacements; |
| 52 replacements.SetSchemeStr("https"); |
| 53 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( |
| 54 browser(), https_server.GetURL("files/english_page.html") |
| 55 .ReplaceComponents(replacements), |
| 56 1); |
| 57 */ |
| 58 |
| 59 base::RunLoop loop; |
| 60 loop.Run(); |
| 61 } |
OLD | NEW |