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

Unified Diff: chrome/browser/download/save_page_browsertest.cc

Issue 10392082: Fix SavePageAsMHTMLBrowserTest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..28a084752d2280a6d7df3bfb64378851f7ce962d 100644
--- a/chrome/browser/download/save_page_browsertest.cc
+++ b/chrome/browser/download/save_page_browsertest.cc
@@ -156,11 +156,13 @@ 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;
+ info.path == path_ &&
+ // For non-MHTML save packages, received_bytes is actually the
+ // number of files.
+ ((num_files_ < 0) ||
+ (info.received_bytes == num_files_)) &&
+ info.total_bytes == 0 &&
+ info.state == DownloadItem::COMPLETE;
}
GURL url_;
@@ -388,9 +390,8 @@ 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) {
+ static const int64 kFileSizeMin = 2758;
GURL url = NavigateToMockURL("b");
FilePath download_dir = DownloadPrefs::FromDownloadManager(
GetDownloadManager())->download_path();
@@ -406,10 +407,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(kFileSizeMin, actual_file_size);
}
« 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