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

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

Issue 10977073: Delete some unused code found by -Wunused-function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: leiz Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::WebContents; 54 using content::WebContents;
55 55
56 namespace { 56 const FilePath::CharType kTestDir[] = FILE_PATH_LITERAL("save_page");
57 57
58 static const FilePath::CharType* kTestDir = FILE_PATH_LITERAL("save_page"); 58 const char kAppendedExtension[] =
59
60 static const char* kAppendedExtension =
61 #if defined(OS_WIN) 59 #if defined(OS_WIN)
62 ".htm"; 60 ".htm";
63 #else 61 #else
64 ".html"; 62 ".html";
65 #endif 63 #endif
66 64
67 void NullFunction() {
68 }
69
70 } // namespace
71
72 // Loosely based on logic in DownloadTestObserver. 65 // Loosely based on logic in DownloadTestObserver.
73 class DownloadItemCreatedObserver : public DownloadManager::Observer { 66 class DownloadItemCreatedObserver : public DownloadManager::Observer {
74 public: 67 public:
75 explicit DownloadItemCreatedObserver(DownloadManager* manager) 68 explicit DownloadItemCreatedObserver(DownloadManager* manager)
76 : waiting_(false), manager_(manager) { 69 : waiting_(false), manager_(manager) {
77 manager->AddObserver(this); 70 manager->AddObserver(this);
78 } 71 }
79 72
80 ~DownloadItemCreatedObserver() { 73 ~DownloadItemCreatedObserver() {
81 if (manager_) 74 if (manager_)
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 content::NotificationService::AllSources()); 639 content::NotificationService::AllSources());
647 chrome::SavePage(browser()); 640 chrome::SavePage(browser());
648 observer.Wait(); 641 observer.Wait();
649 CheckDownloadHistory(url, full_file_name, -1, DownloadItem::COMPLETE); 642 CheckDownloadHistory(url, full_file_name, -1, DownloadItem::COMPLETE);
650 643
651 EXPECT_TRUE(file_util::PathExists(full_file_name)); 644 EXPECT_TRUE(file_util::PathExists(full_file_name));
652 int64 actual_file_size = -1; 645 int64 actual_file_size = -1;
653 EXPECT_TRUE(file_util::GetFileSize(full_file_name, &actual_file_size)); 646 EXPECT_TRUE(file_util::GetFileSize(full_file_name, &actual_file_size));
654 EXPECT_LE(kFileSizeMin, actual_file_size); 647 EXPECT_LE(kFileSizeMin, actual_file_size);
655 } 648 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698