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

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

Issue 7245013: Checking that items exist in the downloads panel on ChromeOS. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 | « no previous file | no next file » | 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) 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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 } 601 }
602 602
603 // Create a DownloadsObserver that will wait for the 603 // Create a DownloadsObserver that will wait for the
604 // specified number of downloads to finish, or for 604 // specified number of downloads to finish, or for
605 // a dangerous download warning to be shown. 605 // a dangerous download warning to be shown.
606 DownloadsObserver* DangerousInstallWaiter( 606 DownloadsObserver* DangerousInstallWaiter(
607 Browser* browser, 607 Browser* browser,
608 int num_downloads, 608 int num_downloads,
609 DownloadItem::DownloadState final_state, 609 DownloadItem::DownloadState final_state,
610 DangerousDownloadAction dangerous_download_action) { 610 DangerousDownloadAction dangerous_download_action) {
611
achuithb 2011/06/24 00:10:06 Fix lint error.
612 DownloadManager* download_manager = 611 DownloadManager* download_manager =
613 browser->profile()->GetDownloadManager(); 612 browser->profile()->GetDownloadManager();
614 return new DownloadsObserver( 613 return new DownloadsObserver(
615 download_manager, num_downloads, 614 download_manager, num_downloads,
616 final_state, 615 final_state,
617 true, // Bail on select file 616 true, // Bail on select file
618 dangerous_download_action); 617 dangerous_download_action);
619 } 618 }
620 619
621 // Download |url|, then wait for the download to finish. 620 // Download |url|, then wait for the download to finish.
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 EXPECT_EQ(2, browser->tab_count()); 749 EXPECT_EQ(2, browser->tab_count());
751 750
752 // TODO(ahendrickson): check download status text after downloading. 751 // TODO(ahendrickson): check download status text after downloading.
753 752
754 // Make sure the download shelf is showing. 753 // Make sure the download shelf is showing.
755 CheckDownloadUIVisible(browser, true, true); 754 CheckDownloadUIVisible(browser, true, true);
756 755
757 FilePath basefilename(filename.BaseName()); 756 FilePath basefilename(filename.BaseName());
758 net::FileURLToFilePath(url, &filename); 757 net::FileURLToFilePath(url, &filename);
759 FilePath download_path = downloads_directory_.path().Append(basefilename); 758 FilePath download_path = downloads_directory_.path().Append(basefilename);
759 CheckDownloadExistsInUI(browser, basefilename);
760 760
761 bool downloaded_path_exists = file_util::PathExists(download_path); 761 bool downloaded_path_exists = file_util::PathExists(download_path);
762 EXPECT_TRUE(downloaded_path_exists); 762 EXPECT_TRUE(downloaded_path_exists);
763 if (!downloaded_path_exists) 763 if (!downloaded_path_exists)
764 return false; 764 return false;
765 765
766 // Delete the file we just downloaded. 766 // Delete the file we just downloaded.
767 EXPECT_TRUE(file_util::DieFileDie(download_path, true)); 767 EXPECT_TRUE(file_util::DieFileDie(download_path, true));
768 EXPECT_FALSE(file_util::PathExists(download_path)); 768 EXPECT_FALSE(file_util::PathExists(download_path));
769 769
770 return true; 770 return true;
771 } 771 }
772 772
773 void GetDownloads(Browser* browser, std::vector<DownloadItem*>* downloads) { 773 void GetDownloads(Browser* browser, std::vector<DownloadItem*>* downloads) {
774 DCHECK(downloads); 774 DCHECK(downloads);
775 DownloadManager* manager = browser->profile()->GetDownloadManager(); 775 DownloadManager* manager = browser->profile()->GetDownloadManager();
776 manager->SearchDownloads(string16(), downloads); 776 manager->SearchDownloads(string16(), downloads);
777 } 777 }
778 778
779 void CheckDownloadExistsInUI(Browser* browser,
780 const FilePath& file_path) {
781 #if defined(OS_CHROMEOS)
782 Browser* popup = ActiveDownloadsUI::GetPopup(browser->profile());
783 DCHECK(popup);
Paweł Hajdan Jr. 2011/06/24 08:36:33 No DCHECKs in test code. They crash the entire thi
achuithb 2011/06/24 21:08:53 Done.
784 ActiveDownloadsUI* downloads_ui = static_cast<ActiveDownloadsUI*>(
785 popup->GetSelectedTabContents()->web_ui());
786 DCHECK(downloads_ui);
787 const ActiveDownloadsUI::DownloadList& downloads =
788 downloads_ui->GetDownloads();
789 EXPECT_EQ(downloads.size(), size_t(1));
Paweł Hajdan Jr. 2011/06/24 08:36:33 nit: 1U instead of size_t(1).
achuithb 2011/06/24 21:08:53 Done.
790
791 FilePath download_path;
792 FilePath full_path(DestinationFile(browser, file_path));
793 for (size_t i = 0; i < downloads.size(); ++i) {
794 if (downloads[i]->full_path() == full_path) {
795 download_path = full_path;
796 break;
797 }
798 }
799 EXPECT_EQ(full_path, download_path);
800 #endif
Paweł Hajdan Jr. 2011/06/24 08:36:33 nit: // defined(OS_CHROMEOS)
achuithb 2011/06/24 21:08:53 There's now also an else clause for non-chromeos.
801 }
802
779 // Figure out if the appropriate download visibility was done. A 803 // Figure out if the appropriate download visibility was done. A
780 // utility function to support ChromeOS variations. 804 // utility function to support ChromeOS variations.
781 static void CheckDownloadUIVisible(Browser* browser, 805 static void CheckDownloadUIVisible(Browser* browser,
782 bool expected_non_chromeos, 806 bool expected_non_chromeos,
783 bool expected_chromeos) { 807 bool expected_chromeos) {
784 #if defined(OS_CHROMEOS) 808 #if defined(OS_CHROMEOS)
785 EXPECT_EQ(expected_chromeos, 809 EXPECT_EQ(expected_chromeos,
786 NULL != ActiveDownloadsUI::GetPopup(browser->profile())); 810 NULL != ActiveDownloadsUI::GetPopup(browser->profile()));
787 #else 811 #else
788 EXPECT_EQ(expected_non_chromeos, 812 EXPECT_EQ(expected_non_chromeos,
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); 957 FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
934 GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); 958 GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
935 959
936 // Download the file and wait. We do not expect the Select File dialog. 960 // Download the file and wait. We do not expect the Select File dialog.
937 DownloadAndWait(browser(), url, EXPECT_NO_SELECT_DIALOG); 961 DownloadAndWait(browser(), url, EXPECT_NO_SELECT_DIALOG);
938 962
939 // Check state. 963 // Check state.
940 EXPECT_EQ(1, browser()->tab_count()); 964 EXPECT_EQ(1, browser()->tab_count());
941 CheckDownload(browser(), file, file); 965 CheckDownload(browser(), file, file);
942 CheckDownloadUIVisible(browser(), true, true); 966 CheckDownloadUIVisible(browser(), true, true);
967 CheckDownloadExistsInUI(browser(), file);
943 } 968 }
944 969
945 #if defined(OS_WIN) 970 #if defined(OS_WIN)
946 // Download a file and confirm that the zone identifier (on windows) 971 // Download a file and confirm that the zone identifier (on windows)
947 // is set to internet. 972 // is set to internet.
948 IN_PROC_BROWSER_TEST_F(DownloadTest, CheckInternetZone) { 973 IN_PROC_BROWSER_TEST_F(DownloadTest, CheckInternetZone) {
949 ASSERT_TRUE(InitialSetup(false)); 974 ASSERT_TRUE(InitialSetup(false));
950 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); 975 FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
951 GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); 976 GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
952 977
953 // Download the file and wait. We do not expect the Select File dialog. 978 // Download the file and wait. We do not expect the Select File dialog.
954 DownloadAndWait(browser(), url, EXPECT_NO_SELECT_DIALOG); 979 DownloadAndWait(browser(), url, EXPECT_NO_SELECT_DIALOG);
955 980
956 // Check state. Special file state must be checked before CheckDownload, 981 // Check state. Special file state must be checked before CheckDownload,
957 // as CheckDownload will delete the output file. 982 // as CheckDownload will delete the output file.
958 EXPECT_EQ(1, browser()->tab_count()); 983 EXPECT_EQ(1, browser()->tab_count());
959 FilePath downloaded_file(DestinationFile(browser(), file)); 984 FilePath downloaded_file(DestinationFile(browser(), file));
960 if (file_util::VolumeSupportsADS(downloaded_file)) 985 if (file_util::VolumeSupportsADS(downloaded_file))
961 EXPECT_TRUE(file_util::HasInternetZoneIdentifier(downloaded_file)); 986 EXPECT_TRUE(file_util::HasInternetZoneIdentifier(downloaded_file));
962 CheckDownload(browser(), file, file); 987 CheckDownload(browser(), file, file);
963 CheckDownloadUIVisible(browser(), true, true); 988 CheckDownloadUIVisible(browser(), true, true);
989 CheckDownloadExistsInUI(browser(), file);
964 } 990 }
965 #endif 991 #endif
966 992
967 // Put up a Select File dialog when the file is downloaded, due to its MIME 993 // Put up a Select File dialog when the file is downloaded, due to its MIME
968 // type. 994 // type.
969 // 995 //
970 // This test runs correctly, but leaves behind turds in the test user's 996 // This test runs correctly, but leaves behind turds in the test user's
971 // download directory because of http://crbug.com/62099. No big loss; it 997 // download directory because of http://crbug.com/62099. No big loss; it
972 // was primarily confirming DownloadsObserver wait on select file dialog 998 // was primarily confirming DownloadsObserver wait on select file dialog
973 // functionality anyway. 999 // functionality anyway.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 FilePath download_file(FILE_PATH_LITERAL("download-test3-attachment.gif")); 1043 FilePath download_file(FILE_PATH_LITERAL("download-test3-attachment.gif"));
1018 1044
1019 // Download a file and wait. 1045 // Download a file and wait.
1020 DownloadAndWait(browser(), url, EXPECT_NO_SELECT_DIALOG); 1046 DownloadAndWait(browser(), url, EXPECT_NO_SELECT_DIALOG);
1021 1047
1022 CheckDownload(browser(), download_file, file); 1048 CheckDownload(browser(), download_file, file);
1023 1049
1024 // Check state. 1050 // Check state.
1025 EXPECT_EQ(1, browser()->tab_count()); 1051 EXPECT_EQ(1, browser()->tab_count());
1026 CheckDownloadUIVisible(browser(), true, true); 1052 CheckDownloadUIVisible(browser(), true, true);
1053 CheckDownloadExistsInUI(browser(), download_file);
1027 } 1054 }
1028 1055
1029 #if !defined(OS_CHROMEOS) // Download shelf is not per-window on ChromeOS. 1056 #if !defined(OS_CHROMEOS) // Download shelf is not per-window on ChromeOS.
1030 // Test that the download shelf is per-window by starting a download in one 1057 // Test that the download shelf is per-window by starting a download in one
1031 // tab, opening a second tab, closing the shelf, going back to the first tab, 1058 // tab, opening a second tab, closing the shelf, going back to the first tab,
1032 // and checking that the shelf is closed. 1059 // and checking that the shelf is closed.
1033 IN_PROC_BROWSER_TEST_F(DownloadTest, PerWindowShelf) { 1060 IN_PROC_BROWSER_TEST_F(DownloadTest, PerWindowShelf) {
1034 ASSERT_TRUE(InitialSetup(false)); 1061 ASSERT_TRUE(InitialSetup(false));
1035 FilePath file(FILE_PATH_LITERAL("download-test3.gif")); 1062 FilePath file(FILE_PATH_LITERAL("download-test3.gif"));
1036 GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); 1063 GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
1037 FilePath download_file(FILE_PATH_LITERAL("download-test3-attachment.gif")); 1064 FilePath download_file(FILE_PATH_LITERAL("download-test3-attachment.gif"));
1038 1065
1039 // Download a file and wait. 1066 // Download a file and wait.
1040 DownloadAndWait(browser(), url, EXPECT_NO_SELECT_DIALOG); 1067 DownloadAndWait(browser(), url, EXPECT_NO_SELECT_DIALOG);
1041 1068
1042 CheckDownload(browser(), download_file, file); 1069 CheckDownload(browser(), download_file, file);
1043 1070
1044 // Check state. 1071 // Check state.
1045 EXPECT_EQ(1, browser()->tab_count()); 1072 EXPECT_EQ(1, browser()->tab_count());
1046 CheckDownloadUIVisible(browser(), true, true); 1073 CheckDownloadUIVisible(browser(), true, true);
1074 CheckDownloadExistsInUI(browser(), download_file);
1047 1075
1048 // Open a second tab and wait. 1076 // Open a second tab and wait.
1049 EXPECT_NE(static_cast<TabContentsWrapper*>(NULL), 1077 EXPECT_NE(static_cast<TabContentsWrapper*>(NULL),
1050 browser()->AddSelectedTabWithURL(GURL(), PageTransition::TYPED)); 1078 browser()->AddSelectedTabWithURL(GURL(), PageTransition::TYPED));
1051 EXPECT_EQ(2, browser()->tab_count()); 1079 EXPECT_EQ(2, browser()->tab_count());
1052 CheckDownloadUIVisible(browser(), true, true); 1080 CheckDownloadUIVisible(browser(), true, true);
1081 CheckDownloadExistsInUI(browser(), download_file);
1053 1082
1054 // Hide the download shelf. 1083 // Hide the download shelf.
1055 browser()->window()->GetDownloadShelf()->Close(); 1084 browser()->window()->GetDownloadShelf()->Close();
1056 CheckDownloadUIVisible(browser(), false, false); 1085 CheckDownloadUIVisible(browser(), false, false);
1057 1086
1058 // Go to the first tab. 1087 // Go to the first tab.
1059 browser()->ActivateTabAt(0, true); 1088 browser()->ActivateTabAt(0, true);
1060 EXPECT_EQ(2, browser()->tab_count()); 1089 EXPECT_EQ(2, browser()->tab_count());
1061 1090
1062 // The download shelf should not be visible. 1091 // The download shelf should not be visible.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 // Since |incognito| is a separate browser, we have to set it up explicitly. 1131 // Since |incognito| is a separate browser, we have to set it up explicitly.
1103 incognito->profile()->GetPrefs()->SetBoolean(prefs::kPromptForDownload, 1132 incognito->profile()->GetPrefs()->SetBoolean(prefs::kPromptForDownload,
1104 false); 1133 false);
1105 DownloadAndWait(incognito, url, EXPECT_NO_SELECT_DIALOG); 1134 DownloadAndWait(incognito, url, EXPECT_NO_SELECT_DIALOG);
1106 1135
1107 // We should still have 2 windows. 1136 // We should still have 2 windows.
1108 ExpectWindowCountAfterDownload(2); 1137 ExpectWindowCountAfterDownload(2);
1109 1138
1110 // Verify that the download shelf is showing for the Incognito window. 1139 // Verify that the download shelf is showing for the Incognito window.
1111 CheckDownloadUIVisible(incognito, true, true); 1140 CheckDownloadUIVisible(incognito, true, true);
1141 CheckDownloadExistsInUI(incognito, file);
1112 1142
1113 #if !defined(OS_MACOSX) 1143 #if !defined(OS_MACOSX)
1114 // On Mac OS X, the UI window close is delayed until the outermost 1144 // On Mac OS X, the UI window close is delayed until the outermost
1115 // message loop runs. So it isn't possible to get a BROWSER_CLOSED 1145 // message loop runs. So it isn't possible to get a BROWSER_CLOSED
1116 // notification inside of a test. 1146 // notification inside of a test.
1117 ui_test_utils::WindowedNotificationObserver signal( 1147 ui_test_utils::WindowedNotificationObserver signal(
1118 NotificationType::BROWSER_CLOSED, 1148 NotificationType::BROWSER_CLOSED,
1119 Source<Browser>(incognito)); 1149 Source<Browser>(incognito));
1120 #endif 1150 #endif
1121 1151
1122 // Close the Incognito window and don't crash. 1152 // Close the Incognito window and don't crash.
1123 incognito->CloseWindow(); 1153 incognito->CloseWindow();
1124 1154
1125 #if !defined(OS_MACOSX) 1155 #if !defined(OS_MACOSX)
1126 signal.Wait(); 1156 signal.Wait();
1127 ExpectWindowCountAfterDownload(1); 1157 ExpectWindowCountAfterDownload(1);
1128 #endif 1158 #endif
1129 1159
1130 // Verify that the regular window does not have a download shelf. 1160 // Verify that the regular window does not have a download shelf.
1131 // On ChromeOS, the download panel is common to both profiles, so 1161 // On ChromeOS, the download panel is common to both profiles, so
1132 // it is still visible. 1162 // it is still visible.
1133 CheckDownloadUIVisible(browser(), false, true); 1163 CheckDownloadUIVisible(browser(), false, true);
1164 CheckDownloadExistsInUI(browser(), file);
1134 1165
1135 CheckDownload(browser(), file, file); 1166 CheckDownload(browser(), file, file);
1136 } 1167 }
1137 1168
1138 // Navigate to a new background page, but don't download. Confirm that the 1169 // Navigate to a new background page, but don't download. Confirm that the
1139 // download shelf is not visible and that we have two tabs. 1170 // download shelf is not visible and that we have two tabs.
1140 IN_PROC_BROWSER_TEST_F(DownloadTest, DontCloseNewTab1) { 1171 IN_PROC_BROWSER_TEST_F(DownloadTest, DontCloseNewTab1) {
1141 ASSERT_TRUE(InitialSetup(false)); 1172 ASSERT_TRUE(InitialSetup(false));
1142 // Because it's an HTML link, it should open a web page rather than 1173 // Because it's an HTML link, it should open a web page rather than
1143 // downloading. 1174 // downloading.
(...skipping 23 matching lines...) Expand all
1167 GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); 1198 GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
1168 DownloadAndWaitWithDisposition( 1199 DownloadAndWaitWithDisposition(
1169 browser(), 1200 browser(),
1170 url, 1201 url,
1171 NEW_BACKGROUND_TAB, 1202 NEW_BACKGROUND_TAB,
1172 EXPECT_NO_SELECT_DIALOG, 1203 EXPECT_NO_SELECT_DIALOG,
1173 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); 1204 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
1174 1205
1175 // When the download finishes, we should still have one tab. 1206 // When the download finishes, we should still have one tab.
1176 CheckDownloadUIVisible(browser(), true, true); 1207 CheckDownloadUIVisible(browser(), true, true);
1208 CheckDownloadExistsInUI(browser(), file);
1177 EXPECT_EQ(1, browser()->tab_count()); 1209 EXPECT_EQ(1, browser()->tab_count());
1178 1210
1179 CheckDownload(browser(), file, file); 1211 CheckDownload(browser(), file, file);
1180 } 1212 }
1181 1213
1182 // Open a web page in the current tab, then download a file in another tab via 1214 // Open a web page in the current tab, then download a file in another tab via
1183 // a Javascript call. 1215 // a Javascript call.
1184 // Verify that we have 2 tabs, and the download shelf is visible in the current 1216 // Verify that we have 2 tabs, and the download shelf is visible in the current
1185 // tab. 1217 // tab.
1186 // 1218 //
(...skipping 12 matching lines...) Expand all
1199 // Download a file in a new tab and wait (via Javascript). 1231 // Download a file in a new tab and wait (via Javascript).
1200 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); 1232 FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
1201 DownloadAndWaitWithDisposition(browser(), 1233 DownloadAndWaitWithDisposition(browser(),
1202 GURL("javascript:openNew()"), 1234 GURL("javascript:openNew()"),
1203 CURRENT_TAB, 1235 CURRENT_TAB,
1204 EXPECT_NO_SELECT_DIALOG, 1236 EXPECT_NO_SELECT_DIALOG,
1205 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); 1237 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB);
1206 1238
1207 // When the download finishes, we should have two tabs. 1239 // When the download finishes, we should have two tabs.
1208 CheckDownloadUIVisible(browser(), true, true); 1240 CheckDownloadUIVisible(browser(), true, true);
1241 CheckDownloadExistsInUI(browser(), file);
1209 EXPECT_EQ(2, browser()->tab_count()); 1242 EXPECT_EQ(2, browser()->tab_count());
1210 1243
1211 CheckDownload(browser(), file, file); 1244 CheckDownload(browser(), file, file);
1212 } 1245 }
1213 1246
1214 // Open a web page in the current tab, open another tab via a Javascript call, 1247 // Open a web page in the current tab, open another tab via a Javascript call,
1215 // then download a file in the new tab. 1248 // then download a file in the new tab.
1216 // Verify that we have 2 tabs, and the download shelf is visible in the current 1249 // Verify that we have 2 tabs, and the download shelf is visible in the current
1217 // tab. 1250 // tab.
1218 // 1251 //
(...skipping 22 matching lines...) Expand all
1241 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); 1274 FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
1242 GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); 1275 GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
1243 DownloadAndWaitWithDisposition(browser(), 1276 DownloadAndWaitWithDisposition(browser(),
1244 url, 1277 url,
1245 CURRENT_TAB, 1278 CURRENT_TAB,
1246 EXPECT_NO_SELECT_DIALOG, 1279 EXPECT_NO_SELECT_DIALOG,
1247 ui_test_utils::BROWSER_TEST_NONE); 1280 ui_test_utils::BROWSER_TEST_NONE);
1248 1281
1249 // When the download finishes, we should have two tabs. 1282 // When the download finishes, we should have two tabs.
1250 CheckDownloadUIVisible(browser(), true, true); 1283 CheckDownloadUIVisible(browser(), true, true);
1284 CheckDownloadExistsInUI(browser(), file);
1251 EXPECT_EQ(2, browser()->tab_count()); 1285 EXPECT_EQ(2, browser()->tab_count());
1252 1286
1253 CheckDownload(browser(), file, file); 1287 CheckDownload(browser(), file, file);
1254 } 1288 }
1255 1289
1256 // Open a web page in the current tab, then download a file via Javascript, 1290 // Open a web page in the current tab, then download a file via Javascript,
1257 // which will do so in a temporary tab. 1291 // which will do so in a temporary tab.
1258 // Verify that we have 1 tab, and the download shelf is visible. 1292 // Verify that we have 1 tab, and the download shelf is visible.
1259 // 1293 //
1260 // The download_page3.html page contains an openNew() function that opens a 1294 // The download_page3.html page contains an openNew() function that opens a
(...skipping 13 matching lines...) Expand all
1274 // The file to download is "download-test1.lib". 1308 // The file to download is "download-test1.lib".
1275 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); 1309 FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
1276 DownloadAndWaitWithDisposition(browser(), 1310 DownloadAndWaitWithDisposition(browser(),
1277 GURL("javascript:openNew()"), 1311 GURL("javascript:openNew()"),
1278 CURRENT_TAB, 1312 CURRENT_TAB,
1279 EXPECT_NO_SELECT_DIALOG, 1313 EXPECT_NO_SELECT_DIALOG,
1280 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); 1314 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB);
1281 1315
1282 // When the download finishes, we should still have one tab. 1316 // When the download finishes, we should still have one tab.
1283 CheckDownloadUIVisible(browser(), true, true); 1317 CheckDownloadUIVisible(browser(), true, true);
1318 CheckDownloadExistsInUI(browser(), file);
1284 EXPECT_EQ(1, browser()->tab_count()); 1319 EXPECT_EQ(1, browser()->tab_count());
1285 1320
1286 CheckDownload(browser(), file, file); 1321 CheckDownload(browser(), file, file);
1287 } 1322 }
1288 1323
1289 // Open a web page in the current tab, then call Javascript via a button to 1324 // Open a web page in the current tab, then call Javascript via a button to
1290 // download a file in a new tab, which is closed automatically when the 1325 // download a file in a new tab, which is closed automatically when the
1291 // download begins. 1326 // download begins.
1292 // Verify that we have 1 tab, and the download shelf is visible. 1327 // Verify that we have 1 tab, and the download shelf is visible.
1293 // 1328 //
(...skipping 15 matching lines...) Expand all
1309 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); 1344 FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
1310 DownloadAndWaitWithDisposition( 1345 DownloadAndWaitWithDisposition(
1311 browser(), 1346 browser(),
1312 GURL("javascript:document.getElementById('form').submit()"), 1347 GURL("javascript:document.getElementById('form').submit()"),
1313 CURRENT_TAB, 1348 CURRENT_TAB,
1314 EXPECT_NO_SELECT_DIALOG, 1349 EXPECT_NO_SELECT_DIALOG,
1315 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); 1350 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB);
1316 1351
1317 // When the download finishes, we should still have one tab. 1352 // When the download finishes, we should still have one tab.
1318 CheckDownloadUIVisible(browser(), true, true); 1353 CheckDownloadUIVisible(browser(), true, true);
1354 CheckDownloadExistsInUI(browser(), file);
1319 EXPECT_EQ(1, browser()->tab_count()); 1355 EXPECT_EQ(1, browser()->tab_count());
1320 1356
1321 CheckDownload(browser(), file, file); 1357 CheckDownload(browser(), file, file);
1322 } 1358 }
1323 1359
1324 // Download a file in a new window. 1360 // Download a file in a new window.
1325 // Verify that we have 2 windows, and the download shelf is not visible in the 1361 // Verify that we have 2 windows, and the download shelf is not visible in the
1326 // first window, but is visible in the second window. 1362 // first window, but is visible in the second window.
1327 // Close the new window. 1363 // Close the new window.
1328 // Verify that we have 1 window, and the download shelf is not visible. 1364 // Verify that we have 1 window, and the download shelf is not visible.
(...skipping 12 matching lines...) Expand all
1341 DownloadAndWaitWithDisposition(browser(), 1377 DownloadAndWaitWithDisposition(browser(),
1342 url, 1378 url,
1343 NEW_WINDOW, 1379 NEW_WINDOW,
1344 EXPECT_NO_SELECT_DIALOG, 1380 EXPECT_NO_SELECT_DIALOG,
1345 ui_test_utils::BROWSER_TEST_NONE); 1381 ui_test_utils::BROWSER_TEST_NONE);
1346 1382
1347 // When the download finishes, the download shelf SHOULD NOT be visible in 1383 // When the download finishes, the download shelf SHOULD NOT be visible in
1348 // the first window. 1384 // the first window.
1349 ExpectWindowCountAfterDownload(2); 1385 ExpectWindowCountAfterDownload(2);
1350 EXPECT_EQ(1, browser()->tab_count()); 1386 EXPECT_EQ(1, browser()->tab_count());
1351 // Except on Chrome OS, where the download window sticks around. 1387 // Download shelf should close. Download panel stays open on ChromeOS.
1352 CheckDownloadUIVisible(browser(), false, true); 1388 CheckDownloadUIVisible(browser(), false, true);
1389 CheckDownloadExistsInUI(browser(), file);
1353 1390
1354 // The download shelf SHOULD be visible in the second window. 1391 // The download shelf SHOULD be visible in the second window.
1355 std::set<Browser*> original_browsers; 1392 std::set<Browser*> original_browsers;
1356 original_browsers.insert(browser()); 1393 original_browsers.insert(browser());
1357 Browser* download_browser = 1394 Browser* download_browser =
1358 ui_test_utils::GetBrowserNotInSet(original_browsers); 1395 ui_test_utils::GetBrowserNotInSet(original_browsers);
1359 ASSERT_TRUE(download_browser != NULL); 1396 ASSERT_TRUE(download_browser != NULL);
1360 EXPECT_NE(download_browser, browser()); 1397 EXPECT_NE(download_browser, browser());
1361 EXPECT_EQ(1, download_browser->tab_count()); 1398 EXPECT_EQ(1, download_browser->tab_count());
1362 CheckDownloadUIVisible(download_browser, true, true); 1399 CheckDownloadUIVisible(download_browser, true, true);
1400 CheckDownloadExistsInUI(download_browser, file);
1363 1401
1364 #if !defined(OS_MACOSX) 1402 #if !defined(OS_MACOSX)
1365 // On Mac OS X, the UI window close is delayed until the outermost 1403 // On Mac OS X, the UI window close is delayed until the outermost
1366 // message loop runs. So it isn't possible to get a BROWSER_CLOSED 1404 // message loop runs. So it isn't possible to get a BROWSER_CLOSED
1367 // notification inside of a test. 1405 // notification inside of a test.
1368 ui_test_utils::WindowedNotificationObserver signal( 1406 ui_test_utils::WindowedNotificationObserver signal(
1369 NotificationType::BROWSER_CLOSED, 1407 NotificationType::BROWSER_CLOSED,
1370 Source<Browser>(download_browser)); 1408 Source<Browser>(download_browser));
1371 #endif 1409 #endif
1372 1410
1373 // Close the new window. 1411 // Close the new window.
1374 download_browser->CloseWindow(); 1412 download_browser->CloseWindow();
1375 1413
1376 #if !defined(OS_MACOSX) 1414 #if !defined(OS_MACOSX)
1377 signal.Wait(); 1415 signal.Wait();
1378 EXPECT_EQ(first_browser, browser()); 1416 EXPECT_EQ(first_browser, browser());
1379 ExpectWindowCountAfterDownload(1); 1417 ExpectWindowCountAfterDownload(1);
1380 #endif 1418 #endif
1381 1419
1382 EXPECT_EQ(1, browser()->tab_count()); 1420 EXPECT_EQ(1, browser()->tab_count());
1383 // On ChromeOS, the popup sticks around. 1421 // Download shelf should close. Download panel stays open on ChromeOS.
1384 CheckDownloadUIVisible(browser(), false, true); 1422 CheckDownloadUIVisible(browser(), false, true);
1423 CheckDownloadExistsInUI(browser(), file);
1385 1424
1386 CheckDownload(browser(), file, file); 1425 CheckDownload(browser(), file, file);
1387 } 1426 }
1388 1427
1389 IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadCancelled) { 1428 IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadCancelled) {
1390 ASSERT_TRUE(InitialSetup(false)); 1429 ASSERT_TRUE(InitialSetup(false));
1391 EXPECT_EQ(1, browser()->tab_count()); 1430 EXPECT_EQ(1, browser()->tab_count());
1392 1431
1393 // TODO(rdsmith): Fragile code warning! The code below relies on the 1432 // TODO(rdsmith): Fragile code warning! The code below relies on the
1394 // DownloadsObserver only finishing when the new download has reached 1433 // DownloadsObserver only finishing when the new download has reached
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 flush_observer->WaitForFlush(); 1467 flush_observer->WaitForFlush();
1429 1468
1430 // Get the important info from other threads and check it. 1469 // Get the important info from other threads and check it.
1431 scoped_refptr<CancelTestDataCollector> info(new CancelTestDataCollector()); 1470 scoped_refptr<CancelTestDataCollector> info(new CancelTestDataCollector());
1432 info->WaitForDataCollected(); 1471 info->WaitForDataCollected();
1433 EXPECT_EQ(0, info->rdh_pending_requests()); 1472 EXPECT_EQ(0, info->rdh_pending_requests());
1434 EXPECT_EQ(0, info->dfm_pending_downloads()); 1473 EXPECT_EQ(0, info->dfm_pending_downloads());
1435 1474
1436 // Using "DownloadItem::Remove" follows the discard dangerous download path, 1475 // Using "DownloadItem::Remove" follows the discard dangerous download path,
1437 // which completely removes the browser from the shelf and closes the shelf 1476 // which completely removes the browser from the shelf and closes the shelf
1438 // if it was there. Chrome OS is an exception to this, where if we 1477 // if it was there. Download panel stays open on ChromeOS.
1439 // bring up the downloads panel, it stays there.
1440 CheckDownloadUIVisible(browser(), false, true); 1478 CheckDownloadUIVisible(browser(), false, true);
1441 } 1479 }
1442 1480
1443 // Confirm a download makes it into the history properly. 1481 // Confirm a download makes it into the history properly.
1444 IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadHistoryCheck) { 1482 IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadHistoryCheck) {
1445 ASSERT_TRUE(InitialSetup(false)); 1483 ASSERT_TRUE(InitialSetup(false));
1446 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); 1484 FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
1447 GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); 1485 GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
1448 FilePath origin_file(OriginFile(file)); 1486 FilePath origin_file(OriginFile(file));
1449 int64 origin_size; 1487 int64 origin_size;
1450 file_util::GetFileSize(origin_file, &origin_size); 1488 file_util::GetFileSize(origin_file, &origin_size);
1451 1489
1452 // Download the file and wait. We do not expect the Select File dialog. 1490 // Download the file and wait. We do not expect the Select File dialog.
1453 DownloadAndWait(browser(), url, EXPECT_NO_SELECT_DIALOG); 1491 DownloadAndWait(browser(), url, EXPECT_NO_SELECT_DIALOG);
1454 1492
1455 // Get details of what downloads have just happened. 1493 // Get details of what downloads have just happened.
1456 std::vector<DownloadItem*> downloads; 1494 std::vector<DownloadItem*> downloads;
1457 GetDownloads(browser(), &downloads); 1495 GetDownloads(browser(), &downloads);
1458 ASSERT_EQ(1u, downloads.size()); 1496 ASSERT_EQ(1u, downloads.size());
1459 int64 db_handle = downloads[0]->db_handle(); 1497 int64 db_handle = downloads[0]->db_handle();
1460 1498
1461 // Check state. 1499 // Check state.
1462 EXPECT_EQ(1, browser()->tab_count()); 1500 EXPECT_EQ(1, browser()->tab_count());
1463 CheckDownload(browser(), file, file); 1501 CheckDownload(browser(), file, file);
1464 CheckDownloadUIVisible(browser(), true, true); 1502 CheckDownloadUIVisible(browser(), true, true);
1503 CheckDownloadExistsInUI(browser(), file);
1465 1504
1466 // Check history results. 1505 // Check history results.
1467 DownloadsHistoryDataCollector history_collector( 1506 DownloadsHistoryDataCollector history_collector(
1468 db_handle, 1507 db_handle,
1469 browser()->profile()->GetDownloadManager()); 1508 browser()->profile()->GetDownloadManager());
1470 DownloadHistoryInfo info; 1509 DownloadHistoryInfo info;
1471 EXPECT_TRUE(history_collector.GetDownloadsHistoryEntry(&info)) << db_handle; 1510 EXPECT_TRUE(history_collector.GetDownloadsHistoryEntry(&info)) << db_handle;
1472 EXPECT_EQ(file, info.path.BaseName()); 1511 EXPECT_EQ(file, info.path.BaseName());
1473 EXPECT_EQ(url, info.url); 1512 EXPECT_EQ(url, info.url);
1474 // Ignore start_time. 1513 // Ignore start_time.
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1552 std::vector<DownloadItem*> downloads; 1591 std::vector<DownloadItem*> downloads;
1553 browser()->profile()->GetDownloadManager()->SearchDownloads( 1592 browser()->profile()->GetDownloadManager()->SearchDownloads(
1554 string16(), &downloads); 1593 string16(), &downloads);
1555 ASSERT_EQ(1u, downloads.size()); 1594 ASSERT_EQ(1u, downloads.size());
1556 EXPECT_EQ(DownloadItem::COMPLETE, downloads[0]->state()); 1595 EXPECT_EQ(DownloadItem::COMPLETE, downloads[0]->state());
1557 EXPECT_TRUE(downloads[0]->opened()); 1596 EXPECT_TRUE(downloads[0]->opened());
1558 1597
1559 // As long as we're here, confirmed everything else is good. 1598 // As long as we're here, confirmed everything else is good.
1560 EXPECT_EQ(1, browser()->tab_count()); 1599 EXPECT_EQ(1, browser()->tab_count());
1561 CheckDownload(browser(), file, file); 1600 CheckDownload(browser(), file, file);
1562 // Dissapears on most UIs, but the download panel sticks around for 1601 // Download shelf should close. Download panel stays open on ChromeOS.
1563 // chrome os.
1564 CheckDownloadUIVisible(browser(), false, true); 1602 CheckDownloadUIVisible(browser(), false, true);
1603 CheckDownloadExistsInUI(browser(), file);
1565 } 1604 }
1566 1605
1567 // Download an extension. Expect a dangerous download warning. 1606 // Download an extension. Expect a dangerous download warning.
1568 // Deny the download. 1607 // Deny the download.
1569 IN_PROC_BROWSER_TEST_F(DownloadTest, CrxDenyInstall) { 1608 IN_PROC_BROWSER_TEST_F(DownloadTest, CrxDenyInstall) {
1570 ASSERT_TRUE(InitialSetup(false)); 1609 ASSERT_TRUE(InitialSetup(false));
1571 GURL extension_url(URLRequestMockHTTPJob::GetMockUrl(kGoodCrxPath)); 1610 GURL extension_url(URLRequestMockHTTPJob::GetMockUrl(kGoodCrxPath));
1572 1611
1573 scoped_ptr<DownloadsObserver> observer( 1612 scoped_ptr<DownloadsObserver> observer(
1574 DangerousInstallWaiter(browser(), 1613 DangerousInstallWaiter(browser(),
1575 1, 1614 1,
1576 DownloadItem::CANCELLED, 1615 DownloadItem::CANCELLED,
1577 ON_DANGEROUS_DOWNLOAD_DENY)); 1616 ON_DANGEROUS_DOWNLOAD_DENY));
1578 ui_test_utils::NavigateToURL(browser(), extension_url); 1617 ui_test_utils::NavigateToURL(browser(), extension_url);
1579 1618
1580 observer->WaitForFinished(); 1619 observer->WaitForFinished();
1581 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen()); 1620 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen());
1582 1621
1622 // Download shelf should close. Download panel stays open on ChromeOS.
1583 CheckDownloadUIVisible(browser(), false, true); 1623 CheckDownloadUIVisible(browser(), false, true);
1584 1624
1585 // Check that the CRX is not installed. 1625 // Check that the CRX is not installed.
1586 ExtensionService* extension_service = 1626 ExtensionService* extension_service =
1587 browser()->profile()->GetExtensionService(); 1627 browser()->profile()->GetExtensionService();
1588 ASSERT_FALSE(extension_service->GetExtensionById(kGoodCrxId, false)); 1628 ASSERT_FALSE(extension_service->GetExtensionById(kGoodCrxId, false));
1589 } 1629 }
1590 1630
1591 // Download an extension. Expect a dangerous download warning. 1631 // Download an extension. Expect a dangerous download warning.
1592 // Allow the download, deny the install. 1632 // Allow the download, deny the install.
1593 IN_PROC_BROWSER_TEST_F(DownloadTest, CrxInstallDenysPermissions) { 1633 IN_PROC_BROWSER_TEST_F(DownloadTest, CrxInstallDenysPermissions) {
1594 ASSERT_TRUE(InitialSetup(false)); 1634 ASSERT_TRUE(InitialSetup(false));
1595 GURL extension_url(URLRequestMockHTTPJob::GetMockUrl(kGoodCrxPath)); 1635 GURL extension_url(URLRequestMockHTTPJob::GetMockUrl(kGoodCrxPath));
1596 1636
1597 // Install a mock install UI that simulates a user denying permission to 1637 // Install a mock install UI that simulates a user denying permission to
1598 // finish the install. 1638 // finish the install.
1599 download_crx_util::SetMockInstallUIForTesting( 1639 download_crx_util::SetMockInstallUIForTesting(
1600 new MockAbortExtensionInstallUI()); 1640 new MockAbortExtensionInstallUI());
1601 1641
1602 scoped_ptr<DownloadsObserver> observer( 1642 scoped_ptr<DownloadsObserver> observer(
1603 DangerousInstallWaiter(browser(), 1643 DangerousInstallWaiter(browser(),
1604 1, 1644 1,
1605 DownloadItem::COMPLETE, 1645 DownloadItem::COMPLETE,
1606 ON_DANGEROUS_DOWNLOAD_ACCEPT)); 1646 ON_DANGEROUS_DOWNLOAD_ACCEPT));
1607 ui_test_utils::NavigateToURL(browser(), extension_url); 1647 ui_test_utils::NavigateToURL(browser(), extension_url);
1608 1648
1609 observer->WaitForFinished(); 1649 observer->WaitForFinished();
1610 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen()); 1650 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen());
1611 1651
1612 // DL Shelf should close. Download panel sticks around on ChromeOS. 1652 // Download shelf should close. Download panel stays open on ChromeOS.
1613 CheckDownloadUIVisible(browser(), false, true); 1653 CheckDownloadUIVisible(browser(), false, true);
1614 1654
1615 // Check that the extension was not installed. 1655 // Check that the extension was not installed.
1616 ExtensionService* extension_service = 1656 ExtensionService* extension_service =
1617 browser()->profile()->GetExtensionService(); 1657 browser()->profile()->GetExtensionService();
1618 ASSERT_FALSE(extension_service->GetExtensionById(kGoodCrxId, false)); 1658 ASSERT_FALSE(extension_service->GetExtensionById(kGoodCrxId, false));
1619 } 1659 }
1620 1660
1621 // Download an extension. Expect a dangerous download warning. 1661 // Download an extension. Expect a dangerous download warning.
1622 // Allow the download, and the install. 1662 // Allow the download, and the install.
1623 IN_PROC_BROWSER_TEST_F(DownloadTest, CrxInstallAcceptPermissions) { 1663 IN_PROC_BROWSER_TEST_F(DownloadTest, CrxInstallAcceptPermissions) {
1624 ASSERT_TRUE(InitialSetup(false)); 1664 ASSERT_TRUE(InitialSetup(false));
1625 GURL extension_url(URLRequestMockHTTPJob::GetMockUrl(kGoodCrxPath)); 1665 GURL extension_url(URLRequestMockHTTPJob::GetMockUrl(kGoodCrxPath));
1626 1666
1627 // Install a mock install UI that simulates a user allowing permission to 1667 // Install a mock install UI that simulates a user allowing permission to
1628 // finish the install. 1668 // finish the install.
1629 download_crx_util::SetMockInstallUIForTesting( 1669 download_crx_util::SetMockInstallUIForTesting(
1630 new MockAutoConfirmExtensionInstallUI(browser()->profile())); 1670 new MockAutoConfirmExtensionInstallUI(browser()->profile()));
1631 1671
1632 scoped_ptr<DownloadsObserver> observer( 1672 scoped_ptr<DownloadsObserver> observer(
1633 DangerousInstallWaiter(browser(), 1673 DangerousInstallWaiter(browser(),
1634 1, 1674 1,
1635 DownloadItem::COMPLETE, 1675 DownloadItem::COMPLETE,
1636 ON_DANGEROUS_DOWNLOAD_ACCEPT)); 1676 ON_DANGEROUS_DOWNLOAD_ACCEPT));
1637 ui_test_utils::NavigateToURL(browser(), extension_url); 1677 ui_test_utils::NavigateToURL(browser(), extension_url);
1638 1678
1639 observer->WaitForFinished(); 1679 observer->WaitForFinished();
1640 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen()); 1680 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen());
1641 1681
1642 // DL Shelf should close. Download panel sticks around on ChromeOS. 1682 // Download shelf should close. Download panel stays open on ChromeOS.
1643 CheckDownloadUIVisible(browser(), false, true); 1683 CheckDownloadUIVisible(browser(), false, true);
1644 1684
1645 // Check that the extension was installed. 1685 // Check that the extension was installed.
1646 ExtensionService* extension_service = 1686 ExtensionService* extension_service =
1647 browser()->profile()->GetExtensionService(); 1687 browser()->profile()->GetExtensionService();
1648 ASSERT_TRUE(extension_service->GetExtensionById(kGoodCrxId, false)); 1688 ASSERT_TRUE(extension_service->GetExtensionById(kGoodCrxId, false));
1649 } 1689 }
1650 1690
1651 // Test installing a CRX that fails integrity checks. 1691 // Test installing a CRX that fails integrity checks.
1652 IN_PROC_BROWSER_TEST_F(DownloadTest, CrxInvalid) { 1692 IN_PROC_BROWSER_TEST_F(DownloadTest, CrxInvalid) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 scoped_ptr<DownloadsObserver> observer( 1728 scoped_ptr<DownloadsObserver> observer(
1689 DangerousInstallWaiter(browser(), 1729 DangerousInstallWaiter(browser(),
1690 1, 1730 1,
1691 DownloadItem::COMPLETE, 1731 DownloadItem::COMPLETE,
1692 ON_DANGEROUS_DOWNLOAD_ACCEPT)); 1732 ON_DANGEROUS_DOWNLOAD_ACCEPT));
1693 ui_test_utils::NavigateToURL(browser(), extension_url); 1733 ui_test_utils::NavigateToURL(browser(), extension_url);
1694 1734
1695 observer->WaitForFinished(); 1735 observer->WaitForFinished();
1696 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen()); 1736 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen());
1697 1737
1698 // DL Shelf should close. Download panel sticks around on ChromeOS. 1738 // Download shelf should close. Download panel stays open on ChromeOS.
1699 CheckDownloadUIVisible(browser(), false, true); 1739 CheckDownloadUIVisible(browser(), false, true);
1700 1740
1701 // Check that the extension was installed. 1741 // Check that the extension was installed.
1702 ExtensionService* extension_service = 1742 ExtensionService* extension_service =
1703 browser()->profile()->GetExtensionService(); 1743 browser()->profile()->GetExtensionService();
1704 ASSERT_TRUE(extension_service->GetExtensionById(kLargeThemeCrxId, false)); 1744 ASSERT_TRUE(extension_service->GetExtensionById(kLargeThemeCrxId, false));
1705 } 1745 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698