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

Issue 1966333002: Refactoring some tests in peerconnectioninterface_unittest.cc. (Closed)

Created:
4 years, 7 months ago by Taylor Brandstetter
Modified:
4 years, 7 months ago
Reviewers:
tommi, hbos, pthatcher1
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Refactoring some tests in peerconnectioninterface_unittest.cc. Some tests were passing in a local description created from hard-coded SDP strings, which won't work in the future (since some attributes such as the fingerprint and ICE ufrag/pwd are non-modifiable). These tests now do the typical approach of calling CreateOffer and modifying the result if necessary. Also added some non-const versions of the SessionDescription accessor helper functions, since that makes it much easier to modify a SessionDescription. Previous alternatives were re-implementing the helper methods from scratch, or converting the description to SDP, modifying it, and converting it back. R=tommi@webrtc.org Committed: https://crrev.com/dc4eb8c5b3c996389046694d3b4fdb2ab315376f Cr-Commit-Position: refs/heads/master@{#12704}

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+196 lines, -89 lines) Patch
M webrtc/api/peerconnectioninterface_unittest.cc View 12 chunks +105 lines, -85 lines 1 comment Download
M webrtc/pc/mediasession.h View 1 chunk +15 lines, -0 lines 0 comments Download
M webrtc/pc/mediasession.cc View 2 chunks +76 lines, -4 lines 2 comments Download

Messages

Total messages: 16 (6 generated)
Taylor Brandstetter
PTAL Peter. This fixes an issue hbos@ encountered in this CL: https://codereview.webrtc.org/1965723002/
4 years, 7 months ago (2016-05-11 19:05:25 UTC) #2
hbos
Good job, I have confirmed that this patch fixes my issues and would allow me ...
4 years, 7 months ago (2016-05-12 09:41:43 UTC) #3
tommi
nice. lgtm. Pure speculation below, feel free to ignore. https://codereview.webrtc.org/1966333002/diff/1/webrtc/api/peerconnectioninterface_unittest.cc File webrtc/api/peerconnectioninterface_unittest.cc (right): https://codereview.webrtc.org/1966333002/diff/1/webrtc/api/peerconnectioninterface_unittest.cc#newcode2391 webrtc/api/peerconnectioninterface_unittest.cc:2391: ...
4 years, 7 months ago (2016-05-12 11:41:44 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1966333002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1966333002/1
4 years, 7 months ago (2016-05-12 11:50:02 UTC) #7
hbos
On 2016/05/12 11:50:02, commit-bot: I haz the power wrote: > CQ is trying da patch. ...
4 years, 7 months ago (2016-05-12 11:50:24 UTC) #8
tommi
On 2016/05/12 11:50:02, commit-bot: I haz the power wrote: > CQ is trying da patch. ...
4 years, 7 months ago (2016-05-12 11:51:00 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: android_dbg on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/android_dbg/builds/13250)
4 years, 7 months ago (2016-05-12 11:58:55 UTC) #11
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/dc4eb8c5b3c996389046694d3b4fdb2ab315376f Cr-Commit-Position: refs/heads/master@{#12704}
4 years, 7 months ago (2016-05-12 15:14:59 UTC) #14
Taylor Brandstetter
Committed patchset #1 (id:1) manually as dc4eb8c5b3c996389046694d3b4fdb2ab315376f (presubmit successful).
4 years, 7 months ago (2016-05-12 15:15:00 UTC) #15
Taylor Brandstetter
4 years, 7 months ago (2016-05-12 15:16:44 UTC) #16
Message was sent while issue was closed.
https://codereview.webrtc.org/1966333002/diff/1/webrtc/pc/mediasession.cc
File webrtc/pc/mediasession.cc (right):

https://codereview.webrtc.org/1966333002/diff/1/webrtc/pc/mediasession.cc#new...
webrtc/pc/mediasession.cc:1922: for (const ContentInfo& content : contents) {
On 2016/05/12 11:41:44, tommi-webrtc wrote:
> nit: I wonder if a template like this could cover both cases?
> 
> template<typename Infos, typename Info=Infos::value_type>
> Info* GetFirstMediaContent(Infos& contents, MediaType media_type) {
>   auto found = std::find_if(contents.begin(), contents.end(),
>       [media_type](const Info& info) {
>           return IsMediaContentOfType(&info, media_type); });
>   return found == contents.end() ? nullptr : &*found;
> }

The problem is that if Infos is const, Info still won't be. I haven't found a
way around this yet (I'm not really a template guru). For now I'll just land the
CL and maybe revisit this later.

Powered by Google App Engine
This is Rietveld 408576698