OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
783 // If it's not where we asked it to be, it should be in the | 783 // If it's not where we asked it to be, it should be in the |
784 // My Documents folder. | 784 // My Documents folder. |
785 FilePath my_docs_folder; | 785 FilePath my_docs_folder; |
786 EXPECT_TRUE(PathService::Get(chrome::DIR_USER_DOCUMENTS, | 786 EXPECT_TRUE(PathService::Get(chrome::DIR_USER_DOCUMENTS, |
787 &my_docs_folder)); | 787 &my_docs_folder)); |
788 EXPECT_EQ(0u, | 788 EXPECT_EQ(0u, |
789 my_downloaded_file.value().find(my_docs_folder.value())); | 789 my_downloaded_file.value().find(my_docs_folder.value())); |
790 } | 790 } |
791 } | 791 } |
792 } | 792 } |
793 | |
794 MessageLoop::current()->PostDelayedTask( | |
sky
2012/04/04 16:55:34
Don't post tasks of arbitrary length. It makes for
ahendrickson
2012/04/04 17:49:32
Oh, sorry, I intended to remove this. It was only
| |
795 FROM_HERE, | |
796 base::Bind(&MessageLoop::Quit, | |
797 base::Unretained(MessageLoop::current())), | |
798 5000); | |
799 | |
800 ui_test_utils::RunMessageLoop(); | |
793 } | 801 } |
794 | 802 |
795 // Attempts to download a set of files, based on information in the | 803 // Attempts to download a set of files, based on information in the |
796 // |download_info| array. |count| is the number of files. | 804 // |download_info| array. |count| is the number of files. |
797 // If a Select File dialog appears, it will choose the default and return | 805 // If a Select File dialog appears, it will choose the default and return |
798 // immediately. | 806 // immediately. |
799 void DownloadFilesCheckErrors(size_t count, DownloadInfo* download_info) { | 807 void DownloadFilesCheckErrors(size_t count, DownloadInfo* download_info) { |
800 DownloadFilesCheckErrorsSetup(); | 808 DownloadFilesCheckErrorsSetup(); |
801 | 809 |
802 for (size_t i = 0; i < count; ++i) { | 810 for (size_t i = 0; i < count; ++i) { |
(...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2517 downloads.clear(); | 2525 downloads.clear(); |
2518 GetDownloads(browser(), &downloads); | 2526 GetDownloads(browser(), &downloads); |
2519 EXPECT_EQ(0u, downloads.size()); | 2527 EXPECT_EQ(0u, downloads.size()); |
2520 | 2528 |
2521 if (creation_observer->succeeded()) { | 2529 if (creation_observer->succeeded()) { |
2522 // Wait until the download is done. We don't care how it's finished. | 2530 // Wait until the download is done. We don't care how it's finished. |
2523 backup_observer.WaitForFinished(); | 2531 backup_observer.WaitForFinished(); |
2524 } | 2532 } |
2525 DownloadManagerForBrowser(browser())->RemoveAllDownloads(); | 2533 DownloadManagerForBrowser(browser())->RemoveAllDownloads(); |
2526 } | 2534 } |
OLD | NEW |