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

Unified Diff: chrome/browser/net/chrome_network_delegate.cc

Issue 10882071: Fixes for bunch of browser tests that are trying to load content from file: schema. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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 | « chrome/browser/instant/instant_browsertest.cc ('k') | chrome/browser/prerender/prerender_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/chrome_network_delegate.cc
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
index 9404e25244a1d7044351b1ae4dcf91be8415849b..94722f2c3f5720773c668348097e430928e36d66 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -43,6 +43,8 @@
#if defined(OS_CHROMEOS)
#include "base/chromeos/chromeos_version.h"
+#include "base/command_line.h"
+#include "chrome/common/chrome_switches.h"
#endif
#if defined(ENABLE_CONFIGURATION_POLICY)
@@ -365,8 +367,10 @@ bool ChromeNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
#if defined(OS_CHROMEOS)
// If we're running Chrome for ChromeOS on Linux, we want to allow file
// access.
- if (!base::chromeos::IsRunningOnChromeOS())
+ if (!base::chromeos::IsRunningOnChromeOS() ||
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) {
return true;
+ }
// Use a whitelist to only allow access to files residing in the list of
// directories below.
@@ -402,6 +406,7 @@ bool ChromeNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
}
}
+ DVLOG(1) << "File access denied - " << path.value().c_str();
return false;
#endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
}
« no previous file with comments | « chrome/browser/instant/instant_browsertest.cc ('k') | chrome/browser/prerender/prerender_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698