Chromium Code Reviews| Index: chrome/browser/media/webrtc/webrtc_browsertest_base.cc |
| diff --git a/chrome/browser/media/webrtc/webrtc_browsertest_base.cc b/chrome/browser/media/webrtc/webrtc_browsertest_base.cc |
| index ec41b87a5229ac0072d721e8985317ff4111099b..57d0d59d1dbfef45b2234adb59ec07fd346bd579 100644 |
| --- a/chrome/browser/media/webrtc/webrtc_browsertest_base.cc |
| +++ b/chrome/browser/media/webrtc/webrtc_browsertest_base.cc |
| @@ -494,6 +494,21 @@ std::vector<std::string> WebRtcTestBase::VerifyStatsGeneratedPromise( |
| return JsonArrayToVectorOfStrings(result.substr(3)); |
| } |
| +scoped_refptr<content::RTCStatsReportDictionary> |
| +WebRtcTestBase::GetStatsReportDictionary(content::WebContents* tab) const { |
| + std::string result = ExecuteJavascript("getStatsAsDictionary()", tab); |
|
hbos_chromium
2016/11/30 11:30:56
nit: I'll rename this to getStatsReportDictionary
|
| + EXPECT_TRUE(base::StartsWith(result, "ok-", base::CompareCase::SENSITIVE)); |
| + std::unique_ptr<base::Value> parsed_json = base::JSONReader::Read( |
| + result.substr(3)); |
| + base::DictionaryValue* dictionary; |
| + CHECK(parsed_json); |
| + CHECK(parsed_json->GetAsDictionary(&dictionary)); |
| + ignore_result(parsed_json.release()); |
| + return scoped_refptr<content::RTCStatsReportDictionary>( |
| + new content::RTCStatsReportDictionary( |
| + std::unique_ptr<base::DictionaryValue>(dictionary))); |
| +} |
| + |
| std::vector<std::string> WebRtcTestBase::GetWhitelistedStatsTypes( |
| content::WebContents* tab) const { |
| return JsonArrayToVectorOfStrings( |