Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: chrome/browser/download/download_browsertest.cc

Issue 2890853002: Downloads: replace BrowserThread::FILE with task scheduler. (Closed)
Patch Set: Add scoped COM initialization to quench a couple of assertion failures. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "chrome/browser/download/download_browsertest.h" 5 #include "chrome/browser/download/download_browsertest.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 downloads_expected++; 909 downloads_expected++;
910 observer->WaitForFinished(); 910 observer->WaitForFinished();
911 DownloadItem::DownloadState final_state = 911 DownloadItem::DownloadState final_state =
912 (download_info.reason == content::DOWNLOAD_INTERRUPT_REASON_NONE) ? 912 (download_info.reason == content::DOWNLOAD_INTERRUPT_REASON_NONE) ?
913 DownloadItem::COMPLETE : 913 DownloadItem::COMPLETE :
914 DownloadItem::INTERRUPTED; 914 DownloadItem::INTERRUPTED;
915 EXPECT_EQ(1u, observer->NumDownloadsSeenInState(final_state)); 915 EXPECT_EQ(1u, observer->NumDownloadsSeenInState(final_state));
916 } 916 }
917 917
918 // Wait till the |DownloadFile|s are destroyed. 918 // Wait till the |DownloadFile|s are destroyed.
919 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE); 919 content::RunAllBlockingPoolTasksUntilIdle();
920 content::RunAllPendingInMessageLoop(content::BrowserThread::UI); 920 content::RunAllPendingInMessageLoop(content::BrowserThread::UI);
gab 2017/07/20 16:54:31 Can remove this line too as RunAllBlockingPoolTask
Sigurður Ásgeirsson 2017/07/20 17:23:21 Done.
921 921
922 // Validate that the correct files were downloaded. 922 // Validate that the correct files were downloaded.
923 download_items.clear(); 923 download_items.clear();
924 GetDownloads(browser(), &download_items); 924 GetDownloads(browser(), &download_items);
925 ASSERT_EQ(downloads_expected, download_items.size()); 925 ASSERT_EQ(downloads_expected, download_items.size());
926 926
927 if (download_info.show_download_item) { 927 if (download_info.show_download_item) {
928 // Find the last download item. 928 // Find the last download item.
929 DownloadItem* item = download_items[0]; 929 DownloadItem* item = download_items[0];
930 for (size_t d = 1; d < downloads_expected; ++d) { 930 for (size_t d = 1; d < downloads_expected; ++d) {
(...skipping 2946 matching lines...) Expand 10 before | Expand all | Expand 10 after
3877 browser(), 1, 3877 browser(), 1,
3878 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY)); 3878 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY));
3879 ui_test_utils::NavigateToURL(browser(), extension_url); 3879 ui_test_utils::NavigateToURL(browser(), extension_url);
3880 3880
3881 observer->WaitForFinished(); 3881 observer->WaitForFinished();
3882 3882
3883 // Download shelf should close. 3883 // Download shelf should close.
3884 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); 3884 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible());
3885 } 3885 }
3886 #endif // defined(OS_CHROMEOS) 3886 #endif // defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/download_prefs.cc » ('j') | content/browser/download/base_file.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698