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

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: Fixed AEC dump tests on Andri 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
« no previous file with comments | « content/test/webrtc_content_browsertest_base.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b52a68e37002287396d44d3071c8d1e8abb35fd0 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,14 @@ 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) {
+ std::string result = ExecuteJavascriptAndReturnResult(javascript);
+ if (result != "OK") {
+ printf("From javascript: %s", result.c_str());
+ FAIL();
+ }
+ }
std::string WebRtcContentBrowserTest::GenerateGetUserMediaCall(
const char* function_name,
« no previous file with comments | « content/test/webrtc_content_browsertest_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698