| 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 006aa6e99f071caeebfcae0577f10a41d5211f0a..fa033dfd04893a1c53c983e2bc0dcee53036deae 100644
|
| --- a/chrome/test/base/ui_test_utils.cc
|
| +++ b/chrome/test/base/ui_test_utils.cc
|
| @@ -878,7 +878,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
|
| @@ -893,6 +894,10 @@ void TestWebSocketServer::UseTLS() {
|
| secure_ = true;
|
| }
|
|
|
| +void TestWebSocketServer::UseClientAuthentication() {
|
| + client_authentication_ = true;
|
| +}
|
| +
|
| bool TestWebSocketServer::Start(const FilePath& root_directory) {
|
| if (started_)
|
| return true;
|
| @@ -910,6 +915,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");
|
|
|