| 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/process/launch.h" | 8 #include "base/process/launch.h" |
| 9 #include "base/process/process_metrics.h" | 9 #include "base/process/process_metrics.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 // the tab is closed. We must ensure that WebRtcLogUploader::UploadLog, which | 450 // the tab is closed. We must ensure that WebRtcLogUploader::UploadLog, which |
| 451 // runs on the FILE thread, has finished after closing the tab before | 451 // runs on the FILE thread, has finished after closing the tab before |
| 452 // continuing. | 452 // continuing. |
| 453 // 1. Add a filter which just acts as a listener. It's added after | 453 // 1. Add a filter which just acts as a listener. It's added after |
| 454 // WebRtcLoggingHandlerHost, which is the filter that posts a task for | 454 // WebRtcLoggingHandlerHost, which is the filter that posts a task for |
| 455 // WebRtcLogUploader::UploadLog. So it's guarantueed to be removed after | 455 // WebRtcLogUploader::UploadLog. So it's guarantueed to be removed after |
| 456 // WebRtcLoggingHandlerHost. | 456 // WebRtcLoggingHandlerHost. |
| 457 // 2. When the filter goes away post a task on the file thread to signal the | 457 // 2. When the filter goes away post a task on the file thread to signal the |
| 458 // event. | 458 // event. |
| 459 base::WaitableEvent ipc_channel_closed(false, false); | 459 base::WaitableEvent ipc_channel_closed(false, false); |
| 460 left_tab->GetRenderProcessHost()->GetChannel()->AddFilter( | 460 left_tab->GetRenderProcessHost()->AddFilter( |
| 461 new BrowserMessageFilter(base::Bind( | 461 new BrowserMessageFilter(base::Bind( |
| 462 &base::WaitableEvent::Signal, | 462 &base::WaitableEvent::Signal, |
| 463 base::Unretained(&ipc_channel_closed)))); | 463 base::Unretained(&ipc_channel_closed)))); |
| 464 chrome::CloseWebContents(browser(), left_tab, false); | 464 chrome::CloseWebContents(browser(), left_tab, false); |
| 465 ASSERT_TRUE(ipc_channel_closed.TimedWait(TestTimeouts::action_timeout())); | 465 ASSERT_TRUE(ipc_channel_closed.TimedWait(TestTimeouts::action_timeout())); |
| 466 | 466 |
| 467 const char boundary[] = "------**--yradnuoBgoLtrapitluMklaTelgooG--**----"; | 467 const char boundary[] = "------**--yradnuoBgoLtrapitluMklaTelgooG--**----"; |
| 468 | 468 |
| 469 // Remove the compressed data, it may contain "\r\n". Just verify that its | 469 // Remove the compressed data, it may contain "\r\n". Just verify that its |
| 470 // size is > 0. | 470 // size is > 0. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 multipart_lines[26].c_str()); | 531 multipart_lines[26].c_str()); |
| 532 EXPECT_TRUE(multipart_lines[27].empty()); | 532 EXPECT_TRUE(multipart_lines[27].empty()); |
| 533 EXPECT_TRUE(multipart_lines[28].empty()); // The removed zip part. | 533 EXPECT_TRUE(multipart_lines[28].empty()); // The removed zip part. |
| 534 std::string final_delimiter = boundary; | 534 std::string final_delimiter = boundary; |
| 535 final_delimiter += "--"; | 535 final_delimiter += "--"; |
| 536 EXPECT_STREQ(final_delimiter.c_str(), multipart_lines[29].c_str()); | 536 EXPECT_STREQ(final_delimiter.c_str(), multipart_lines[29].c_str()); |
| 537 EXPECT_TRUE(multipart_lines[30].empty()); | 537 EXPECT_TRUE(multipart_lines[30].empty()); |
| 538 | 538 |
| 539 ASSERT_TRUE(peerconnection_server_.Stop()); | 539 ASSERT_TRUE(peerconnection_server_.Stop()); |
| 540 } | 540 } |
| OLD | NEW |