| Index: third_party/libjingle/overrides/init_webrtc.cc
|
| diff --git a/third_party/libjingle/overrides/init_webrtc.cc b/third_party/libjingle/overrides/init_webrtc.cc
|
| index c73b2702cd94ec2e0ca0970d1faa41078f2b6ad7..13765468a3cd7b83ce58516a5f5354b24996d802 100644
|
| --- a/third_party/libjingle/overrides/init_webrtc.cc
|
| +++ b/third_party/libjingle/overrides/init_webrtc.cc
|
| @@ -51,6 +51,21 @@ static base::FilePath GetLibPeerConnectionPath() {
|
| return path;
|
| }
|
|
|
| +#if !defined(OS_WIN)
|
| +// On platforms other than Windows (i.e. mac and linux based ones),
|
| +// the location of the .so in the installed layout will be different relative
|
| +// to the loading module than it is in the build directory.
|
| +// GetLibPeerConnectionPath returns the path as it will be in the installed
|
| +// layout, but to support isolated tests, we need to also support loading the
|
| +// so in the build layout, which we do here.
|
| +// On Windows, these layouts are the same.
|
| +static base::FilePath GetLibPeerConnectionPathForTests() {
|
| + base::FilePath path;
|
| + CHECK(PathService::Get(base::DIR_MODULE, &path));
|
| + return path.Append(FILE_PATH_LITERAL("libpeerconnection.so"));
|
| +}
|
| +#endif
|
| +
|
| bool InitializeWebRtcModule() {
|
| if (g_create_webrtc_media_engine)
|
| return true; // InitializeWebRtcModule has already been called.
|
| @@ -61,6 +76,10 @@ bool InitializeWebRtcModule() {
|
| std::string error;
|
| static base::NativeLibrary lib =
|
| base::LoadNativeLibrary(path, &error);
|
| +#if !defined(OS_WIN)
|
| + if (!lib)
|
| + lib = base::LoadNativeLibrary(GetLibPeerConnectionPathForTests(), &error);
|
| +#endif
|
| CHECK(lib);
|
|
|
| InitializeModuleFunction initialize_module =
|
|
|