| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 EXPECT_TRUE(GzipUncompress(log_part, &log_part)); | 294 EXPECT_TRUE(GzipUncompress(log_part, &log_part)); |
| 295 EXPECT_GT(log_part.length(), 0u); | 295 EXPECT_GT(log_part.length(), 0u); |
| 296 // Verify that meta data exists. | 296 // Verify that meta data exists. |
| 297 EXPECT_NE(std::string::npos, log_part.find(base::StringPrintf("%s: %s", | 297 EXPECT_NE(std::string::npos, log_part.find(base::StringPrintf("%s: %s", |
| 298 kTestLoggingSessionIdKey, kTestLoggingSessionIdValue))); | 298 kTestLoggingSessionIdKey, kTestLoggingSessionIdValue))); |
| 299 // Verify that the basic info generated at logging startup exists. | 299 // Verify that the basic info generated at logging startup exists. |
| 300 EXPECT_NE(std::string::npos, log_part.find("Chrome version:")); | 300 EXPECT_NE(std::string::npos, log_part.find("Chrome version:")); |
| 301 EXPECT_NE(std::string::npos, log_part.find("Cpu brand:")); | 301 EXPECT_NE(std::string::npos, log_part.find("Cpu brand:")); |
| 302 | 302 |
| 303 // Check the multipart contents. | 303 // Check the multipart contents. |
| 304 std::vector<std::string> multipart_lines; | 304 std::vector<std::string> multipart_lines = base::SplitStringUsingSubstr( |
| 305 base::SplitStringUsingSubstr(multipart, "\r\n", &multipart_lines); | 305 multipart, "\r\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 306 ASSERT_EQ(31, static_cast<int>(multipart_lines.size())); | 306 ASSERT_EQ(31, static_cast<int>(multipart_lines.size())); |
| 307 | 307 |
| 308 EXPECT_STREQ(&boundary[0], multipart_lines[0].c_str()); | 308 EXPECT_STREQ(&boundary[0], multipart_lines[0].c_str()); |
| 309 EXPECT_STREQ("Content-Disposition: form-data; name=\"prod\"", | 309 EXPECT_STREQ("Content-Disposition: form-data; name=\"prod\"", |
| 310 multipart_lines[1].c_str()); | 310 multipart_lines[1].c_str()); |
| 311 EXPECT_TRUE(multipart_lines[2].empty()); | 311 EXPECT_TRUE(multipart_lines[2].empty()); |
| 312 EXPECT_NE(std::string::npos, multipart_lines[3].find("Chrome")); | 312 EXPECT_NE(std::string::npos, multipart_lines[3].find("Chrome")); |
| 313 | 313 |
| 314 EXPECT_STREQ(&boundary[0], multipart_lines[4].c_str()); | 314 EXPECT_STREQ(&boundary[0], multipart_lines[4].c_str()); |
| 315 EXPECT_STREQ("Content-Disposition: form-data; name=\"ver\"", | 315 EXPECT_STREQ("Content-Disposition: form-data; name=\"ver\"", |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 ASSERT_TRUE(StartAudioDebugRecordings(0)); | 441 ASSERT_TRUE(StartAudioDebugRecordings(0)); |
| 442 ASSERT_TRUE(StopAudioDebugRecordings()); | 442 ASSERT_TRUE(StopAudioDebugRecordings()); |
| 443 } | 443 } |
| 444 | 444 |
| 445 IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest, | 445 IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest, |
| 446 TestStartTimedAudioDebugRecordings) { | 446 TestStartTimedAudioDebugRecordings) { |
| 447 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 447 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 448 switches::kEnableAudioDebugRecordingsFromExtension); | 448 switches::kEnableAudioDebugRecordingsFromExtension); |
| 449 ASSERT_TRUE(StartAudioDebugRecordings(1)); | 449 ASSERT_TRUE(StartAudioDebugRecordings(1)); |
| 450 } | 450 } |
| OLD | NEW |