OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "chrome/browser/download/save_package_file_picker_chromeos.h" | 44 #include "chrome/browser/download/save_package_file_picker_chromeos.h" |
45 #else | 45 #else |
46 #include "chrome/browser/download/save_package_file_picker.h" | 46 #include "chrome/browser/download/save_package_file_picker.h" |
47 #endif | 47 #endif |
48 | 48 |
49 using content::BrowserContext; | 49 using content::BrowserContext; |
50 using content::BrowserThread; | 50 using content::BrowserThread; |
51 using content::DownloadItem; | 51 using content::DownloadItem; |
52 using content::DownloadManager; | 52 using content::DownloadManager; |
53 using content::DownloadPersistentStoreInfo; | 53 using content::DownloadPersistentStoreInfo; |
| 54 using content::URLRequestMockHTTPJob; |
54 using content::WebContents; | 55 using content::WebContents; |
55 | 56 |
56 const FilePath::CharType kTestDir[] = FILE_PATH_LITERAL("save_page"); | 57 const FilePath::CharType kTestDir[] = FILE_PATH_LITERAL("save_page"); |
57 | 58 |
58 const char kAppendedExtension[] = | 59 const char kAppendedExtension[] = |
59 #if defined(OS_WIN) | 60 #if defined(OS_WIN) |
60 ".htm"; | 61 ".htm"; |
61 #else | 62 #else |
62 ".html"; | 63 ".html"; |
63 #endif | 64 #endif |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 GURL output_url; | 639 GURL output_url; |
639 ASSERT_TRUE(WaitForSavePackageToFinish(&output_url)); | 640 ASSERT_TRUE(WaitForSavePackageToFinish(&output_url)); |
640 EXPECT_EQ(url, output_url); | 641 EXPECT_EQ(url, output_url); |
641 CheckDownloadHistory(url, full_file_name, -1, DownloadItem::COMPLETE); | 642 CheckDownloadHistory(url, full_file_name, -1, DownloadItem::COMPLETE); |
642 | 643 |
643 EXPECT_TRUE(file_util::PathExists(full_file_name)); | 644 EXPECT_TRUE(file_util::PathExists(full_file_name)); |
644 int64 actual_file_size = -1; | 645 int64 actual_file_size = -1; |
645 EXPECT_TRUE(file_util::GetFileSize(full_file_name, &actual_file_size)); | 646 EXPECT_TRUE(file_util::GetFileSize(full_file_name, &actual_file_size)); |
646 EXPECT_LE(kFileSizeMin, actual_file_size); | 647 EXPECT_LE(kFileSizeMin, actual_file_size); |
647 } | 648 } |
OLD | NEW |