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

Unified Diff: content/public/test/browser_test_base.cc

Issue 2376083002: BlobUrlBrowserTest: Add a test exercising blob: URLs from file:// documents.
Patch Set: With fix Created 4 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 | « content/public/test/browser_test_base.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/browser_test_base.cc
diff --git a/content/public/test/browser_test_base.cc b/content/public/test/browser_test_base.cc
index 0b510beb8b483eefcdec4d63d0ceac8e1fa3d53e..493ffb04757cc44b317e16b3680d5bb6f3221eff 100644
--- a/content/public/test/browser_test_base.cc
+++ b/content/public/test/browser_test_base.cc
@@ -146,6 +146,7 @@ BrowserTestBase::BrowserTestBase()
: expected_exit_code_(0),
enable_pixel_output_(false),
use_software_compositing_(false),
+ allow_file_access_from_files_(true),
set_up_called_(false) {
#if defined(OS_MACOSX)
base::mac::SetOverrideAmIBundled(true);
@@ -195,8 +196,11 @@ void BrowserTestBase::SetUp() {
switches::kIPCConnectionTimeout,
base::Int64ToString(TestTimeouts::action_max_timeout().InSeconds()));
- // The tests assume that file:// URIs can freely access other file:// URIs.
- command_line->AppendSwitch(switches::kAllowFileAccessFromFiles);
+ // Many tests load their pages via file://, so we enable it by default, unless
+ // the test called RevokeFileAccessFromFiles() to return to the normal
+ // behavior.
+ if (allow_file_access_from_files_)
+ command_line->AppendSwitch(switches::kAllowFileAccessFromFiles);
command_line->AppendSwitch(switches::kDomAutomationController);
@@ -388,6 +392,10 @@ void BrowserTestBase::UseSoftwareCompositing() {
use_software_compositing_ = true;
}
+void BrowserTestBase::RevokeFileAccessFromFiles() {
+ allow_file_access_from_files_ = false;
+}
+
bool BrowserTestBase::UsingOSMesa() const {
base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
return cmd->GetSwitchValueASCII(switches::kUseGL) ==
« no previous file with comments | « content/public/test/browser_test_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698