webrtc/talk
phoglund@webrtc.org 006521d5bd Makes libjingle_peerconnection_android_unittest run on networkless devices.
PeerConnectionTest.java currently works, but only on a device with
network interfaces up. This is not a problem for desktop, but it is a
problem when running on Android devices since the devices in the lab
generally don't have network (due to the chaotic radio environment in
the device labs, devices are simply kept in flight mode).

The test does work if one modifies this line in the file
webrtc/base/network.cc:

bool ignored = ((cursor->ifa_flags & IFF_LOOPBACK) ||
                IsIgnoredNetwork(*network));

If we remove the IFF_LOOPBACK clause, the test starts working on
an Android device in flight mode. This is nice - we're running the
call and packets interact with the OS network stack, which is good
for this end-to-end test. We can't just remove the clause though since
having loopback is undesirable for everyone except the test (right)?
so we need to make this behavior configurable.

This CL takes a stab at a complete solution where we pass a boolean
all the way through the Java PeerConnectionFactory down to the
BasicNetworkManager. This comes as a heavy price in interface
changes though. It's pretty out of proportion, but fundamentally we
need some way of telling the network manager that it is on Android
and in test mode. Passing the boolean all the way through is one way.

Another way might be to put the loopback filter behind an ifdef and
link a custom libjingle_peerconnection.so with the test. That is hacky
but doesn't pollute the interfaces. Not sure how to solve that in GYP
but it could mean some duplication between the production and
test .so files.

It would have been perfect to use flags here, but then we need to
hook up gflags parsing to some main() somewhere to make sure the
flag gets parsed, and make sure to pass that flag in our tests.
I'm not sure how that can be done.

Making the loopback filtering conditional is exactly how we solved the
equivalent problem in content_browsertests in Chrome, and it worked
great.

That's all I could think of.

BUG=4181
R=perkj@webrtc.org, pthatcher@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/36769004

Cr-Commit-Position: refs/heads/master@{#8344}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8344 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-12 09:24:25 +00:00
..
app/webrtc Makes libjingle_peerconnection_android_unittest run on networkless devices. 2015-02-12 09:24:25 +00:00
build Remove USE_WEBRTC_DEV_BRANCH. 2015-02-09 10:17:12 +00:00
examples Add Android specific VideoCapturer. 2015-02-11 11:27:22 +00:00
media CVO capturer feature: allow unrotated frame flows through the capture pipeline. 2015-02-11 18:38:53 +00:00
session/media Refactoring WebRTC Java/JNI audio recording in C++ and Java. 2015-02-11 08:39:19 +00:00
codereview.settings Add codereview.settings to the /talk subdirectory 2014-12-05 13:47:37 +00:00
COPYING Libjingle in webrtc needs updated AUTHORS, COPYING, LICENSE_THIRD_PARTY AND README. 2013-07-16 18:04:56 +00:00
libjingle_examples.gyp Merge fixes and changed for Android AppRTCDemo from internal repo. 2015-02-10 23:05:04 +00:00
libjingle_media_unittest.isolate Update libjingle license statements at top of talk files for consistency 2015-01-20 21:36:13 +00:00
libjingle_p2p_unittest.isolate Update libjingle license statements at top of talk files for consistency 2015-01-20 21:36:13 +00:00
libjingle_peerconnection_unittest.isolate Update libjingle license statements at top of talk files for consistency 2015-01-20 21:36:13 +00:00
libjingle_sound_unittest.isolate Update libjingle license statements at top of talk files for consistency 2015-01-20 21:36:13 +00:00
libjingle_tests.gyp Add libjingle_peerconnection_so.so to Java test dependencies. 2015-02-06 16:09:20 +00:00
libjingle_unittest.isolate Update libjingle license statements at top of talk files for consistency 2015-01-20 21:36:13 +00:00
libjingle.gyp Add Android specific VideoCapturer. 2015-02-11 11:27:22 +00:00
LICENSE_THIRD_PARTY Libjingle in webrtc needs updated AUTHORS, COPYING, LICENSE_THIRD_PARTY AND README. 2013-07-16 18:04:56 +00:00
OWNERS OWNERS: Remove tomasl@ and mallinath@ 2014-11-24 10:05:05 +00:00
PRESUBMIT.py Update libjingle license statements at top of talk files for consistency 2015-01-20 21:36:13 +00:00