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

Side by Side Diff: chrome/browser/ssl/ssl_browser_tests.cc

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.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 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 // Open a temporary NSS DB for testing. 662 // Open a temporary NSS DB for testing.
663 crypto::ScopedTestNSSDB test_nssdb; 663 crypto::ScopedTestNSSDB test_nssdb;
664 ASSERT_TRUE(test_nssdb.is_open()); 664 ASSERT_TRUE(test_nssdb.is_open());
665 665
666 // Import client cert for test. These interfaces require NSS. 666 // Import client cert for test. These interfaces require NSS.
667 net::NSSCertDatabase* cert_db = net::NSSCertDatabase::GetInstance(); 667 net::NSSCertDatabase* cert_db = net::NSSCertDatabase::GetInstance();
668 scoped_refptr<net::CryptoModule> crypt_module = cert_db->GetPublicModule(); 668 scoped_refptr<net::CryptoModule> crypt_module = cert_db->GetPublicModule();
669 std::string pkcs12_data; 669 std::string pkcs12_data;
670 base::FilePath cert_path = net::GetTestCertsDirectory().Append( 670 base::FilePath cert_path = net::GetTestCertsDirectory().Append(
671 FILE_PATH_LITERAL("websocket_client_cert.p12")); 671 FILE_PATH_LITERAL("websocket_client_cert.p12"));
672 EXPECT_TRUE(file_util::ReadFileToString(cert_path, &pkcs12_data)); 672 EXPECT_TRUE(base::ReadFileToString(cert_path, &pkcs12_data));
673 EXPECT_EQ(net::OK, 673 EXPECT_EQ(net::OK,
674 cert_db->ImportFromPKCS12( 674 cert_db->ImportFromPKCS12(
675 crypt_module.get(), pkcs12_data, string16(), true, NULL)); 675 crypt_module.get(), pkcs12_data, string16(), true, NULL));
676 676
677 // Start WebSocket test server with TLS and client cert authentication. 677 // Start WebSocket test server with TLS and client cert authentication.
678 net::SpawnedTestServer::SSLOptions options( 678 net::SpawnedTestServer::SSLOptions options(
679 net::SpawnedTestServer::SSLOptions::CERT_OK); 679 net::SpawnedTestServer::SSLOptions::CERT_OK);
680 options.request_client_certificate = true; 680 options.request_client_certificate = true;
681 base::FilePath ca_path = net::GetTestCertsDirectory().Append( 681 base::FilePath ca_path = net::GetTestCertsDirectory().Append(
682 FILE_PATH_LITERAL("websocket_cacert.pem")); 682 FILE_PATH_LITERAL("websocket_cacert.pem"));
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
1643 1643
1644 // Visit a page over https that contains a frame with a redirect. 1644 // Visit a page over https that contains a frame with a redirect.
1645 1645
1646 // XMLHttpRequest insecure content in synchronous mode. 1646 // XMLHttpRequest insecure content in synchronous mode.
1647 1647
1648 // XMLHttpRequest insecure content in asynchronous mode. 1648 // XMLHttpRequest insecure content in asynchronous mode.
1649 1649
1650 // XMLHttpRequest over bad ssl in synchronous mode. 1650 // XMLHttpRequest over bad ssl in synchronous mode.
1651 1651
1652 // XMLHttpRequest over OK ssl in synchronous mode. 1652 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc ('k') | chrome/browser/sxs_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698