OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <string> | 5 #include <string> |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/chrome_thread.h" | 9 #include "chrome/browser/chrome_thread.h" |
10 #include "chrome/browser/download/download_file.h" | 10 #include "chrome/browser/download/download_file.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 { "http://www.foo.com/extensionless-extension", | 105 { "http://www.foo.com/extensionless-extension", |
106 "application/x-chrome-extension", | 106 "application/x-chrome-extension", |
107 true, | 107 true, |
108 false, | 108 false, |
109 true, }, | 109 true, }, |
110 { "http://www.foo.com/save-as.pdf", | 110 { "http://www.foo.com/save-as.pdf", |
111 "application/pdf", | 111 "application/pdf", |
112 true, | 112 true, |
113 false, | 113 false, |
114 true, }, | 114 true, }, |
115 { "http://www.foo.com/auto-open.pdf", | 115 { "http://www.foo.com/always_prompt.pdf", |
116 "application/pdf", | 116 "application/pdf", |
117 false, | 117 false, |
118 true, | 118 true, |
119 false, }, | 119 true, }, |
120 }; | 120 }; |
121 | 121 |
122 } // namespace | 122 } // namespace |
123 | 123 |
124 TEST_F(DownloadManagerTest, StartDownload) { | 124 TEST_F(DownloadManagerTest, StartDownload) { |
125 PrefService* prefs = profile_->GetPrefs(); | 125 PrefService* prefs = profile_->GetPrefs(); |
126 prefs->SetFilePath(prefs::kDownloadDefaultDirectory, FilePath()); | 126 prefs->SetFilePath(prefs::kDownloadDefaultDirectory, FilePath()); |
127 download_manager_->download_prefs()->EnableAutoOpenBasedOnExtension( | 127 download_manager_->download_prefs()->EnableAutoOpenBasedOnExtension( |
128 FilePath(FILE_PATH_LITERAL("example.pdf"))); | 128 FilePath(FILE_PATH_LITERAL("example.pdf"))); |
129 | 129 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 download_manager_->OnAllDataSaved(i, 1024); | 251 download_manager_->OnAllDataSaved(i, 1024); |
252 download_manager_->FileSelected(new_path, i, info); | 252 download_manager_->FileSelected(new_path, i, info); |
253 } else { | 253 } else { |
254 download_manager_->FileSelected(new_path, i, info); | 254 download_manager_->FileSelected(new_path, i, info); |
255 download_manager_->OnAllDataSaved(i, 1024); | 255 download_manager_->OnAllDataSaved(i, 1024); |
256 } | 256 } |
257 | 257 |
258 message_loop_.RunAllPending(); | 258 message_loop_.RunAllPending(); |
259 } | 259 } |
260 } | 260 } |
OLD | NEW |