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

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

Issue 26938003: Don't prompt to save malicious downloads on exit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed unneeded code Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/browser/download/download_item_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 return new content::DownloadTestObserverInProgress( 696 return new content::DownloadTestObserverInProgress(
697 manager, download_count); 697 manager, download_count);
698 } 698 }
699 699
700 DownloadItem* CreateSlowTestDownload() { 700 DownloadItem* CreateSlowTestDownload() {
701 scoped_ptr<content::DownloadTestObserver> observer( 701 scoped_ptr<content::DownloadTestObserver> observer(
702 CreateInProgressDownloadObserver(1)); 702 CreateInProgressDownloadObserver(1));
703 GURL slow_download_url(URLRequestSlowDownloadJob::kUnknownSizeUrl); 703 GURL slow_download_url(URLRequestSlowDownloadJob::kUnknownSizeUrl);
704 DownloadManager* manager = DownloadManagerForBrowser(browser()); 704 DownloadManager* manager = DownloadManagerForBrowser(browser());
705 705
706 EXPECT_EQ(0, manager->NonMaliciousInProgressCount());
706 EXPECT_EQ(0, manager->InProgressCount()); 707 EXPECT_EQ(0, manager->InProgressCount());
707 if (manager->InProgressCount() != 0) 708 if (manager->InProgressCount() != 0)
708 return NULL; 709 return NULL;
709 710
710 ui_test_utils::NavigateToURLWithDisposition( 711 ui_test_utils::NavigateToURLWithDisposition(
711 browser(), slow_download_url, CURRENT_TAB, 712 browser(), slow_download_url, CURRENT_TAB,
712 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); 713 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
713 714
714 observer->WaitForFinished(); 715 observer->WaitForFinished();
715 EXPECT_EQ(1u, observer->NumDownloadsSeenInState(DownloadItem::IN_PROGRESS)); 716 EXPECT_EQ(1u, observer->NumDownloadsSeenInState(DownloadItem::IN_PROGRESS));
(...skipping 2526 matching lines...) Expand 10 before | Expand all | Expand 10 after
3242 3243
3243 // No errors this time. The download should complete successfully. 3244 // No errors this time. The download should complete successfully.
3244 EXPECT_FALSE(completion_observer->IsFinished()); 3245 EXPECT_FALSE(completion_observer->IsFinished());
3245 completion_observer->StartObserving(); 3246 completion_observer->StartObserving();
3246 download->Resume(); 3247 download->Resume();
3247 completion_observer->WaitForFinished(); 3248 completion_observer->WaitForFinished();
3248 EXPECT_EQ(DownloadItem::COMPLETE, download->GetState()); 3249 EXPECT_EQ(DownloadItem::COMPLETE, download->GetState());
3249 3250
3250 EXPECT_FALSE(DidShowFileChooser()); 3251 EXPECT_FALSE(DidShowFileChooser());
3251 } 3252 }
OLDNEW
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/browser/download/download_item_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698