Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1970)

Unified Diff: chrome/browser/media/webrtc/webrtc_browsertest_base.cc

Issue 2534633002: Preparation CL for WebRTC performance test using promise-based getStats (Closed)
Patch Set: Rename RTCStats[Report]Dictionary to TestStats[Report]Dictionary Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/media/webrtc/webrtc_browsertest_base.h ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..816618be0d2fb8f5744b0830f01e3c7c44bc95e8 100644
--- a/chrome/browser/media/webrtc/webrtc_browsertest_base.cc
+++ b/chrome/browser/media/webrtc/webrtc_browsertest_base.cc
@@ -11,6 +11,7 @@
#include "base/macros.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
+#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/media/webrtc/webrtc_browsertest_common.h"
#include "chrome/browser/permissions/permission_request_manager.h"
@@ -494,6 +495,21 @@ std::vector<std::string> WebRtcTestBase::VerifyStatsGeneratedPromise(
return JsonArrayToVectorOfStrings(result.substr(3));
}
+scoped_refptr<content::TestStatsReportDictionary>
+WebRtcTestBase::GetStatsReportDictionary(content::WebContents* tab) const {
+ std::string result = ExecuteJavascript("getStatsReportDictionary()", tab);
+ 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::TestStatsReportDictionary>(
+ new content::TestStatsReportDictionary(
+ std::unique_ptr<base::DictionaryValue>(dictionary)));
+}
+
std::vector<std::string> WebRtcTestBase::GetWhitelistedStatsTypes(
content::WebContents* tab) const {
return JsonArrayToVectorOfStrings(
« no previous file with comments | « chrome/browser/media/webrtc/webrtc_browsertest_base.h ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698