| 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 "chrome/browser/media/webrtc_browsertest_perf.h" | 5 #include "chrome/browser/media/webrtc_browsertest_perf.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/test/base/in_process_browser_test.h" | 9 #include "chrome/test/base/in_process_browser_test.h" |
| 10 #include "testing/perf/perf_test.h" | 10 #include "testing/perf/perf_test.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 base::DictionaryValue::Iterator stats_iterator(stats_dict); | 165 base::DictionaryValue::Iterator stats_iterator(stats_dict); |
| 166 | 166 |
| 167 while (!stats_iterator.IsAtEnd()) { | 167 while (!stats_iterator.IsAtEnd()) { |
| 168 if (stats_iterator.key().find("ssrc_") != std::string::npos) | 168 if (stats_iterator.key().find("ssrc_") != std::string::npos) |
| 169 result.insert(ExtractSsrcIdentifier(stats_iterator.key())); | 169 result.insert(ExtractSsrcIdentifier(stats_iterator.key())); |
| 170 stats_iterator.Advance(); | 170 stats_iterator.Advance(); |
| 171 } | 171 } |
| 172 return result; | 172 return result; |
| 173 } | 173 } |
| 174 | 174 |
| 175 namespace test { | |
| 176 | |
| 177 void PrintBweForVideoMetrics(const base::DictionaryValue& pc_dict) { | 175 void PrintBweForVideoMetrics(const base::DictionaryValue& pc_dict) { |
| 178 const std::string kBweStatsKey = "bweforvideo"; | 176 const std::string kBweStatsKey = "bweforvideo"; |
| 179 std::string value; | 177 std::string value; |
| 180 ASSERT_TRUE(pc_dict.GetString( | 178 ASSERT_TRUE(pc_dict.GetString( |
| 181 Statistic("googAvailableSendBandwidth", kBweStatsKey), &value)); | 179 Statistic("googAvailableSendBandwidth", kBweStatsKey), &value)); |
| 182 perf_test::PrintResult("bwe_stats", "", "available_send_bw", value, "bytes/s", | 180 perf_test::PrintResult("bwe_stats", "", "available_send_bw", value, "bytes/s", |
| 183 false); | 181 false); |
| 184 ASSERT_TRUE(pc_dict.GetString( | 182 ASSERT_TRUE(pc_dict.GetString( |
| 185 Statistic("googAvailableReceiveBandwidth", kBweStatsKey), &value)); | 183 Statistic("googAvailableReceiveBandwidth", kBweStatsKey), &value)); |
| 186 perf_test::PrintResult("bwe_stats", "", "available_recv_bw", value, "bytes/s", | 184 perf_test::PrintResult("bwe_stats", "", "available_recv_bw", value, "bytes/s", |
| (...skipping 26 matching lines...) Expand all Loading... |
| 213 bool did_recognize_stream_type = | 211 bool did_recognize_stream_type = |
| 214 MaybePrintResultsForAudioReceive(ssrc, pc_dict) || | 212 MaybePrintResultsForAudioReceive(ssrc, pc_dict) || |
| 215 MaybePrintResultsForAudioSend(ssrc, pc_dict) || | 213 MaybePrintResultsForAudioSend(ssrc, pc_dict) || |
| 216 MaybePrintResultsForVideoReceive(ssrc, pc_dict) || | 214 MaybePrintResultsForVideoReceive(ssrc, pc_dict) || |
| 217 MaybePrintResultsForVideoSend(ssrc, pc_dict); | 215 MaybePrintResultsForVideoSend(ssrc, pc_dict); |
| 218 ASSERT_TRUE(did_recognize_stream_type) << "Failed to figure out which " | 216 ASSERT_TRUE(did_recognize_stream_type) << "Failed to figure out which " |
| 219 "kind of stream SSRC " << ssrc | 217 "kind of stream SSRC " << ssrc |
| 220 << " is. "; | 218 << " is. "; |
| 221 } | 219 } |
| 222 } | 220 } |
| 223 | |
| 224 } // namespace test | |
| OLD | NEW |