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

Unified Diff: chrome/browser/extensions/api/streams_private/streams_private_apitest.cc

Issue 667483002: Account for NULL headers in streams. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a test Created 6 years, 2 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/test/data/extensions/api_test/streams_private/handle_mime_type/background.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/streams_private/streams_private_apitest.cc
diff --git a/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc b/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc
index 16024fdcbf88ad78ceb21313b302185a09b6b1bf..69edf4ad8db593e7d69a74586ec75b67888838e5 100644
--- a/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc
+++ b/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc
@@ -269,6 +269,34 @@ IN_PROC_BROWSER_TEST_F(StreamsPrivateApiTest, Navigate) {
EXPECT_TRUE(catcher.GetNextResult());
}
+// Tests that navigating to a file URL also intercepts despite there being no
+// HTTP headers. This is a regression test for https://crbug.com/416433.
+IN_PROC_BROWSER_TEST_F(StreamsPrivateApiTest, FileURL) {
+#if defined(OS_WIN) && defined(USE_ASH)
+ // Disable this test in Metro+Ash for now (http://crbug.com/262796).
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests))
+ return;
+#endif
+
+ ASSERT_TRUE(LoadTestExtension()) << message_;
+
+ ResultCatcher catcher;
+
+ ui_test_utils::NavigateToURL(browser(), ui_test_utils::GetTestUrl(
+ base::FilePath(FILE_PATH_LITERAL("downloads")),
+ base::FilePath(FILE_PATH_LITERAL("Picture_1.doc"))));
+
+ // There should be no downloads started by the navigation.
+ DownloadManager* download_manager = GetDownloadManager();
+ std::vector<DownloadItem*> downloads;
+ download_manager->GetAllDownloads(&downloads);
+ ASSERT_EQ(0u, downloads.size());
+
+ // The test extension should receive onExecuteContentHandler event with MIME
+ // type 'application/msword' (and call chrome.test.notifySuccess).
+ EXPECT_TRUE(catcher.GetNextResult());
+}
+
// Tests that navigating cross-site to a resource with a MIME type handleable by
// an installed, white-listed extension invokes the extension's
// onExecuteContentHandler event (and does not start a download).
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/streams_private/handle_mime_type/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698