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/file_path.h" | 5 #include "base/file_path.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
(...skipping 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 browser()->profile()->GetDownloadManager()->SearchDownloads( | 1567 browser()->profile()->GetDownloadManager()->SearchDownloads( |
1568 string16(), &downloads); | 1568 string16(), &downloads); |
1569 ASSERT_EQ(1u, downloads.size()); | 1569 ASSERT_EQ(1u, downloads.size()); |
1570 EXPECT_EQ(DownloadItem::COMPLETE, downloads[0]->state()); | 1570 EXPECT_EQ(DownloadItem::COMPLETE, downloads[0]->state()); |
1571 EXPECT_TRUE(downloads[0]->opened()); | 1571 EXPECT_TRUE(downloads[0]->opened()); |
1572 | 1572 |
1573 // As long as we're here, confirmed everything else is good. | 1573 // As long as we're here, confirmed everything else is good. |
1574 EXPECT_EQ(1, browser()->tab_count()); | 1574 EXPECT_EQ(1, browser()->tab_count()); |
1575 CheckDownload(browser(), file, file); | 1575 CheckDownload(browser(), file, file); |
1576 // Download shelf should close. Download panel stays open on ChromeOS. | 1576 // Download shelf should close. Download panel stays open on ChromeOS. |
1577 CheckDownloadUI(browser(), false, true, file); | 1577 CheckDownloadUI(browser(), false, true, FilePath()); |
1578 } | 1578 } |
1579 | 1579 |
1580 // Download an extension. Expect a dangerous download warning. | 1580 // Download an extension. Expect a dangerous download warning. |
1581 // Deny the download. | 1581 // Deny the download. |
1582 IN_PROC_BROWSER_TEST_F(DownloadTest, CrxDenyInstall) { | 1582 IN_PROC_BROWSER_TEST_F(DownloadTest, CrxDenyInstall) { |
1583 ASSERT_TRUE(InitialSetup(false)); | 1583 ASSERT_TRUE(InitialSetup(false)); |
1584 GURL extension_url(URLRequestMockHTTPJob::GetMockUrl(kGoodCrxPath)); | 1584 GURL extension_url(URLRequestMockHTTPJob::GetMockUrl(kGoodCrxPath)); |
1585 | 1585 |
1586 scoped_ptr<DownloadsObserver> observer( | 1586 scoped_ptr<DownloadsObserver> observer( |
1587 DangerousInstallWaiter(browser(), | 1587 DangerousInstallWaiter(browser(), |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1710 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen()); | 1710 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen()); |
1711 | 1711 |
1712 // Download shelf should close. Download panel stays open on ChromeOS. | 1712 // Download shelf should close. Download panel stays open on ChromeOS. |
1713 CheckDownloadUI(browser(), false, true, FilePath()); | 1713 CheckDownloadUI(browser(), false, true, FilePath()); |
1714 | 1714 |
1715 // Check that the extension was installed. | 1715 // Check that the extension was installed. |
1716 ExtensionService* extension_service = | 1716 ExtensionService* extension_service = |
1717 browser()->profile()->GetExtensionService(); | 1717 browser()->profile()->GetExtensionService(); |
1718 ASSERT_TRUE(extension_service->GetExtensionById(kLargeThemeCrxId, false)); | 1718 ASSERT_TRUE(extension_service->GetExtensionById(kLargeThemeCrxId, false)); |
1719 } | 1719 } |
OLD | NEW |