| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/process_util.h" | 7 #include "base/process_util.h" |
| 8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 "function(local) { return local.getVideoTracks()[0]; }, " | 232 "function(local) { return local.getVideoTracks()[0]; }, " |
| 233 "'video');", tab_contents); | 233 "'video');", tab_contents); |
| 234 } | 234 } |
| 235 | 235 |
| 236 private: | 236 private: |
| 237 void RunPeerConnectionServer() { | 237 void RunPeerConnectionServer() { |
| 238 base::FilePath peerconnection_server; | 238 base::FilePath peerconnection_server; |
| 239 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &peerconnection_server)); | 239 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &peerconnection_server)); |
| 240 peerconnection_server = peerconnection_server.Append(kPeerConnectionServer); | 240 peerconnection_server = peerconnection_server.Append(kPeerConnectionServer); |
| 241 | 241 |
| 242 EXPECT_TRUE(file_util::PathExists(peerconnection_server)) << | 242 EXPECT_TRUE(base::PathExists(peerconnection_server)) << |
| 243 "Missing peerconnection_server. You must build " | 243 "Missing peerconnection_server. You must build " |
| 244 "it so it ends up next to the browser test binary."; | 244 "it so it ends up next to the browser test binary."; |
| 245 EXPECT_TRUE(base::LaunchProcess( | 245 EXPECT_TRUE(base::LaunchProcess( |
| 246 CommandLine(peerconnection_server), | 246 CommandLine(peerconnection_server), |
| 247 base::LaunchOptions(), | 247 base::LaunchOptions(), |
| 248 &peerconnection_server_)) << "Failed to launch peerconnection_server."; | 248 &peerconnection_server_)) << "Failed to launch peerconnection_server."; |
| 249 } | 249 } |
| 250 | 250 |
| 251 void ShutdownPeerConnectionServer() { | 251 void ShutdownPeerConnectionServer() { |
| 252 EXPECT_TRUE(base::KillProcess(peerconnection_server_, 0, false)) << | 252 EXPECT_TRUE(base::KillProcess(peerconnection_server_, 0, false)) << |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 multipart_lines[25].c_str()); | 503 multipart_lines[25].c_str()); |
| 504 EXPECT_STREQ("Content-Type: application/gzip", | 504 EXPECT_STREQ("Content-Type: application/gzip", |
| 505 multipart_lines[26].c_str()); | 505 multipart_lines[26].c_str()); |
| 506 EXPECT_TRUE(multipart_lines[27].empty()); | 506 EXPECT_TRUE(multipart_lines[27].empty()); |
| 507 EXPECT_TRUE(multipart_lines[28].empty()); // The removed zip part. | 507 EXPECT_TRUE(multipart_lines[28].empty()); // The removed zip part. |
| 508 std::string final_delimiter = boundary; | 508 std::string final_delimiter = boundary; |
| 509 final_delimiter += "--"; | 509 final_delimiter += "--"; |
| 510 EXPECT_STREQ(final_delimiter.c_str(), multipart_lines[29].c_str()); | 510 EXPECT_STREQ(final_delimiter.c_str(), multipart_lines[29].c_str()); |
| 511 EXPECT_TRUE(multipart_lines[30].empty()); | 511 EXPECT_TRUE(multipart_lines[30].empty()); |
| 512 } | 512 } |
| OLD | NEW |