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 "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 download_manager_->RemoveObserver(this); | 608 download_manager_->RemoveObserver(this); |
609 } | 609 } |
610 | 610 |
611 // DownloadManager::Observer | 611 // DownloadManager::Observer |
612 virtual void ModelChanged() { | 612 virtual void ModelChanged() { |
613 std::vector<DownloadItem*> downloads; | 613 std::vector<DownloadItem*> downloads; |
614 download_manager_->SearchDownloads(string16(), &downloads); | 614 download_manager_->SearchDownloads(string16(), &downloads); |
615 | 615 |
616 for (std::vector<DownloadItem*>::iterator it = downloads.begin(); | 616 for (std::vector<DownloadItem*>::iterator it = downloads.begin(); |
617 it != downloads.end(); ++it) { | 617 it != downloads.end(); ++it) { |
618 (*it)->TestMockDownloadOpen(); | 618 (*it)->MockDownloadOpenForTesting(); |
619 } | 619 } |
620 } | 620 } |
621 | 621 |
622 private: | 622 private: |
623 DownloadManager* download_manager_; | 623 DownloadManager* download_manager_; |
624 | 624 |
625 DISALLOW_COPY_AND_ASSIGN(MockDownloadOpeningObserver); | 625 DISALLOW_COPY_AND_ASSIGN(MockDownloadOpeningObserver); |
626 }; | 626 }; |
627 | 627 |
628 class DownloadTest : public InProcessBrowserTest { | 628 class DownloadTest : public InProcessBrowserTest { |
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1786 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen()); | 1786 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen()); |
1787 | 1787 |
1788 // Download shelf should close. Download panel stays open on ChromeOS. | 1788 // Download shelf should close. Download panel stays open on ChromeOS. |
1789 CheckDownloadUI(browser(), false, true, FilePath()); | 1789 CheckDownloadUI(browser(), false, true, FilePath()); |
1790 | 1790 |
1791 // Check that the extension was installed. | 1791 // Check that the extension was installed. |
1792 ExtensionService* extension_service = | 1792 ExtensionService* extension_service = |
1793 browser()->profile()->GetExtensionService(); | 1793 browser()->profile()->GetExtensionService(); |
1794 ASSERT_TRUE(extension_service->GetExtensionById(kLargeThemeCrxId, false)); | 1794 ASSERT_TRUE(extension_service->GetExtensionById(kLargeThemeCrxId, false)); |
1795 } | 1795 } |
OLD | NEW |