| 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 |
| 175 void PrintBweForVideoMetrics(const base::DictionaryValue& pc_dict) { | 177 void PrintBweForVideoMetrics(const base::DictionaryValue& pc_dict) { |
| 176 const std::string kBweStatsKey = "bweforvideo"; | 178 const std::string kBweStatsKey = "bweforvideo"; |
| 177 std::string value; | 179 std::string value; |
| 178 ASSERT_TRUE(pc_dict.GetString( | 180 ASSERT_TRUE(pc_dict.GetString( |
| 179 Statistic("googAvailableSendBandwidth", kBweStatsKey), &value)); | 181 Statistic("googAvailableSendBandwidth", kBweStatsKey), &value)); |
| 180 perf_test::PrintResult("bwe_stats", "", "available_send_bw", value, "bytes/s", | 182 perf_test::PrintResult("bwe_stats", "", "available_send_bw", value, "bytes/s", |
| 181 false); | 183 false); |
| 182 ASSERT_TRUE(pc_dict.GetString( | 184 ASSERT_TRUE(pc_dict.GetString( |
| 183 Statistic("googAvailableReceiveBandwidth", kBweStatsKey), &value)); | 185 Statistic("googAvailableReceiveBandwidth", kBweStatsKey), &value)); |
| 184 perf_test::PrintResult("bwe_stats", "", "available_recv_bw", value, "bytes/s", | 186 perf_test::PrintResult("bwe_stats", "", "available_recv_bw", value, "bytes/s", |
| (...skipping 26 matching lines...) Expand all Loading... |
| 211 bool did_recognize_stream_type = | 213 bool did_recognize_stream_type = |
| 212 MaybePrintResultsForAudioReceive(ssrc, pc_dict) || | 214 MaybePrintResultsForAudioReceive(ssrc, pc_dict) || |
| 213 MaybePrintResultsForAudioSend(ssrc, pc_dict) || | 215 MaybePrintResultsForAudioSend(ssrc, pc_dict) || |
| 214 MaybePrintResultsForVideoReceive(ssrc, pc_dict) || | 216 MaybePrintResultsForVideoReceive(ssrc, pc_dict) || |
| 215 MaybePrintResultsForVideoSend(ssrc, pc_dict); | 217 MaybePrintResultsForVideoSend(ssrc, pc_dict); |
| 216 ASSERT_TRUE(did_recognize_stream_type) << "Failed to figure out which " | 218 ASSERT_TRUE(did_recognize_stream_type) << "Failed to figure out which " |
| 217 "kind of stream SSRC " << ssrc | 219 "kind of stream SSRC " << ssrc |
| 218 << " is. "; | 220 << " is. "; |
| 219 } | 221 } |
| 220 } | 222 } |
| 223 |
| 224 } // namespace test |
| OLD | NEW |