Index: content/shell/browser/shell_browser_context.cc |
diff --git a/content/shell/browser/shell_browser_context.cc b/content/shell/browser/shell_browser_context.cc |
index 733e938bf7f95e4336644a9bd89a51e937b6cd65..308ed388359e2697edf9b03e72eae275134da926 100644 |
--- a/content/shell/browser/shell_browser_context.cc |
+++ b/content/shell/browser/shell_browser_context.cc |
@@ -49,9 +49,9 @@ |
ShellBrowserContext::ShellBrowserContext(bool off_the_record, |
net::NetLog* net_log) |
: resource_context_(new ShellResourceContext), |
- ignore_certificate_errors_(false), |
off_the_record_(off_the_record), |
net_log_(net_log), |
+ ignore_certificate_errors_(false), |
guest_manager_(NULL) { |
InitWhileIOAllowed(); |
} |
@@ -65,8 +65,10 @@ |
void ShellBrowserContext::InitWhileIOAllowed() { |
CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
- if (cmd_line->HasSwitch(switches::kIgnoreCertificateErrors)) |
+ if (cmd_line->HasSwitch(switches::kIgnoreCertificateErrors) || |
+ cmd_line->HasSwitch(switches::kDumpRenderTree)) { |
ignore_certificate_errors_ = true; |
+ } |
if (cmd_line->HasSwitch(switches::kContentShellDataPath)) { |
path_ = cmd_line->GetSwitchValuePath(switches::kContentShellDataPath); |
return; |
@@ -104,10 +106,16 @@ |
} |
DownloadManagerDelegate* ShellBrowserContext::GetDownloadManagerDelegate() { |
+ DownloadManager* manager = BrowserContext::GetDownloadManager(this); |
+ |
if (!download_manager_delegate_.get()) { |
download_manager_delegate_.reset(new ShellDownloadManagerDelegate()); |
- download_manager_delegate_->SetDownloadManager( |
- BrowserContext::GetDownloadManager(this)); |
+ download_manager_delegate_->SetDownloadManager(manager); |
+ CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
+ if (cmd_line->HasSwitch(switches::kDumpRenderTree)) { |
+ download_manager_delegate_->SetDownloadBehaviorForTesting( |
+ path_.Append(FILE_PATH_LITERAL("downloads"))); |
+ } |
} |
return download_manager_delegate_.get(); |
@@ -129,8 +137,7 @@ |
protocol_handlers, |
request_interceptors.Pass(), |
net_log_); |
- static_cast<ShellResourceContext*>(resource_context_.get()) |
- ->set_url_request_context_getter(url_request_getter_.get()); |
+ resource_context_->set_url_request_context_getter(url_request_getter_.get()); |
return url_request_getter_.get(); |
} |