| 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(
|
|
|