OLD | NEW |
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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "chrome/browser/net/url_request_mock_util.h" | 6 #include "chrome/browser/net/url_request_mock_util.h" |
7 #include "chrome/browser/prefs/pref_service.h" | 7 #include "chrome/browser/prefs/pref_service.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/browser_list.h" | 9 #include "chrome/browser/ui/browser_list.h" |
10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 } | 894 } |
895 | 895 |
896 // DownloadManager::Observer | 896 // DownloadManager::Observer |
897 virtual void ModelChanged() { | 897 virtual void ModelChanged() { |
898 std::vector<DownloadItem*> downloads; | 898 std::vector<DownloadItem*> downloads; |
899 download_manager_->SearchDownloads(string16(), &downloads); | 899 download_manager_->SearchDownloads(string16(), &downloads); |
900 if (downloads.empty()) | 900 if (downloads.empty()) |
901 return; | 901 return; |
902 | 902 |
903 EXPECT_EQ(1U, downloads.size()); | 903 EXPECT_EQ(1U, downloads.size()); |
904 downloads.front()->Cancel(); // Don't actually need to download it. | 904 downloads.front()->Cancel(false); // Don't actually need to download it. |
905 | 905 |
906 saw_download_ = true; | 906 saw_download_ = true; |
907 EXPECT_TRUE(waiting_); | 907 EXPECT_TRUE(waiting_); |
908 MessageLoopForUI::current()->Quit(); | 908 MessageLoopForUI::current()->Quit(); |
909 } | 909 } |
910 | 910 |
911 private: | 911 private: |
912 DownloadManager* download_manager_; | 912 DownloadManager* download_manager_; |
913 bool saw_download_; | 913 bool saw_download_; |
914 bool waiting_; | 914 bool waiting_; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 EXPECT_EQ(1, tabbed_browser->tab_count()); | 1007 EXPECT_EQ(1, tabbed_browser->tab_count()); |
1008 ASSERT_TRUE(tabbed_browser->window()->IsDownloadShelfVisible()); | 1008 ASSERT_TRUE(tabbed_browser->window()->IsDownloadShelfVisible()); |
1009 tabbed_browser->CloseWindow(); | 1009 tabbed_browser->CloseWindow(); |
1010 #endif | 1010 #endif |
1011 | 1011 |
1012 EXPECT_EQ(1, panel_browser->tab_count()); | 1012 EXPECT_EQ(1, panel_browser->tab_count()); |
1013 ASSERT_FALSE(panel_browser->window()->IsDownloadShelfVisible()); | 1013 ASSERT_FALSE(panel_browser->window()->IsDownloadShelfVisible()); |
1014 | 1014 |
1015 panel_browser->CloseWindow(); | 1015 panel_browser->CloseWindow(); |
1016 } | 1016 } |
OLD | NEW |