OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <map> | 5 #include <map> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 class FakeDownloadProtectionService : public DownloadProtectionService { | 159 class FakeDownloadProtectionService : public DownloadProtectionService { |
160 public: | 160 public: |
161 explicit FakeDownloadProtectionService( | 161 explicit FakeDownloadProtectionService( |
162 const SafeBrowsingTestConfiguration* test_config) | 162 const SafeBrowsingTestConfiguration* test_config) |
163 : DownloadProtectionService(nullptr), test_configuration_(test_config) {} | 163 : DownloadProtectionService(nullptr), test_configuration_(test_config) {} |
164 | 164 |
165 void CheckPPAPIDownloadRequest( | 165 void CheckPPAPIDownloadRequest( |
166 const GURL& requestor_url, | 166 const GURL& requestor_url, |
167 const base::FilePath& default_file_path, | 167 const base::FilePath& default_file_path, |
168 const std::vector<base::FilePath::StringType>& alternate_extensions, | 168 const std::vector<base::FilePath::StringType>& alternate_extensions, |
| 169 Profile* profile_unused, |
169 const CheckDownloadCallback& callback) override { | 170 const CheckDownloadCallback& callback) override { |
170 const auto iter = | 171 const auto iter = |
171 test_configuration_->result_map.find(default_file_path.Extension()); | 172 test_configuration_->result_map.find(default_file_path.Extension()); |
172 if (iter != test_configuration_->result_map.end()) { | 173 if (iter != test_configuration_->result_map.end()) { |
173 callback.Run(iter->second); | 174 callback.Run(iter->second); |
174 return; | 175 return; |
175 } | 176 } |
176 | 177 |
177 for (const auto extension : alternate_extensions) { | 178 for (const auto extension : alternate_extensions) { |
178 EXPECT_EQ(base::FilePath::kExtensionSeparator, extension[0]); | 179 EXPECT_EQ(base::FilePath::kExtensionSeparator, extension[0]); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 std::make_pair(base::FilePath::StringType(FILE_PATH_LITERAL(".exe")), | 406 std::make_pair(base::FilePath::StringType(FILE_PATH_LITERAL(".exe")), |
406 DownloadProtectionService::DANGEROUS)); | 407 DownloadProtectionService::DANGEROUS)); |
407 | 408 |
408 TestSelectFileDialogFactory test_dialog_factory( | 409 TestSelectFileDialogFactory test_dialog_factory( |
409 TestSelectFileDialogFactory::NOT_REACHED, | 410 TestSelectFileDialogFactory::NOT_REACHED, |
410 TestSelectFileDialogFactory::SelectedFileInfoList()); | 411 TestSelectFileDialogFactory::SelectedFileInfoList()); |
411 RunTestViaHTTP("FileChooser_SaveAsDangerousExtensionListDisallowed"); | 412 RunTestViaHTTP("FileChooser_SaveAsDangerousExtensionListDisallowed"); |
412 } | 413 } |
413 | 414 |
414 #endif // FULL_SAFE_BROWSING | 415 #endif // FULL_SAFE_BROWSING |
OLD | NEW |