Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(900)

Unified Diff: content/test/webrtc_content_browsertest_base.cc

Issue 190563002: Refactored how WebRTC content browser tests talk to their javascript. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/test/webrtc_content_browsertest_base.cc
diff --git a/content/test/webrtc_content_browsertest_base.cc b/content/test/webrtc_content_browsertest_base.cc
index 54bafbeb74dda8b478e233f1073a0a8c21c8376e..5242aae3b0e861251b5b5aafc55e859684e4c314 100644
--- a/content/test/webrtc_content_browsertest_base.cc
+++ b/content/test/webrtc_content_browsertest_base.cc
@@ -33,11 +33,6 @@ void WebRtcContentBrowserTest::SetUp() {
ContentBrowserTest::SetUp();
}
-bool WebRtcContentBrowserTest::ExecuteJavascript(
- const std::string& javascript) {
- return ExecuteScript(shell()->web_contents(), javascript);
-}
-
// Executes |javascript|. The script is required to use
// window.domAutomationController.send to send a string value back to here.
std::string WebRtcContentBrowserTest::ExecuteJavascriptAndReturnResult(
@@ -49,12 +44,19 @@ std::string WebRtcContentBrowserTest::ExecuteJavascriptAndReturnResult(
return result;
}
-void WebRtcContentBrowserTest::ExpectTitle(
- const std::string& expected_title) const {
- base::string16 expected_title16(base::ASCIIToUTF16(expected_title));
- TitleWatcher title_watcher(shell()->web_contents(), expected_title16);
- EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle());
-}
+void WebRtcContentBrowserTest::ExecuteJavascriptAndWaitForOk(
+ const std::string& javascript) {
+#if defined (OS_ANDROID)
+ // Always force iSAC 16K on Android for now (Opus is broken).
+ ASSERT_TRUE(ExecuteJavascript("forceIsac16KInSdp();"));
perkj_chrome 2014/03/07 14:00:21 Does this work for all tests regardless of the tes
phoglund_chromium 2014/03/07 14:23:36 You're right, this will break android for the getu
+#endif
+
+ std::string result = ExecuteJavascriptAndReturnResult(javascript);
+ if (result != "OK") {
+ printf("From javascript: %s", result.c_str());
+ FAIL();
+ }
+ }
std::string WebRtcContentBrowserTest::GenerateGetUserMediaCall(
const char* function_name,

Powered by Google App Engine
This is Rietveld 408576698