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

Unified Diff: chrome/browser/media/webrtc_browsertest_base.cc

Issue 99333010: Working around the page load problem on Linux, re-enable tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years 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 | « chrome/browser/media/webrtc_browsertest_base.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/webrtc_browsertest_base.cc
diff --git a/chrome/browser/media/webrtc_browsertest_base.cc b/chrome/browser/media/webrtc_browsertest_base.cc
index 8580a894ef9e5d333464ce915303bc4f5c5bac32..78f6e11a0cced777af2a5a8f2a2930c35c851195 100644
--- a/chrome/browser/media/webrtc_browsertest_base.cc
+++ b/chrome/browser/media/webrtc_browsertest_base.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/media/media_stream_infobar_delegate.h"
#include "chrome/browser/media/webrtc_browsertest_common.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/notification_service.h"
@@ -117,21 +118,10 @@ void WebRtcTestBase::GetUserMediaAndDismiss(
void WebRtcTestBase::GetUserMedia(content::WebContents* tab_contents,
const std::string& constraints) const {
- // TODO(phoglund): temporary debugging measure for crbug.com/281268.
- std::string javascript =
- "if (typeof(doGetUserMedia) != typeof(Function)) {\n"
- " console.log('hitting weird js load bug: diagnosing...');\n"
- " for (var v in window) {\n"
- " if (window.hasOwnProperty(v)) console.log(v);\n"
- " }\n"
- " window.domAutomationController.send('failed!');\n"
- "}\n"
- "else\n"
- " doGetUserMedia(" + constraints + ");";
// Request user media: this will launch the media stream info bar.
std::string result;
EXPECT_TRUE(content::ExecuteScriptAndExtractString(
- tab_contents, javascript, &result));
+ tab_contents, "doGetUserMedia(" + constraints + ");", &result));
EXPECT_EQ("ok-requested", result);
}
@@ -152,6 +142,20 @@ InfoBar* WebRtcTestBase::GetUserMediaAndWaitForInfoBar(
return details.ptr();
}
+content::WebContents* WebRtcTestBase::OpenPageAndGetUserMediaInNewTab(
+ const GURL& url) const {
+ chrome::AddTabAt(browser(), GURL(), -1, true);
+ ui_test_utils::NavigateToURL(browser(), url);
+#if defined (OS_LINUX)
+ // Load the page again on Linux to work around crbug.com/281268.
+ ui_test_utils::NavigateToURL(browser(), url);
+#endif
+ content::WebContents* new_tab =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ GetUserMediaAndAccept(new_tab);
+ return new_tab;
+}
+
content::WebContents* WebRtcTestBase::OpenPageAndAcceptUserMedia(
const GURL& url) const {
content::WindowedNotificationObserver infobar_added(
« no previous file with comments | « chrome/browser/media/webrtc_browsertest_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698