Commit b4b50c8e authored by hbos's avatar hbos Committed by Commit bot

Reland of "WebRtcBrowserTest: Include all stats in getStats."

The only stats dictionary that was missing was 'data-channel'. For it to
be included data channels had to be created. Added CreateDataChannel to
webrtc_browsertest_base.h/cc and peerconnection.js. Unittest updated to
EXPECT that no expected stats are missing.

Original CL: https://codereview.chromium.org/2527273003/
Reason for revert: A whitelist filter was landed roughly at the same
time as the the original CL, causing expected stats to be blacklisted.
In this re-land, the whitelist is updated.

BUG=chromium:627816

Review-Url: https://codereview.chromium.org/2533223003
Cr-Commit-Position: refs/heads/master@{#434963}
parent 25ace1cf
......@@ -219,6 +219,8 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
StartServerAndOpenTabs();
SetupPeerconnectionWithLocalStream(left_tab_);
SetupPeerconnectionWithLocalStream(right_tab_);
CreateDataChannel(left_tab_, "data");
CreateDataChannel(right_tab_, "data");
NegotiateCall(left_tab_, right_tab_);
std::set<std::string> missing_expected_stats;
......@@ -228,9 +230,9 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
for (const std::string& type : VerifyStatsGeneratedPromise(left_tab_)) {
missing_expected_stats.erase(type);
}
// TODO(hbos): When all stats are ready and returned by "getStats":
// EXPECT_TRUE(missing_expected_stats.empty());
// crbug.com/627816
for (const std::string& type : missing_expected_stats) {
EXPECT_TRUE(false) << "Expected stats dictionary is missing: " << type;
}
DetectVideoAndHangUp();
}
......@@ -404,6 +404,12 @@ void WebRtcTestBase::GatherAndSendIceCandidates(
to_tab));
}
void WebRtcTestBase::CreateDataChannel(content::WebContents* tab,
const std::string& label) {
EXPECT_EQ("ok-created",
ExecuteJavascript("createDataChannel('" + label + "')", tab));
}
void WebRtcTestBase::NegotiateCall(content::WebContents* from_tab,
content::WebContents* to_tab) const {
std::string local_offer = CreateLocalOffer(from_tab);
......
......@@ -122,6 +122,8 @@ class WebRtcTestBase : public InProcessBrowserTest {
content::WebContents* tab,
const std::string& certificate) const;
void CreateDataChannel(content::WebContents* tab, const std::string& label);
// Exchanges offers and answers between the peer connections in the
// respective tabs. Before calling this, you must have prepared peer
// connections in both tabs and configured them as you like (for instance by
......
......@@ -99,6 +99,15 @@ function forceVideoCodec(videoCodec) {
returnToTest('ok-forced');
}
/**
* Creates a data channel with the specified label.
* Returns 'ok-created' to test.
*/
function createDataChannel(label) {
peerConnection_().createDataChannel(label);
returnToTest('ok-created');
}
/**
* Asks this page to create a local offer.
*
......
......@@ -20,11 +20,14 @@ class RTCStatsWhitelist {
public:
RTCStatsWhitelist() {
whitelisted_stats_types_.insert(webrtc::RTCCertificateStats::kType);
whitelisted_stats_types_.insert(webrtc::RTCCodecStats::kType);
whitelisted_stats_types_.insert(webrtc::RTCDataChannelStats::kType);
whitelisted_stats_types_.insert(webrtc::RTCIceCandidatePairStats::kType);
whitelisted_stats_types_.insert(webrtc::RTCIceCandidateStats::kType);
whitelisted_stats_types_.insert(webrtc::RTCLocalIceCandidateStats::kType);
whitelisted_stats_types_.insert(webrtc::RTCRemoteIceCandidateStats::kType);
whitelisted_stats_types_.insert(webrtc::RTCMediaStreamStats::kType);
whitelisted_stats_types_.insert(webrtc::RTCMediaStreamTrackStats::kType);
whitelisted_stats_types_.insert(webrtc::RTCPeerConnectionStats::kType);
whitelisted_stats_types_.insert(webrtc::RTCRTPStreamStats::kType);
whitelisted_stats_types_.insert(webrtc::RTCInboundRTPStreamStats::kType);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment