Chromium Code Reviews| Index: chrome/browser/download/save_page_browsertest.cc |
| diff --git a/chrome/browser/download/save_page_browsertest.cc b/chrome/browser/download/save_page_browsertest.cc |
| index 096dcb27322a71a1144582760a1533697d0f0fea..aeee2c78f04481b5b2c74e24f617ccc1300e8d37 100644 |
| --- a/chrome/browser/download/save_page_browsertest.cc |
| +++ b/chrome/browser/download/save_page_browsertest.cc |
| @@ -155,12 +155,14 @@ class SavePageBrowserTest : public InProcessBrowserTest { |
| } |
| bool operator() (const DownloadPersistentStoreInfo& info) const { |
| - return info.url == url_ && |
| - info.path == path_ && |
| - // For save packages, received bytes is actually the number of files. |
| - info.received_bytes == num_files_ && |
| - info.total_bytes == 0 && |
| - info.state == DownloadItem::COMPLETE; |
| + return ((info.url == url_) && |
|
Randy Smith (Not in Mondays)
2012/05/14 17:55:19
My personal feeling is that parens around the == i
benjhayden
2012/05/14 19:27:37
My personal feeling is that ungrouped conditions a
|
| + (info.path == path_) && |
| + // For non-MHTML save packages, received_bytes is actually the |
| + // number of files. |
|
Randy Smith (Not in Mondays)
2012/05/14 17:55:19
Instead of just putting in an off switch, can you
benjhayden
2012/05/14 19:27:37
Renaming the variable won't fix the problem.
The p
|
| + ((num_files_ < 0) || |
| + (info.received_bytes == num_files_)) && |
| + (info.total_bytes == 0) && |
| + (info.state == DownloadItem::COMPLETE)); |
| } |
| GURL url_; |
| @@ -388,9 +390,7 @@ class SavePageAsMHTMLBrowserTest : public SavePageBrowserTest { |
| SavePageAsMHTMLBrowserTest::~SavePageAsMHTMLBrowserTest() { |
| } |
| -// Bug 127527: This test fails when the day of the month is >9. |
| -IN_PROC_BROWSER_TEST_F(SavePageAsMHTMLBrowserTest, DISABLED_SavePageAsMHTML) { |
| - static const int64 kFileSize = 2759; |
| +IN_PROC_BROWSER_TEST_F(SavePageAsMHTMLBrowserTest, SavePageAsMHTML) { |
| GURL url = NavigateToMockURL("b"); |
| FilePath download_dir = DownloadPrefs::FromDownloadManager( |
| GetDownloadManager())->download_path(); |
| @@ -406,10 +406,10 @@ IN_PROC_BROWSER_TEST_F(SavePageAsMHTMLBrowserTest, DISABLED_SavePageAsMHTML) { |
| content::NotificationService::AllSources()); |
| browser()->SavePage(); |
| observer.Wait(); |
| - CheckDownloadHistory(url, full_file_name, kFileSize); |
| + CheckDownloadHistory(url, full_file_name, -1); |
| EXPECT_TRUE(file_util::PathExists(full_file_name)); |
| int64 actual_file_size = -1; |
| EXPECT_TRUE(file_util::GetFileSize(full_file_name, &actual_file_size)); |
| - EXPECT_EQ(kFileSize, actual_file_size); |
| + EXPECT_LE(2758, actual_file_size); |
|
Randy Smith (Not in Mondays)
2012/05/14 17:55:19
I dislike this type of naked constant. Is there s
benjhayden
2012/05/14 19:27:37
Done.
|
| } |