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

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

Issue 1301653005: Setup for moving getUserMedia to secure origins only (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Nits Created 5 years, 4 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 | « no previous file | chrome/renderer/chrome_content_renderer_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/chrome_media_stream_infobar_browsertest.cc
diff --git a/chrome/browser/media/chrome_media_stream_infobar_browsertest.cc b/chrome/browser/media/chrome_media_stream_infobar_browsertest.cc
index a5d7107201ef746f2a5b1fe0c29ec6d337527936..25b5e155bcb86c5fd2fa81b709529d276c6d1c4e 100644
--- a/chrome/browser/media/chrome_media_stream_infobar_browsertest.cc
+++ b/chrome/browser/media/chrome_media_stream_infobar_browsertest.cc
@@ -69,33 +69,14 @@ class MediaStreamPermissionTest : public WebRtcTestBase {
return result.compare("ok-stopped") == 0;
}
- void useNonSecureOriginForTestPage() {
- use_secure_origin_for_test_page_ = false;
- host_resolver()->AddRule("*", "127.0.0.1");
- }
-
private:
- // The default test server is localhost, which is considered secure:
- // http://www.w3.org/TR/powerful-features/#is-origin-trustworthy
- bool use_secure_origin_for_test_page_ = true;
-
content::WebContents* LoadTestPageInBrowser(Browser* browser) {
EXPECT_TRUE(test_server()->Start());
- GURL url;
-
- if (use_secure_origin_for_test_page_) {
- // Uses the default server.
- url = test_page_url();
- } else {
- static const char kFoo[] = "not-secure.example.com";
- GURL::Replacements replacements;
- replacements.SetSchemeStr(url::kHttpScheme);
- replacements.SetHostStr(kFoo);
- url = test_page_url().ReplaceComponents(replacements);
- }
+ // Uses the default server.
+ GURL url = test_page_url();
- EXPECT_EQ(use_secure_origin_for_test_page_, content::IsOriginSecure(url));
+ EXPECT_TRUE(content::IsOriginSecure(url));
ui_test_utils::NavigateToURL(browser, url);
return browser->tab_strip_model()->GetActiveWebContents();
@@ -133,35 +114,6 @@ IN_PROC_BROWSER_TEST_F(MediaStreamPermissionTest,
}
IN_PROC_BROWSER_TEST_F(MediaStreamPermissionTest,
- TestNonSecureOriginAcceptThenDenyIsSticky) {
-#if defined(OS_WIN) && defined(USE_ASH)
- // Disable this test in Metro+Ash for now (http://crbug.com/262796).
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kAshBrowserTests))
- return;
-#endif
-
- useNonSecureOriginForTestPage();
- content::WebContents* tab_contents = LoadTestPageInTab();
- EXPECT_FALSE(content::IsOriginSecure(tab_contents->GetLastCommittedURL()));
-
- EXPECT_TRUE(GetUserMediaAndAccept(tab_contents));
- GetUserMediaAndDeny(tab_contents);
-
- GetUserMediaAndExpectAutoDenyWithoutPrompt(tab_contents);
-}
-
-IN_PROC_BROWSER_TEST_F(MediaStreamPermissionTest,
- TestNonSecureOriginDenyIsSticky) {
- useNonSecureOriginForTestPage();
- content::WebContents* tab_contents = LoadTestPageInTab();
- EXPECT_FALSE(content::IsOriginSecure(tab_contents->GetLastCommittedURL()));
-
- GetUserMediaAndDeny(tab_contents);
- GetUserMediaAndExpectAutoDenyWithoutPrompt(tab_contents);
-}
-
-IN_PROC_BROWSER_TEST_F(MediaStreamPermissionTest,
TestSecureOriginDenyIsSticky) {
content::WebContents* tab_contents = LoadTestPageInTab();
EXPECT_TRUE(content::IsOriginSecure(tab_contents->GetLastCommittedURL()));
@@ -171,16 +123,6 @@ IN_PROC_BROWSER_TEST_F(MediaStreamPermissionTest,
}
IN_PROC_BROWSER_TEST_F(MediaStreamPermissionTest,
- TestNonSecureOriginAcceptIsNotSticky) {
- useNonSecureOriginForTestPage();
- content::WebContents* tab_contents = LoadTestPageInTab();
- EXPECT_FALSE(content::IsOriginSecure(tab_contents->GetLastCommittedURL()));
-
- EXPECT_TRUE(GetUserMediaAndAccept(tab_contents));
- EXPECT_TRUE(GetUserMediaAndAccept(tab_contents));
-}
-
-IN_PROC_BROWSER_TEST_F(MediaStreamPermissionTest,
TestSecureOriginAcceptIsSticky) {
content::WebContents* tab_contents = LoadTestPageInTab();
EXPECT_TRUE(content::IsOriginSecure(tab_contents->GetLastCommittedURL()));
« no previous file with comments | « no previous file | chrome/renderer/chrome_content_renderer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698