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

Unified Diff: chrome/browser/tab_contents/view_source_browsertest.cc

Issue 11775002: Media Documents should disable View [Page] Source (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed extra string copy Created 7 years, 11 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 | content/browser/web_contents/navigation_controller_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/view_source_browsertest.cc
diff --git a/chrome/browser/tab_contents/view_source_browsertest.cc b/chrome/browser/tab_contents/view_source_browsertest.cc
index 12367751323f24dfee1781214e15d23124488843..3d08b054cc9d0844e8cfd3c40b1d0b3ed2338ff0 100644
--- a/chrome/browser/tab_contents/view_source_browsertest.cc
+++ b/chrome/browser/tab_contents/view_source_browsertest.cc
@@ -21,6 +21,7 @@
namespace {
const char kTestHtml[] = "files/viewsource/test.html";
+const char kTestMedia[] = "files/media/pink_noise_140ms.wav";
}
typedef InProcessBrowserTest ViewSourceTest;
@@ -75,6 +76,21 @@ IN_PROC_BROWSER_TEST_F(ViewSourceTest, ViewSourceInMenuEnabledOnANormalPage) {
EXPECT_TRUE(chrome::CanViewSource(browser()));
}
+// For page that is media content, make sure that we cannot select "View Source"
+// See http://crbug.com/83714
+IN_PROC_BROWSER_TEST_F(ViewSourceTest, ViewSourceInMenuDisabledOnAMediaPage) {
+ ASSERT_TRUE(test_server()->Start());
+
+ GURL url(test_server()->GetURL(kTestMedia));
+ ui_test_utils::NavigateToURL(browser(), url);
+
+ const char* mime_type = chrome::GetActiveWebContents(browser())->
+ GetContentsMimeType().c_str();
+
+ EXPECT_STREQ("audio/wav", mime_type);
+ EXPECT_FALSE(chrome::CanViewSource(browser()));
+}
+
// Make sure that when looking at the page source, we can't select "View Source"
// from the menu.
IN_PROC_BROWSER_TEST_F(ViewSourceTest,
« no previous file with comments | « no previous file | content/browser/web_contents/navigation_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698