Skip to content

Commit

Permalink
Revert 260213 "Relanding Switched main WebRTC browser tests to u..."
Browse files Browse the repository at this point in the history
I suspect that this caused the VerifyEncryption failure here:
http://build.chromium.org/p/chromium.win/builders/Win7%20Tests%20%28dbg%29%283%29/builds/25821


> Relanding Switched main WebRTC browser tests to use a more realistic video
> 
> > Switched main WebRTC browser tests to use a more realistic video.
> 
> > After switching to fake device flags instead of software webcams, we
> > noticed a ton of video-related metrics changed. This is because the
> > spinning green ball is an unrealistic encode/decode example. This patch
> > will use the new fake device file flag to play a more realistic video.
> 
> > BUG=352261, 343504
> > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=259887
> 
> TBR=tommi@chromium.org
> BUG=352261, 343504
> 
> Review URL: https://codereview.chromium.org/216773002

TBR=phoglund@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260284 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
creis@chromium.org committed Mar 28, 2014
1 parent c5e8ee8 commit 8918f99
Show file tree
Hide file tree
Showing 13 changed files with 121 additions and 202 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ IN_PROC_BROWSER_TEST_F(MediaStreamInfoBarTest,

// Should fail with permission denied right away with no infobar popping up.
GetUserMedia(tab_contents, kAudioVideoCallConstraints);
EXPECT_TRUE(test::PollingWaitUntil("obtainGetUserMediaResult()",
kFailedWithPermissionDeniedError,
tab_contents));
EXPECT_TRUE(PollingWaitUntil("obtainGetUserMediaResult()",
kFailedWithPermissionDeniedError,
tab_contents));
InfoBarService* infobar_service =
InfoBarService::FromWebContents(tab_contents);
EXPECT_EQ(0u, infobar_service->infobar_count());
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/media/chrome_webrtc_apprtc_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class WebRtcApprtcBrowserTest : public WebRtcTestBase {
// Apprtc will set remoteVideo.style.opacity to 1 when the call comes up.
std::string javascript =
"window.domAutomationController.send(remoteVideo.style.opacity)";
return test::PollingWaitUntil(javascript, "1", tab_contents);
return PollingWaitUntil(javascript, "1", tab_contents);
}

bool EvalInJavascriptFile(content::WebContents* tab_contents,
Expand Down
14 changes: 7 additions & 7 deletions chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class WebRtcAudioQualityBrowserTest : public WebRtcTestBase,
public:
WebRtcAudioQualityBrowserTest() {}
virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
test::PeerConnectionServerRunner::KillAllPeerConnectionServers();
PeerConnectionServerRunner::KillAllPeerConnectionServersOnCurrentSystem();
DetectErrorsInJavaScript(); // Look for errors in our rather complex js.
}

Expand Down Expand Up @@ -137,10 +137,10 @@ class WebRtcAudioQualityBrowserTest : public WebRtcTestBase,
ExecuteJavascript("negotiateCall()", from_tab));

// Ensure the call gets up on both sides.
EXPECT_TRUE(test::PollingWaitUntil("getPeerConnectionReadyState()",
"active", from_tab));
EXPECT_TRUE(test::PollingWaitUntil("getPeerConnectionReadyState()",
"active", to_tab));
EXPECT_TRUE(PollingWaitUntil("getPeerConnectionReadyState()",
"active", from_tab));
EXPECT_TRUE(PollingWaitUntil("getPeerConnectionReadyState()",
"active", to_tab));
}

base::FilePath CreateTemporaryWaveFile() {
Expand All @@ -152,7 +152,7 @@ class WebRtcAudioQualityBrowserTest : public WebRtcTestBase,
return wav_filename;
}

test::PeerConnectionServerRunner peerconnection_server_;
PeerConnectionServerRunner peerconnection_server_;
};

class AudioRecorder {
Expand Down Expand Up @@ -419,7 +419,7 @@ IN_PROC_BROWSER_TEST_P(WebRtcAudioQualityBrowserTest,
// because the ready state is ok on both sides. We sleep a bit between call
// establishment and playing to avoid cutting of the beginning of the audio
// file.
test::SleepInJavascript(left_tab, 2000);
SleepInJavascript(left_tab, 2000);

base::FilePath recording = CreateTemporaryWaveFile();

Expand Down
54 changes: 12 additions & 42 deletions chrome/browser/media/chrome_webrtc_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,37 +32,27 @@
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "testing/perf/perf_test.h"

// For fine-grained suppression.
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#endif

static const char kMainWebrtcTestHtmlPage[] =
"/webrtc/webrtc_jsep01_test.html";

// Top-level integration test for WebRTC. The test methods here must run
// sequentially since they use a server binary on the system (hence they are
// tagged as MANUAL). In addition, they need the reference videos which require
// the webrtc.DEPS solution, which is not generally available on Chromium bots.
// tagged as MANUAL).
class WebRtcBrowserTest : public WebRtcTestBase,
public testing::WithParamInterface<bool> {
public:
WebRtcBrowserTest() {}
virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
test::PeerConnectionServerRunner::KillAllPeerConnectionServers();
PeerConnectionServerRunner::KillAllPeerConnectionServersOnCurrentSystem();
DetectErrorsInJavaScript(); // Look for errors in our rather complex js.
}

virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
// Ensure the infobar is enabled, since we expect that in this test.
EXPECT_FALSE(command_line->HasSwitch(switches::kUseFakeUIForMediaStream));

// Play a suitable, somewhat realistic video file.
base::FilePath input_video = test::GetReferenceVideosDir()
.Append(test::kReferenceFileName360p)
.AddExtension(test::kY4mFileExtension);
command_line->AppendSwitchPath(switches::kUseFileForFakeVideoCapture,
input_video);
// TODO(phoglund): allow this test to also run with real devices once we
// get real webcam bots up.
command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream);

// Flag used by TestWebAudioMediaStream to force garbage collection.
Expand Down Expand Up @@ -123,15 +113,7 @@ class WebRtcBrowserTest : public WebRtcTestBase,
return NULL;
}

bool OnWinXp() {
#if defined(OS_WIN)
return base::win::GetVersion() <= base::win::VERSION_XP;
#else
return false;
#endif
}

test::PeerConnectionServerRunner peerconnection_server_;
PeerConnectionServerRunner peerconnection_server_;
};

static const bool kRunTestsWithFlag[] = { false, true };
Expand All @@ -141,9 +123,6 @@ INSTANTIATE_TEST_CASE_P(WebRtcBrowserTests,

IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest,
MANUAL_RunsAudioVideoWebRTCCallInTwoTabs) {
if (OnWinXp()) return;

ASSERT_TRUE(test::HasReferenceFilesInCheckout());
ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
ASSERT_TRUE(peerconnection_server_.Start());

Expand All @@ -168,9 +147,6 @@ IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest,
}

IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MANUAL_CpuUsage15Seconds) {
if (OnWinXp()) return;

ASSERT_TRUE(test::HasReferenceFilesInCheckout());
ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
ASSERT_TRUE(peerconnection_server_.Start());

Expand Down Expand Up @@ -206,7 +182,7 @@ IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MANUAL_CpuUsage15Seconds) {

EstablishCall(left_tab, right_tab);

test::SleepInJavascript(left_tab, 15000);
SleepInJavascript(left_tab, 15000);

HangUp(left_tab);
WaitUntilHangupVerified(left_tab);
Expand All @@ -223,9 +199,6 @@ IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MANUAL_CpuUsage15Seconds) {
// This is manual for its long execution time.
IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest,
MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetrics) {
if (OnWinXp()) return;

ASSERT_TRUE(test::HasReferenceFilesInCheckout());
ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
ASSERT_TRUE(peerconnection_server_.Start());

Expand All @@ -247,15 +220,15 @@ IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest,
WaitForVideoToPlay(right_tab);

// Let values stabilize, bandwidth ramp up, etc.
test::SleepInJavascript(left_tab, 60000);
SleepInJavascript(left_tab, 60000);

// Start measurements.
chrome::AddTabAt(browser(), GURL(), -1, true);
ui_test_utils::NavigateToURL(browser(), GURL("chrome://webrtc-internals"));
content::WebContents* webrtc_internals_tab =
browser()->tab_strip_model()->GetActiveWebContents();

test::SleepInJavascript(left_tab, 10000);
SleepInJavascript(left_tab, 10000);

scoped_ptr<base::DictionaryValue> all_data(
GetWebrtcInternalsData(webrtc_internals_tab));
Expand All @@ -264,8 +237,8 @@ IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest,
const base::DictionaryValue* first_pc_dict =
GetDataOnFirstPeerConnection(all_data.get());
ASSERT_TRUE(first_pc_dict != NULL);
test::PrintBweForVideoMetrics(*first_pc_dict);
test::PrintMetricsForAllStreams(*first_pc_dict);
PrintBweForVideoMetrics(*first_pc_dict);
PrintMetricsForAllStreams(*first_pc_dict);

HangUp(left_tab);
WaitUntilHangupVerified(left_tab);
Expand All @@ -274,18 +247,15 @@ IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest,
ASSERT_TRUE(peerconnection_server_.Stop());
}

IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MANUAL_TestWebAudioMediaStream) {
if (OnWinXp()) return;

ASSERT_TRUE(test::HasReferenceFilesInCheckout());
IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, TestWebAudioMediaStream) {
ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html"));
ui_test_utils::NavigateToURL(browser(), url);
content::WebContents* tab =
browser()->tab_strip_model()->GetActiveWebContents();

// A sleep is necessary to be able to detect the crash.
test::SleepInJavascript(tab, 1000);
SleepInJavascript(tab, 1000);

ASSERT_FALSE(tab->IsCrashed());
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class WebRtcDisableEncryptionFlagBrowserTest : public WebRtcTestBase {
virtual ~WebRtcDisableEncryptionFlagBrowserTest() {}

virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
test::PeerConnectionServerRunner::KillAllPeerConnectionServers();
PeerConnectionServerRunner::KillAllPeerConnectionServersOnCurrentSystem();
DetectErrorsInJavaScript(); // Look for errors in our rather complex js.
}

Expand All @@ -44,7 +44,7 @@ class WebRtcDisableEncryptionFlagBrowserTest : public WebRtcTestBase {
}

protected:
test::PeerConnectionServerRunner peerconnection_server_;
PeerConnectionServerRunner peerconnection_server_;

private:
DISALLOW_COPY_AND_ASSIGN(WebRtcDisableEncryptionFlagBrowserTest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class WebRtcTypingDetectionBrowserTest : public WebRtcTestBase {
// TODO(phoglund): clean up duplication from audio quality browser test when
// this test is complete and is proven to work.
virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
test::PeerConnectionServerRunner::KillAllPeerConnectionServers();
PeerConnectionServerRunner::KillAllPeerConnectionServersOnCurrentSystem();
}

bool HasAllRequiredResources() {
Expand Down Expand Up @@ -88,13 +88,13 @@ class WebRtcTypingDetectionBrowserTest : public WebRtcTestBase {
ExecuteJavascript("negotiateCall()", from_tab));

// Ensure the call gets up on both sides.
EXPECT_TRUE(test::PollingWaitUntil("getPeerConnectionReadyState()",
"active", from_tab));
EXPECT_TRUE(test::PollingWaitUntil("getPeerConnectionReadyState()",
"active", to_tab));
EXPECT_TRUE(PollingWaitUntil("getPeerConnectionReadyState()",
"active", from_tab));
EXPECT_TRUE(PollingWaitUntil("getPeerConnectionReadyState()",
"active", to_tab));
}

test::PeerConnectionServerRunner peerconnection_server_;
PeerConnectionServerRunner peerconnection_server_;
};

// TODO(phoglund): enable when fully implemented.
Expand Down Expand Up @@ -133,13 +133,13 @@ IN_PROC_BROWSER_TEST_F(WebRtcTypingDetectionBrowserTest,
// because the ready state is ok on both sides. We sleep a bit between call
// establishment and playing to avoid cutting of the beginning of the audio
// file.
test::SleepInJavascript(left_tab, 2000);
SleepInJavascript(left_tab, 2000);

PlayAudioFile(left_tab);

// TODO(phoglund): simulate key presses, look for changes in typing detection
// state.
test::SleepInJavascript(left_tab, 10000);
SleepInJavascript(left_tab, 10000);

HangUp(left_tab);
WaitUntilHangupVerified(left_tab);
Expand Down
Loading

0 comments on commit 8918f99

Please sign in to comment.