Commit 19191940 authored by phoglund's avatar phoglund Committed by Commit bot

Disabling WebRTC call tests on Android ASAN.

We are getting renderer crashes, disable until someone can investigate.

BUG=392224,408496

Review URL: https://codereview.chromium.org/516883002

Cr-Commit-Position: refs/heads/master@{#292611}
parent 8153db63
// Copyright (c) 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/process/process_handle.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "content/browser/media/webrtc_internals.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/shell/browser/shell.h"
#include "content/test/webrtc_content_browsertest_base.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
namespace {
const int kExpectedConsumerId = 0;
// Get the ID for the render process host when there should only be one.
bool GetRenderProcessHostId(base::ProcessId* id) {
content::RenderProcessHost::iterator it(
content::RenderProcessHost::AllHostsIterator());
*id = base::GetProcId(it.GetCurrentValue()->GetHandle());
EXPECT_NE(base::kNullProcessId, *id);
if (*id == base::kNullProcessId)
return false;
it.Advance();
EXPECT_TRUE(it.IsAtEnd());
return it.IsAtEnd();
}
} // namespace
namespace content {
class WebRtcAecDumpBrowserTest : public WebRtcContentBrowserTest {
public:
WebRtcAecDumpBrowserTest() {}
virtual ~WebRtcAecDumpBrowserTest() {}
};
#if defined(OS_WIN)
#define IntToStringType base::IntToString16
#else
#define IntToStringType base::IntToString
#endif
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
// Timing out on ARM linux bot: http://crbug.com/238490
#define MAYBE_CallWithAecDump DISABLED_CallWithAecDump
#elif defined(OS_ANDROID) && defined(ADDRESS_SANITIZER)
// Renderer crashes under Android ASAN: https://crbug.com/408496.
#define MAYBE_CallWithAecDump DISABLED_CallWithAecDump
#else
#define MAYBE_CallWithAecDump CallWithAecDump
#endif
// This tests will make a complete PeerConnection-based call, verify that
// video is playing for the call, and verify that a non-empty AEC dump file
// exists. The AEC dump is enabled through webrtc-internals. The HTML and
// Javascript is bypassed since it would trigger a file picker dialog. Instead,
// the dialog callback FileSelected() is invoked directly. In fact, there's
// never a webrtc-internals page opened at all since that's not needed.
IN_PROC_BROWSER_TEST_F(WebRtcAecDumpBrowserTest, MAYBE_CallWithAecDump) {
ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
// We must navigate somewhere first so that the render process is created.
NavigateToURL(shell(), GURL(""));
base::FilePath dump_file;
ASSERT_TRUE(CreateTemporaryFile(&dump_file));
base::DeleteFile(dump_file, false);
// This fakes the behavior of another open tab with webrtc-internals, and
// enabling AEC dump in that tab.
WebRTCInternals::GetInstance()->FileSelected(dump_file, -1, NULL);
GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
DisableOpusIfOnAndroid();
ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});");
EXPECT_FALSE(base::PathExists(dump_file));
// Add file extensions that we expect to be added. The dump name will be
// <temporary path>.<render process id>.<consumer id>, for example
// "/tmp/.com.google.Chrome.Z6UC3P.12345.0".
base::ProcessId render_process_id = base::kNullProcessId;
EXPECT_TRUE(GetRenderProcessHostId(&render_process_id));
dump_file = dump_file.AddExtension(IntToStringType(render_process_id))
.AddExtension(IntToStringType(kExpectedConsumerId));
EXPECT_TRUE(base::PathExists(dump_file));
int64 file_size = 0;
EXPECT_TRUE(base::GetFileSize(dump_file, &file_size));
EXPECT_GT(file_size, 0);
base::DeleteFile(dump_file, false);
}
// TODO(grunell): Add test for multiple dumps when re-use of
// MediaStreamAudioProcessor in AudioCapturer has been removed.
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
// Timing out on ARM linux bot: http://crbug.com/238490
#define MAYBE_CallWithAecDumpEnabledThenDisabled DISABLED_CallWithAecDumpEnabledThenDisabled
#elif defined(OS_ANDROID) && defined(ADDRESS_SANITIZER)
// Renderer crashes under Android ASAN: https://crbug.com/408496.
#define MAYBE_CallWithAecDumpEnabledThenDisabled DISABLED_CallWithAecDumpEnabledThenDisabled
#else
#define MAYBE_CallWithAecDumpEnabledThenDisabled CallWithAecDumpEnabledThenDisabled
#endif
// As above, but enable and disable dump before starting a call. The file should
// be created, but should be empty.
IN_PROC_BROWSER_TEST_F(WebRtcAecDumpBrowserTest,
MAYBE_CallWithAecDumpEnabledThenDisabled) {
ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
// We must navigate somewhere first so that the render process is created.
NavigateToURL(shell(), GURL(""));
base::FilePath dump_file;
ASSERT_TRUE(CreateTemporaryFile(&dump_file));
base::DeleteFile(dump_file, false);
// This fakes the behavior of another open tab with webrtc-internals, and
// enabling AEC dump in that tab, then disabling it.
WebRTCInternals::GetInstance()->FileSelected(dump_file, -1, NULL);
WebRTCInternals::GetInstance()->DisableAecDump();
GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
DisableOpusIfOnAndroid();
ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});");
// Add file extensions that we expect to be added.
base::ProcessId render_process_id = base::kNullProcessId;
EXPECT_TRUE(GetRenderProcessHostId(&render_process_id));
dump_file = dump_file.AddExtension(IntToStringType(render_process_id))
.AddExtension(IntToStringType(kExpectedConsumerId));
EXPECT_FALSE(base::PathExists(dump_file));
base::DeleteFile(dump_file, false);
}
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
// Timing out on ARM linux bot: http://crbug.com/238490
#define MAYBE_TwoCallsWithAecDump DISABLED_TwoCallsWithAecDump
#elif defined(OS_ANDROID) && defined(ADDRESS_SANITIZER)
// Renderer crashes under Android ASAN: https://crbug.com/408496.
#define MAYBE_TwoCallsWithAecDump DISABLED_TwoCallsWithAecDump
#else
#define MAYBE_TwoCallsWithAecDump TwoCallsWithAecDump
#endif
IN_PROC_BROWSER_TEST_F(WebRtcAecDumpBrowserTest, MAYBE_TwoCallsWithAecDump) {
ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
// We must navigate somewhere first so that the render process is created.
NavigateToURL(shell(), GURL(""));
// Create a second window.
Shell* shell2 = CreateBrowser();
NavigateToURL(shell2, GURL(""));
base::FilePath dump_file;
ASSERT_TRUE(CreateTemporaryFile(&dump_file));
base::DeleteFile(dump_file, false);
// This fakes the behavior of another open tab with webrtc-internals, and
// enabling AEC dump in that tab.
WebRTCInternals::GetInstance()->FileSelected(dump_file, -1, NULL);
GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
NavigateToURL(shell2, url);
ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});");
std::string result;
EXPECT_TRUE(ExecuteScriptAndExtractString(
shell2->web_contents(),
"call({video: true, audio: true});",
&result));
ASSERT_STREQ("OK", result.c_str());
EXPECT_FALSE(base::PathExists(dump_file));
RenderProcessHost::iterator it =
content::RenderProcessHost::AllHostsIterator();
for (; !it.IsAtEnd(); it.Advance()) {
base::ProcessId render_process_id =
base::GetProcId(it.GetCurrentValue()->GetHandle());
EXPECT_NE(base::kNullProcessId, render_process_id);
// Add file extensions that we expect to be added.
base::FilePath unique_dump_file =
dump_file.AddExtension(IntToStringType(render_process_id))
.AddExtension(IntToStringType(kExpectedConsumerId));
EXPECT_TRUE(base::PathExists(unique_dump_file));
int64 file_size = 0;
EXPECT_TRUE(base::GetFileSize(unique_dump_file, &file_size));
EXPECT_GT(file_size, 0);
base::DeleteFile(unique_dump_file, false);
}
}
} // namespace content
......@@ -4,27 +4,18 @@
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/process/process_handle.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/threading/platform_thread.h"
#include "base/values.h"
#include "content/browser/media/webrtc_internals.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/test_utils.h"
#include "content/shell/browser/shell.h"
#include "content/test/webrtc_content_browsertest_base.h"
#include "media/audio/audio_manager.h"
#include "media/base/media_switches.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#endif
namespace {
#if defined (OS_ANDROID) || defined(THREAD_SANITIZER)
......@@ -35,29 +26,21 @@ const char kUseLenientAudioChecking[] = "true";
const char kUseLenientAudioChecking[] = "false";
#endif
const int kExpectedConsumerId = 0;
// Get the ID for the render process host when there should only be one.
bool GetRenderProcessHostId(base::ProcessId* id) {
content::RenderProcessHost::iterator it(
content::RenderProcessHost::AllHostsIterator());
*id = base::GetProcId(it.GetCurrentValue()->GetHandle());
EXPECT_NE(base::kNullProcessId, *id);
if (*id == base::kNullProcessId)
return false;
it.Advance();
EXPECT_TRUE(it.IsAtEnd());
return it.IsAtEnd();
}
} // namespace
namespace content {
class WebRtcBrowserTest : public WebRtcContentBrowserTest {
#if defined(OS_ANDROID) && defined(ADDRESS_SANITIZER)
// Renderer crashes under Android ASAN: https://crbug.com/408496.
#define MAYBE_WebRtcBrowserTest DISABLED_WebRtcBrowserTest
#else
#define MAYBE_WebRtcBrowserTest WebRtcBrowserTest
#endif
class MAYBE_WebRtcBrowserTest : public WebRtcContentBrowserTest {
public:
WebRtcBrowserTest() {}
virtual ~WebRtcBrowserTest() {}
MAYBE_WebRtcBrowserTest() {}
virtual ~MAYBE_WebRtcBrowserTest() {}
// Convenience function since most peerconnection-call.html tests just load
// the page, kick off some javascript and wait for the title to change to OK.
......@@ -91,14 +74,6 @@ class WebRtcBrowserTest : public WebRtcContentBrowserTest {
MakeTypicalPeerConnectionCall(javascript);
}
void DisableOpusIfOnAndroid() {
#if defined(OS_ANDROID)
// Always force iSAC 16K on Android for now (Opus is broken).
EXPECT_EQ("isac-forced",
ExecuteJavascriptAndReturnResult("forceIsac16KInSdp();"));
#endif
}
};
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
......@@ -113,7 +88,8 @@ class WebRtcBrowserTest : public WebRtcContentBrowserTest {
// These tests will make a complete PeerConnection-based call and verify that
// video is playing for the call.
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanSetupDefaultVideoCall) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
MAYBE_CanSetupDefaultVideoCall) {
MakeTypicalPeerConnectionCall(
"callAndExpectResolution({video: true}, 640, 480);");
}
......@@ -126,7 +102,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanSetupDefaultVideoCall) {
#define MAYBE_CanSetupVideoCallWith1To1AspectRatio \
CanSetupVideoCallWith1To1AspectRatio
#endif
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
MAYBE_CanSetupVideoCallWith1To1AspectRatio) {
const std::string javascript =
"callAndExpectResolution({video: {mandatory: {minWidth: 320,"
......@@ -146,7 +122,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
#define MAYBE_CanSetupVideoCallWith16To9AspectRatio \
CanSetupVideoCallWith16To9AspectRatio
#endif
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
MAYBE_CanSetupVideoCallWith16To9AspectRatio) {
const std::string javascript =
"callAndExpectResolution({video: {mandatory: {minWidth: 640,"
......@@ -162,7 +138,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
#define MAYBE_CanSetupVideoCallWith4To3AspectRatio \
CanSetupVideoCallWith4To3AspectRatio
#endif
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
MAYBE_CanSetupVideoCallWith4To3AspectRatio) {
const std::string javascript =
"callAndExpectResolution({video: {mandatory: {minWidth: 960,"
......@@ -178,7 +154,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
#define MAYBE_CanSetupVideoCallAndDisableLocalVideo \
CanSetupVideoCallAndDisableLocalVideo
#endif
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
MAYBE_CanSetupVideoCallAndDisableLocalVideo) {
const std::string javascript =
"callAndDisableLocalVideo({video: true});";
......@@ -192,18 +168,20 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
#define MAYBE_CanSetupAudioAndVideoCall CanSetupAudioAndVideoCall
#endif
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanSetupAudioAndVideoCall) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
MAYBE_CanSetupAudioAndVideoCall) {
MakeTypicalPeerConnectionCall("call({video: true, audio: true});");
}
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MANUAL_CanSetupCallAndSendDtmf) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
MANUAL_CanSetupCallAndSendDtmf) {
MakeTypicalPeerConnectionCall("callAndSendDtmf(\'123,abc\');");
}
// TODO(phoglund): this test fails because the peer connection state will be
// stable in the second negotiation round rather than have-local-offer.
// http://crbug.com/293125.
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
DISABLED_CanMakeEmptyCallThenAddStreamsAndRenegotiate) {
const char* kJavascript =
"callEmptyThenAddOneStreamAndRenegotiate({video: true, audio: true});";
......@@ -229,7 +207,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
#define MAYBE_CanForwardRemoteStream720p CanForwardRemoteStream720p
#endif
#endif
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanForwardRemoteStream) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, MAYBE_CanForwardRemoteStream) {
#if defined (OS_ANDROID)
// This test fails on Nexus 5 devices.
// TODO(henrika): see http://crbug.com/362437 and http://crbug.com/359389
......@@ -241,7 +219,8 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanForwardRemoteStream) {
"callAndForwardRemoteStream({video: true, audio: false});");
}
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanForwardRemoteStream720p) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
MAYBE_CanForwardRemoteStream720p) {
#if defined (OS_ANDROID)
// This test fails on Nexus 5 devices.
// TODO(henrika): see http://crbug.com/362437 and http://crbug.com/359389
......@@ -254,7 +233,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanForwardRemoteStream720p) {
MakeTypicalPeerConnectionCall(javascript);
}
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
NoCrashWhenConnectChromiumSinkToRemoteTrack) {
MakeTypicalPeerConnectionCall("ConnectChromiumSinkToRemoteAudioTrack();");
}
......@@ -271,26 +250,27 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
#define MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle\
CanSetupAudioAndVideoCallWithoutMsidAndBundle
#endif
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle) {
MakeTypicalPeerConnectionCall("callWithoutMsidAndBundle();");
}
// This test will modify the SDP offer to an unsupported codec, which should
// cause SetLocalDescription to fail.
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, NegotiateUnsupportedVideoCodec) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
NegotiateUnsupportedVideoCodec) {
MakeTypicalPeerConnectionCall("negotiateUnsupportedVideoCodec();");
}
// This test will modify the SDP offer to use no encryption, which should
// cause SetLocalDescription to fail.
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, NegotiateNonCryptoCall) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, NegotiateNonCryptoCall) {
MakeTypicalPeerConnectionCall("negotiateNonCryptoCall();");
}
// This test can negotiate an SDP offer that includes a b=AS:xx to control
// the bandwidth for audio and video
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, NegotiateOfferWithBLine) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, NegotiateOfferWithBLine) {
MakeTypicalPeerConnectionCall("negotiateOfferWithBLine();");
}
......@@ -303,14 +283,14 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, NegotiateOfferWithBLine) {
#define MAYBE_CanSetupLegacyCall CanSetupLegacyCall
#endif
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanSetupLegacyCall) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, MAYBE_CanSetupLegacyCall) {
MakeTypicalPeerConnectionCall("callWithLegacySdp();");
}
// This test will make a PeerConnection-based call and test an unreliable text
// dataChannel.
// TODO(mallinath) - Remove this test after rtp based data channel is disabled.
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, CallWithDataOnly) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CallWithDataOnly) {
MakeTypicalPeerConnectionCall("callWithDataOnly();");
}
......@@ -320,7 +300,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, CallWithDataOnly) {
#else
#define MAYBE_CallWithSctpDataOnly CallWithSctpDataOnly
#endif
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CallWithSctpDataOnly) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, MAYBE_CallWithSctpDataOnly) {
MakeTypicalPeerConnectionCall("callWithSctpDataOnly();");
}
......@@ -334,7 +314,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CallWithSctpDataOnly) {
// This test will make a PeerConnection-based call and test an unreliable text
// dataChannel and audio and video tracks.
// TODO(mallinath) - Remove this test after rtp based data channel is disabled.
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, DISABLED_CallWithDataAndMedia) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, DISABLED_CallWithDataAndMedia) {
MakeTypicalPeerConnectionCall("callWithDataAndMedia();");
}
......@@ -348,7 +328,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, DISABLED_CallWithDataAndMedia) {
#define MAYBE_CallWithSctpDataAndMedia CallWithSctpDataAndMedia
#endif
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
MAYBE_CallWithSctpDataAndMedia) {
MakeTypicalPeerConnectionCall("callWithSctpDataAndMedia();");
}
......@@ -363,7 +343,8 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
// This test will make a PeerConnection-based call and test an unreliable text
// dataChannel and later add an audio and video track.
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CallWithDataAndLaterAddMedia) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
MAYBE_CallWithDataAndLaterAddMedia) {
MakeTypicalPeerConnectionCall("callWithDataAndLaterAddMedia();");
}
......@@ -377,7 +358,8 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CallWithDataAndLaterAddMedia) {
// This test will make a PeerConnection-based call and send a new Video
// MediaStream that has been created based on a MediaStream created with
// getUserMedia.
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CallWithNewVideoMediaStream) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
MAYBE_CallWithNewVideoMediaStream) {
MakeTypicalPeerConnectionCall("callWithNewVideoMediaStream();");
}
......@@ -387,51 +369,51 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CallWithNewVideoMediaStream) {
// AudioTrack is added instead.
// TODO(phoglund): This test is manual since not all buildbots has an audio
// input.
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MANUAL_CallAndModifyStream) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, MANUAL_CallAndModifyStream) {
MakeTypicalPeerConnectionCall(
"callWithNewVideoMediaStreamLaterSwitchToAudio();");
}
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, AddTwoMediaStreamsToOnePC) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, AddTwoMediaStreamsToOnePC) {
MakeTypicalPeerConnectionCall("addTwoMediaStreamsToOneConnection();");
}
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
EstablishAudioVideoCallAndEnsureAudioIsPlaying) {
MakeAudioDetectingPeerConnectionCall(base::StringPrintf(
"callAndEnsureAudioIsPlaying(%s, {audio:true, video:true});",
kUseLenientAudioChecking));
}
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
EstablishAudioOnlyCallAndEnsureAudioIsPlaying) {
MakeAudioDetectingPeerConnectionCall(base::StringPrintf(
"callAndEnsureAudioIsPlaying(%s, {audio:true});",
kUseLenientAudioChecking));
}
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
EstablishAudioVideoCallAndVerifyRemoteMutingWorks) {
MakeAudioDetectingPeerConnectionCall(base::StringPrintf(
"callAndEnsureRemoteAudioTrackMutingWorks(%s);",
kUseLenientAudioChecking));
}
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
EstablishAudioVideoCallAndVerifyLocalMutingWorks) {
MakeAudioDetectingPeerConnectionCall(base::StringPrintf(
"callAndEnsureLocalAudioTrackMutingWorks(%s);",
kUseLenientAudioChecking));
}
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
EnsureLocalVideoMuteDoesntMuteAudio) {
MakeAudioDetectingPeerConnectionCall(base::StringPrintf(
"callAndEnsureLocalVideoMutingDoesntMuteAudio(%s);",
kUseLenientAudioChecking));
}
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
EnsureRemoteVideoMuteDoesntMuteAudio) {
MakeAudioDetectingPeerConnectionCall(base::StringPrintf(
"callAndEnsureRemoteVideoMutingDoesntMuteAudio(%s);",
......@@ -446,177 +428,17 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
#define MAYBE_EstablishAudioVideoCallAndVerifyUnmutingWorks\
EstablishAudioVideoCallAndVerifyUnmutingWorks
#endif
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
MAYBE_EstablishAudioVideoCallAndVerifyUnmutingWorks) {
MakeAudioDetectingPeerConnectionCall(base::StringPrintf(
"callAndEnsureAudioTrackUnmutingWorks(%s);", kUseLenientAudioChecking));
}
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, CallAndVerifyVideoMutingWorks) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CallAndVerifyVideoMutingWorks) {
MakeTypicalPeerConnectionCall("callAndEnsureVideoTrackMutingWorks();");
}
#if defined(OS_WIN)
#define IntToStringType base::IntToString16
#else
#define IntToStringType base::IntToString
#endif
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
// Timing out on ARM linux bot: http://crbug.com/238490
#define MAYBE_CallWithAecDump DISABLED_CallWithAecDump
#else
#define MAYBE_CallWithAecDump CallWithAecDump
#endif
// This tests will make a complete PeerConnection-based call, verify that
// video is playing for the call, and verify that a non-empty AEC dump file
// exists. The AEC dump is enabled through webrtc-internals. The HTML and
// Javascript is bypassed since it would trigger a file picker dialog. Instead,
// the dialog callback FileSelected() is invoked directly. In fact, there's
// never a webrtc-internals page opened at all since that's not needed.
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CallWithAecDump) {
ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
// We must navigate somewhere first so that the render process is created.
NavigateToURL(shell(), GURL(""));
base::FilePath dump_file;
ASSERT_TRUE(CreateTemporaryFile(&dump_file));
base::DeleteFile(dump_file, false);
// This fakes the behavior of another open tab with webrtc-internals, and
// enabling AEC dump in that tab.
WebRTCInternals::GetInstance()->FileSelected(dump_file, -1, NULL);
GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
DisableOpusIfOnAndroid();
ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});");
EXPECT_FALSE(base::PathExists(dump_file));
// Add file extensions that we expect to be added. The dump name will be
// <temporary path>.<render process id>.<consumer id>, for example
// "/tmp/.com.google.Chrome.Z6UC3P.12345.0".
base::ProcessId render_process_id = base::kNullProcessId;
EXPECT_TRUE(GetRenderProcessHostId(&render_process_id));
dump_file = dump_file.AddExtension(IntToStringType(render_process_id))
.AddExtension(IntToStringType(kExpectedConsumerId));
EXPECT_TRUE(base::PathExists(dump_file));
int64 file_size = 0;
EXPECT_TRUE(base::GetFileSize(dump_file, &file_size));
EXPECT_GT(file_size, 0);
base::DeleteFile(dump_file, false);
}
// TODO(grunell): Add test for multiple dumps when re-use of
// MediaStreamAudioProcessor in AudioCapturer has been removed.
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
// Timing out on ARM linux bot: http://crbug.com/238490
#define MAYBE_CallWithAecDumpEnabledThenDisabled DISABLED_CallWithAecDumpEnabledThenDisabled
#else
#define MAYBE_CallWithAecDumpEnabledThenDisabled CallWithAecDumpEnabledThenDisabled
#endif
// As above, but enable and disable dump before starting a call. The file should
// be created, but should be empty.
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
MAYBE_CallWithAecDumpEnabledThenDisabled) {
ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
// We must navigate somewhere first so that the render process is created.
NavigateToURL(shell(), GURL(""));
base::FilePath dump_file;
ASSERT_TRUE(CreateTemporaryFile(&dump_file));
base::DeleteFile(dump_file, false);
// This fakes the behavior of another open tab with webrtc-internals, and
// enabling AEC dump in that tab, then disabling it.
WebRTCInternals::GetInstance()->FileSelected(dump_file, -1, NULL);
WebRTCInternals::GetInstance()->DisableAecDump();
GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
DisableOpusIfOnAndroid();
ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});");
// Add file extensions that we expect to be added.
base::ProcessId render_process_id = base::kNullProcessId;
EXPECT_TRUE(GetRenderProcessHostId(&render_process_id));
dump_file = dump_file.AddExtension(IntToStringType(render_process_id))
.AddExtension(IntToStringType(kExpectedConsumerId));
EXPECT_FALSE(base::PathExists(dump_file));
base::DeleteFile(dump_file, false);
}
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
// Timing out on ARM linux bot: http://crbug.com/238490
#define MAYBE_TwoCallsWithAecDump DISABLED_TwoCallsWithAecDump
#else
#define MAYBE_TwoCallsWithAecDump TwoCallsWithAecDump
#endif
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_TwoCallsWithAecDump) {
ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
// We must navigate somewhere first so that the render process is created.
NavigateToURL(shell(), GURL(""));
// Create a second window.
Shell* shell2 = CreateBrowser();
NavigateToURL(shell2, GURL(""));
base::FilePath dump_file;
ASSERT_TRUE(CreateTemporaryFile(&dump_file));
base::DeleteFile(dump_file, false);
// This fakes the behavior of another open tab with webrtc-internals, and
// enabling AEC dump in that tab.
WebRTCInternals::GetInstance()->FileSelected(dump_file, -1, NULL);
GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
NavigateToURL(shell2, url);
ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});");
std::string result;
EXPECT_TRUE(ExecuteScriptAndExtractString(
shell2->web_contents(),
"call({video: true, audio: true});",
&result));
ASSERT_STREQ("OK", result.c_str());
EXPECT_FALSE(base::PathExists(dump_file));
RenderProcessHost::iterator it =
content::RenderProcessHost::AllHostsIterator();
for (; !it.IsAtEnd(); it.Advance()) {
base::ProcessId render_process_id =
base::GetProcId(it.GetCurrentValue()->GetHandle());
EXPECT_NE(base::kNullProcessId, render_process_id);
// Add file extensions that we expect to be added.
base::FilePath unique_dump_file =
dump_file.AddExtension(IntToStringType(render_process_id))
.AddExtension(IntToStringType(kExpectedConsumerId));
EXPECT_TRUE(base::PathExists(unique_dump_file));
int64 file_size = 0;
EXPECT_TRUE(base::GetFileSize(unique_dump_file, &file_size));
EXPECT_GT(file_size, 0);
base::DeleteFile(unique_dump_file, false);
}
}
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, CreateOfferWithOfferOptions) {
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CreateOfferWithOfferOptions) {
MakeTypicalPeerConnectionCall("testCreateOfferOptions();");
}
......
......@@ -103,10 +103,10 @@ class CONTENT_EXPORT WebRTCInternals : public NotificationObserver,
private:
friend struct DefaultSingletonTraits<WebRTCInternals>;
FRIEND_TEST_ALL_PREFIXES(WebRtcBrowserTest, CallWithAecDump);
FRIEND_TEST_ALL_PREFIXES(WebRtcBrowserTest,
FRIEND_TEST_ALL_PREFIXES(WebRtcAecDumpBrowserTest, CallWithAecDump);
FRIEND_TEST_ALL_PREFIXES(WebRtcAecDumpBrowserTest,
CallWithAecDumpEnabledThenDisabled);
FRIEND_TEST_ALL_PREFIXES(WebRtcBrowserTest, TwoCallsWithAecDump);
FRIEND_TEST_ALL_PREFIXES(WebRtcAecDumpBrowserTest, TwoCallsWithAecDump);
FRIEND_TEST_ALL_PREFIXES(WebRTCInternalsTest,
AecRecordingFileSelectionCanceled);
......
......@@ -1317,6 +1317,7 @@
}],
['enable_webrtc==1', {
'sources': [
'browser/media/webrtc_aecdump_browsertest.cc',
'browser/media/webrtc_browsertest.cc',
'browser/media/webrtc_getusermedia_browsertest.cc',
'browser/media/webrtc_internals_browsertest.cc',
......
......@@ -75,4 +75,12 @@ std::string WebRtcContentBrowserTest::GenerateGetUserMediaCall(
max_frame_rate);
}
void WebRtcContentBrowserTest::DisableOpusIfOnAndroid() {
#if defined(OS_ANDROID)
// Always force iSAC 16K on Android for now (Opus is broken).
EXPECT_EQ("isac-forced",
ExecuteJavascriptAndReturnResult("forceIsac16KInSdp();"));
#endif
}
} // namespace content
......@@ -26,6 +26,8 @@ class WebRtcContentBrowserTest: public ContentBrowserTest {
// If the javascript returns != OK or times out, we fail the test.
void ExecuteJavascriptAndWaitForOk(const std::string& javascript);
void DisableOpusIfOnAndroid();
// Generates javascript code for a getUserMedia call.
std::string GenerateGetUserMediaCall(const char* function_name,
int min_width,
......
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