summaryrefslogtreecommitdiffstats
path: root/content/browser/media/webrtc_browsertest.cc
diff options
context:
space:
mode:
authorphoglund@chromium.org <phoglund@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-08 21:00:58 +0000
committerphoglund@chromium.org <phoglund@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-08 21:00:58 +0000
commit43ebe9ea4f1467868b63f1b0688c8f8dff73c032 (patch)
tree322c24f9f1c00878cd0c9de5e336d9df6facdf19 /content/browser/media/webrtc_browsertest.cc
parent35c55662f88324f8e7da7912801a59a7f9c7ecf6 (diff)
downloadchromium_src-43ebe9ea4f1467868b63f1b0688c8f8dff73c032.zip
chromium_src-43ebe9ea4f1467868b63f1b0688c8f8dff73c032.tar.gz
chromium_src-43ebe9ea4f1467868b63f1b0688c8f8dff73c032.tar.bz2
Refactored how WebRTC content browser tests talk to their javascript.
We will now use the domAutomationController rather than looking at the page title. This will confer the following advantages: - Tests will fail right away when the js detects an error, rather than timing out. - We will get a lot better stack traces when errors do occur. - The communication path to the tests becomes more flexible with possibility for custom return values (for instance if we need to verify something in the C++ code or have a multi-stage test). BUG=None NOTRY=True (doing notry since CQ gets stuck on telemetry test on mac_rel) Review URL: https://codereview.chromium.org/190563002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255795 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/media/webrtc_browsertest.cc')
-rw-r--r--content/browser/media/webrtc_browsertest.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/content/browser/media/webrtc_browsertest.cc b/content/browser/media/webrtc_browsertest.cc
index 8ecc8b2..e4f7b9d 100644
--- a/content/browser/media/webrtc_browsertest.cc
+++ b/content/browser/media/webrtc_browsertest.cc
@@ -34,17 +34,17 @@ class WebRtcBrowserTest : public WebRtcContentBrowserTest {
GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
- ExecuteTestAndWaitForOk(javascript);
+
+ DisableOpusIfOnAndroid();
+ ExecuteJavascriptAndWaitForOk(javascript);
}
- void ExecuteTestAndWaitForOk(const std::string& javascript) {
+ void DisableOpusIfOnAndroid() {
#if defined (OS_ANDROID)
// Always force iSAC 16K on Android for now (Opus is broken).
- ASSERT_TRUE(ExecuteJavascript("forceIsac16KInSdp();"));
+ EXPECT_EQ("isac-forced",
+ ExecuteJavascriptAndReturnResult("forceIsac16KInSdp();"));
#endif
-
- ASSERT_TRUE(ExecuteJavascript(javascript));
- ExpectTitle("OK");
}
};
@@ -331,7 +331,8 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CallWithAecDump) {
GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
- ExecuteTestAndWaitForOk("call({video: true, audio: true});");
+ DisableOpusIfOnAndroid();
+ ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});");
EXPECT_TRUE(base::PathExists(dump_file));
int64 file_size = 0;
@@ -367,7 +368,8 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
- ExecuteTestAndWaitForOk("call({video: true, audio: true});");
+ DisableOpusIfOnAndroid();
+ ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});");
EXPECT_TRUE(base::PathExists(dump_file));
int64 file_size = 0;