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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 perf_test::PrintResult("video_recv", "", "goog_nacks_recv", value, "", false); | 76 perf_test::PrintResult("video_recv", "", "goog_nacks_recv", value, "", false); |
77 EXPECT_TRUE(pc_dict.GetString(Statistic("googFrameWidthSent", ssrc), &value)); | 77 EXPECT_TRUE(pc_dict.GetString(Statistic("googFrameWidthSent", ssrc), &value)); |
78 perf_test::PrintResult("video_recv", "", "goog_frame_width_sent", value, | 78 perf_test::PrintResult("video_recv", "", "goog_frame_width_sent", value, |
79 "pixels", false); | 79 "pixels", false); |
80 EXPECT_TRUE( | 80 EXPECT_TRUE( |
81 pc_dict.GetString(Statistic("googFrameHeightSent", ssrc), &value)); | 81 pc_dict.GetString(Statistic("googFrameHeightSent", ssrc), &value)); |
82 perf_test::PrintResult("video_recv", "", "goog_frame_height_sent", value, | 82 perf_test::PrintResult("video_recv", "", "goog_frame_height_sent", value, |
83 "pixels", false); | 83 "pixels", false); |
84 EXPECT_TRUE(pc_dict.GetString( | 84 EXPECT_TRUE(pc_dict.GetString( |
85 Statistic("googCaptureJitterMs", ssrc), &value)); | 85 Statistic("googCaptureJitterMs", ssrc), &value)); |
86 perf_test::PrintResult("video_send", "", "goog_capture_jitter_ms", value, | 86 perf_test::PrintResult("video_recv", "", "goog_capture_jitter_ms", value, |
tommi (sloooow) - chröme
2014/03/28 09:36:25
can we have constants in the functions so that we
phoglund_chromium
2014/03/28 10:05:18
Yeah, that's a good idea in this case (would have
| |
87 "ms", false); | 87 "ms", false); |
88 EXPECT_TRUE(pc_dict.GetString( | 88 EXPECT_TRUE(pc_dict.GetString( |
89 Statistic("googCaptureQueueDelayMsPerS", ssrc), &value)); | 89 Statistic("googCaptureQueueDelayMsPerS", ssrc), &value)); |
90 perf_test::PrintResult("video_send", "", "goog_capture_queue_delay_ms_per_s", | 90 perf_test::PrintResult("video_recv", "", "goog_capture_queue_delay_ms_per_s", |
91 value, "ms/s", false); | 91 value, "ms/s", false); |
92 EXPECT_TRUE(pc_dict.GetString( | 92 EXPECT_TRUE(pc_dict.GetString( |
93 Statistic("googEncodeUsagePercent", ssrc), &value)); | 93 Statistic("googEncodeUsagePercent", ssrc), &value)); |
94 perf_test::PrintResult("video_send", "", "goog_encode_usage_percent", | 94 perf_test::PrintResult("video_recv", "", "goog_encode_usage_percent", |
95 value, "%", false); | 95 value, "%", false); |
96 EXPECT_TRUE(pc_dict.GetString(Statistic("googAvgEncodeMs", ssrc), &value)); | 96 EXPECT_TRUE(pc_dict.GetString(Statistic("googAvgEncodeMs", ssrc), &value)); |
97 perf_test::PrintResult("video_send", "", "goog_avg_encode_ms", value, "ms", | 97 perf_test::PrintResult("video_recv", "", "goog_avg_encode_ms", value, "ms", |
98 false); | 98 false); |
99 EXPECT_TRUE(pc_dict.GetString(Statistic("googRtt", ssrc), &value)); | 99 EXPECT_TRUE(pc_dict.GetString(Statistic("googRtt", ssrc), &value)); |
100 perf_test::PrintResult("video_send", "", "goog_rtt", value, "ms", false); | 100 perf_test::PrintResult("video_recv", "", "goog_rtt", value, "ms", false); |
101 return true; | 101 return true; |
102 } | 102 } |
103 | 103 |
104 static bool MaybePrintResultsForVideoSend( | 104 static bool MaybePrintResultsForVideoSend( |
105 const std::string& ssrc, const base::DictionaryValue& pc_dict) { | 105 const std::string& ssrc, const base::DictionaryValue& pc_dict) { |
106 std::string value; | 106 std::string value; |
107 if (!pc_dict.GetString(Statistic("googFrameRateOutput", ssrc), &value)) { | 107 if (!pc_dict.GetString(Statistic("googFrameRateOutput", ssrc), &value)) { |
108 // Not a video receive stream. | 108 // Not a video receive stream. |
109 return false; | 109 return false; |
110 } | 110 } |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
215 MaybePrintResultsForAudioSend(ssrc, pc_dict) || | 215 MaybePrintResultsForAudioSend(ssrc, pc_dict) || |
216 MaybePrintResultsForVideoReceive(ssrc, pc_dict) || | 216 MaybePrintResultsForVideoReceive(ssrc, pc_dict) || |
217 MaybePrintResultsForVideoSend(ssrc, pc_dict); | 217 MaybePrintResultsForVideoSend(ssrc, pc_dict); |
218 ASSERT_TRUE(did_recognize_stream_type) << "Failed to figure out which " | 218 ASSERT_TRUE(did_recognize_stream_type) << "Failed to figure out which " |
219 "kind of stream SSRC " << ssrc | 219 "kind of stream SSRC " << ssrc |
220 << " is. "; | 220 << " is. "; |
221 } | 221 } |
222 } | 222 } |
223 | 223 |
224 } // namespace test | 224 } // namespace test |
OLD | NEW |