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

Side by Side Diff: chrome/browser/ui/panels/panel_browsertest.cc

Issue 7796014: Make cancel remove cancelled download from active queues at time of cancel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Final Cancel arg fix. Created 9 years, 3 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/prefs/pref_service.h" 5 #include "chrome/browser/prefs/pref_service.h"
6 #include "chrome/browser/profiles/profile.h" 6 #include "chrome/browser/profiles/profile.h"
7 #include "chrome/browser/ui/browser_list.h" 7 #include "chrome/browser/ui/browser_list.h"
8 #include "chrome/browser/ui/browser_window.h" 8 #include "chrome/browser/ui/browser_window.h"
9 #include "chrome/browser/ui/find_bar/find_bar.h" 9 #include "chrome/browser/ui/find_bar/find_bar.h"
10 #include "chrome/browser/ui/find_bar/find_bar_controller.h" 10 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 } 667 }
668 668
669 // DownloadManager::Observer 669 // DownloadManager::Observer
670 virtual void ModelChanged() { 670 virtual void ModelChanged() {
671 std::vector<DownloadItem*> downloads; 671 std::vector<DownloadItem*> downloads;
672 download_manager_->SearchDownloads(string16(), &downloads); 672 download_manager_->SearchDownloads(string16(), &downloads);
673 if (downloads.empty()) 673 if (downloads.empty())
674 return; 674 return;
675 675
676 EXPECT_EQ(1U, downloads.size()); 676 EXPECT_EQ(1U, downloads.size());
677 downloads.front()->Cancel(false); // Don't actually need to download it. 677 downloads.front()->Cancel(); // Don't actually need to download it.
678 678
679 saw_download_ = true; 679 saw_download_ = true;
680 EXPECT_TRUE(waiting_); 680 EXPECT_TRUE(waiting_);
681 MessageLoopForUI::current()->Quit(); 681 MessageLoopForUI::current()->Quit();
682 } 682 }
683 683
684 private: 684 private:
685 DownloadManager* download_manager_; 685 DownloadManager* download_manager_;
686 bool saw_download_; 686 bool saw_download_;
687 bool waiting_; 687 bool waiting_;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 EXPECT_EQ(1, tabbed_browser->tab_count()); 780 EXPECT_EQ(1, tabbed_browser->tab_count());
781 ASSERT_TRUE(tabbed_browser->window()->IsDownloadShelfVisible()); 781 ASSERT_TRUE(tabbed_browser->window()->IsDownloadShelfVisible());
782 tabbed_browser->CloseWindow(); 782 tabbed_browser->CloseWindow();
783 #endif 783 #endif
784 784
785 EXPECT_EQ(1, panel_browser->tab_count()); 785 EXPECT_EQ(1, panel_browser->tab_count());
786 ASSERT_FALSE(panel_browser->window()->IsDownloadShelfVisible()); 786 ASSERT_FALSE(panel_browser->window()->IsDownloadShelfVisible());
787 787
788 panel_browser->CloseWindow(); 788 panel_browser->CloseWindow();
789 } 789 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698