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

Unified Diff: chrome/browser/ui/browser_close_browsertest.cc

Issue 26938003: Don't prompt to save malicious downloads on exit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated comments Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/browser_close_browsertest.cc
diff --git a/chrome/browser/ui/browser_close_browsertest.cc b/chrome/browser/ui/browser_close_browsertest.cc
index 4f2b14503671a1d1a37b75478829cea3db9a3379..7dbd19d97b206ce76d386af825731bb809a1347b 100644
--- a/chrome/browser/ui/browser_close_browsertest.cc
+++ b/chrome/browser/ui/browser_close_browsertest.cc
@@ -255,6 +255,8 @@ class BrowserCloseTest : public InProcessBrowserTest {
// an assertion has failed and the test should be aborted.
bool ExecuteDownloadCloseCheckCase(size_t i) {
const DownloadsCloseCheckCase& check_case(download_close_check_cases[i]);
+ SCOPED_TRACE(testing::Message() << "Case" << i
+ << ": " << check_case.DebugString());
Peter Kasting 2013/10/15 19:10:28 Nit: <<s should line up; try SCOPED_TRACE(tes
felt 2013/10/18 01:50:53 Done.
// Test invariant: so that we don't actually try and close the browser,
// we always enter the function with a single browser window open on the
@@ -270,18 +272,14 @@ class BrowserCloseTest : public InProcessBrowserTest {
return false;
Browser* entry_browser = FirstUnclosedBrowser();
- EXPECT_EQ(first_profile_, entry_browser->profile())
- << "Case" << i
- << ": " << check_case.DebugString();
+ EXPECT_EQ(first_profile_, entry_browser->profile());
if (first_profile_ != entry_browser->profile())
return false;
Peter Kasting 2013/10/15 19:10:28 Don't EXPECT_EQ and then handle failure; if you tr
felt 2013/10/18 01:50:53 This isn't my test -- I am just tweaking someone e
- int total_download_count = DownloadService::DownloadCountAllProfiles();
- EXPECT_EQ(0, total_download_count)
- << "Case " << i
- << ": " << check_case.DebugString();
+ int total_download_count =
+ DownloadService::NonDangerousDownloadCountAllProfiles();
+ EXPECT_EQ(0, total_download_count);
if (0 != total_download_count)
return false;
-
Profile* first_profile_incognito = first_profile_->GetOffTheRecordProfile();
Profile* second_profile_incognito =
second_profile_->GetOffTheRecordProfile();
@@ -356,12 +354,9 @@ class BrowserCloseTest : public InProcessBrowserTest {
Browser::DownloadClosePreventionType type =
browser_to_probe->OkToCloseWithInProgressDownloads(
&num_downloads_blocking);
- EXPECT_EQ(check_case.type, type) << "Case " << i
- << ": " << check_case.DebugString();
+ EXPECT_EQ(check_case.type, type);
if (type != Browser::DOWNLOAD_CLOSE_OK)
- EXPECT_EQ(check_case.num_blocking, num_downloads_blocking)
- << "Case " << i
- << ": " << check_case.DebugString();
+ EXPECT_EQ(check_case.num_blocking, num_downloads_blocking);
// Release all the downloads.
CompleteAllDownloads(browser_to_probe);

Powered by Google App Engine
This is Rietveld 408576698