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

Unified Diff: chrome/test/base/ui_test_utils.cc

Issue 10541168: Add end to end client cert auth test for wss (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reflects review comments Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/base/ui_test_utils.h ('k') | chrome/test/data/ssl/cacert.pem » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/ui_test_utils.cc
diff --git a/chrome/test/base/ui_test_utils.cc b/chrome/test/base/ui_test_utils.cc
index 031ea05f0e2b70cb7029183db94d376eb4402b1f..379d4c16a062ef6d646e5ce18f9ee1a350ea0534 100644
--- a/chrome/test/base/ui_test_utils.cc
+++ b/chrome/test/base/ui_test_utils.cc
@@ -877,7 +877,8 @@ void MessageLoopRunner::Quit() {
TestWebSocketServer::TestWebSocketServer()
: started_(false),
port_(kDefaultWsPort),
- secure_(false) {
+ secure_(false),
+ client_authentication_(false) {
#if defined(OS_POSIX)
process_group_id_ = base::kNullProcessHandle;
#endif
@@ -892,6 +893,10 @@ void TestWebSocketServer::UseTLS() {
secure_ = true;
}
+void TestWebSocketServer::UseClientAuthentication() {
+ client_authentication_ = true;
+}
+
bool TestWebSocketServer::Start(const FilePath& root_directory) {
if (started_)
return true;
@@ -909,6 +914,13 @@ bool TestWebSocketServer::Start(const FilePath& root_directory) {
LOG(ERROR) << "Unable to create a temporary directory.";
return false;
}
+ if (client_authentication_) {
+ FilePath cacert_path(root_directory);
+ cmd_line->AppendArg("--ca-certificate");
+ cacert_path = cacert_path.Append(FILE_PATH_LITERAL("ssl"));
+ cacert_path = cacert_path.Append(FILE_PATH_LITERAL("cacert.pem"));
+ cmd_line->AppendArgNative(cacert_path.value());
+ }
cmd_line->AppendArgNative(FILE_PATH_LITERAL("--output-dir=") +
temp_dir_.path().value());
websocket_pid_file_ = temp_dir_.path().AppendASCII("websocket.pid");
« no previous file with comments | « chrome/test/base/ui_test_utils.h ('k') | chrome/test/data/ssl/cacert.pem » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698