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_manager.h" | 10 #include "chrome/browser/download/download_manager.h" |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 PrefService* prefs = profile_->GetPrefs(); | 678 PrefService* prefs = profile_->GetPrefs(); |
679 prefs->SetFilePath(prefs::kDownloadDefaultDirectory, FilePath()); | 679 prefs->SetFilePath(prefs::kDownloadDefaultDirectory, FilePath()); |
680 download_manager_->OpenFilesBasedOnExtension( | 680 download_manager_->OpenFilesBasedOnExtension( |
681 FilePath(FILE_PATH_LITERAL("example.pdf")), true); | 681 FilePath(FILE_PATH_LITERAL("example.pdf")), true); |
682 | 682 |
683 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kStartDownloadCases); ++i) { | 683 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kStartDownloadCases); ++i) { |
684 prefs->SetBoolean(prefs::kPromptForDownload, | 684 prefs->SetBoolean(prefs::kPromptForDownload, |
685 kStartDownloadCases[i].prompt_for_download); | 685 kStartDownloadCases[i].prompt_for_download); |
686 | 686 |
687 DownloadCreateInfo info; | 687 DownloadCreateInfo info; |
688 info.save_as = kStartDownloadCases[i].save_as; | 688 info.prompt_user_for_save_location = kStartDownloadCases[i].save_as; |
689 info.url = GURL(kStartDownloadCases[i].url); | 689 info.url = GURL(kStartDownloadCases[i].url); |
690 info.mime_type = kStartDownloadCases[i].mime_type; | 690 info.mime_type = kStartDownloadCases[i].mime_type; |
691 | 691 |
692 download_manager_->StartDownload(&info); | 692 download_manager_->StartDownload(&info); |
693 | 693 |
694 EXPECT_EQ(kStartDownloadCases[i].expected_save_as, info.save_as); | 694 EXPECT_EQ(kStartDownloadCases[i].expected_save_as, |
| 695 info.prompt_user_for_save_location); |
695 } | 696 } |
696 } | 697 } |
OLD | NEW |