| 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) ==
|
|
|