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

Unified Diff: content/browser/download/mock_download_item.h

Issue 8503018: Split DownloadItem into an ABC, an Impl, and a Mock. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: " Created 9 years, 1 month 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: content/browser/download/mock_download_item.h
diff --git a/content/browser/download/mock_download_item.h b/content/browser/download/mock_download_item.h
new file mode 100644
index 0000000000000000000000000000000000000000..cb0341f1a495ed87ca13d697fe8f163c3987947e
--- /dev/null
+++ b/content/browser/download/mock_download_item.h
@@ -0,0 +1,102 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_ITEM_H_
+#define CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_ITEM_H_
+
+#include <string>
+#include <vector>
+
+#include "content/browser/download/download_item.h"
+#include "content/browser/download/download_persistent_store_info.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+class MockDownloadItem : public DownloadItem {
Randy Smith (Not in Mondays) 2011/11/09 17:09:57 If you're very clear that you're going to be using
benjhayden 2011/11/11 22:31:12 I'm going to use it in the unittest for DownloadQu
+ public:
+ MOCK_METHOD1(AddObserver, void(DownloadItem::Observer*));
+ MOCK_METHOD1(RemoveObserver, void(DownloadItem::Observer*));
+ MOCK_METHOD0(UpdateObservers, void());
+ MOCK_METHOD0(CanShowInFolder, bool());
+ MOCK_METHOD0(CanOpenDownload, bool());
+ MOCK_METHOD0(ShouldOpenFileBasedOnExtension, bool());
+ MOCK_METHOD0(OpenDownload, void());
+ MOCK_METHOD0(ShowDownloadInShell, void());
+ MOCK_METHOD0(DangerousDownloadValidated, void());
+ MOCK_METHOD1(Update, void(int64));
+ MOCK_METHOD1(Cancel, void(bool));
+ MOCK_METHOD0(MarkAsComplete, void());
+ MOCK_METHOD0(DelayedDownloadOpened, void());
+ MOCK_METHOD1(OnAllDataSaved, void(int64));
+ MOCK_METHOD0(OnDownloadedFileRemoved, void());
+ MOCK_METHOD2(Interrupted, void(int64, InterruptReason));
+ MOCK_METHOD1(Delete, void(DeleteReason));
+ MOCK_METHOD0(Remove, void());
+ MOCK_CONST_METHOD1(TimeRemaining, bool(base::TimeDelta*));
+ MOCK_CONST_METHOD0(CurrentSpeed, int64());
+ MOCK_CONST_METHOD0(PercentComplete, int());
+ MOCK_METHOD1(OnPathDetermined, void(const FilePath&));
+ MOCK_CONST_METHOD0(all_data_saved, bool());
+ MOCK_METHOD1(SetFileCheckResults, void(const DownloadStateInfo&));
+ MOCK_METHOD1(Rename, void(const FilePath& full_path));
+ MOCK_METHOD0(TogglePause, void());
+ MOCK_METHOD1(OnDownloadCompleting, void(DownloadFileManager*));
+ MOCK_METHOD1(OnDownloadRenamedToFinalName, void(const FilePath&));
+ MOCK_CONST_METHOD1(MatchesQuery, bool(const string16& query));
+ MOCK_CONST_METHOD0(IsPartialDownload, bool());
+ MOCK_CONST_METHOD0(IsInProgress, bool());
+ MOCK_CONST_METHOD0(IsCancelled, bool());
+ MOCK_CONST_METHOD0(IsInterrupted, bool());
+ MOCK_CONST_METHOD0(IsComplete, bool());
+ MOCK_CONST_METHOD0(state, DownloadState());
+ MOCK_CONST_METHOD0(full_path, const FilePath&());
+ MOCK_METHOD1(set_path_uniquifier, void(int));
+ MOCK_CONST_METHOD0(url_chain, const std::vector<GURL>&());
+ MOCK_METHOD1(set_total_bytes, void(int64));
+ MOCK_CONST_METHOD0(GetURL, const GURL&());
+ MOCK_CONST_METHOD0(original_url, const GURL&());
+ MOCK_CONST_METHOD0(referrer_url, const GURL&());
+ MOCK_CONST_METHOD0(suggested_filename, std::string());
+ MOCK_CONST_METHOD0(content_disposition, std::string());
+ MOCK_CONST_METHOD0(mime_type, std::string());
+ MOCK_CONST_METHOD0(original_mime_type, std::string());
+ MOCK_CONST_METHOD0(referrer_charset, std::string());
+ MOCK_CONST_METHOD0(total_bytes, int64());
+ MOCK_CONST_METHOD0(received_bytes, int64());
+ MOCK_CONST_METHOD0(id, int32());
+ MOCK_CONST_METHOD0(global_id, DownloadId());
+ MOCK_CONST_METHOD0(start_time, base::Time());
+ MOCK_CONST_METHOD0(end_time, base::Time());
+ MOCK_METHOD1(set_db_handle, void(int64));
+ MOCK_CONST_METHOD0(db_handle, int64());
+ MOCK_METHOD0(download_manager, DownloadManager*());
+ MOCK_CONST_METHOD0(is_paused, bool());
+ MOCK_CONST_METHOD0(open_when_complete, bool());
+ MOCK_METHOD1(set_open_when_complete, void(bool));
+ MOCK_CONST_METHOD0(file_externally_removed, bool());
+ MOCK_CONST_METHOD0(safety_state, SafetyState());
+ MOCK_CONST_METHOD0(GetDangerType, DangerType());
+ MOCK_CONST_METHOD0(IsDangerous, bool());
+ MOCK_METHOD0(MarkFileDangerous, void());
+ MOCK_METHOD0(MarkUrlDangerous, void());
+ MOCK_METHOD0(auto_opened, bool());
+ MOCK_CONST_METHOD0(target_name, const FilePath&());
+ MOCK_CONST_METHOD0(prompt_user_for_save_location, bool());
+ MOCK_CONST_METHOD0(is_otr, bool());
+ MOCK_CONST_METHOD0(suggested_path, const FilePath&());
+ MOCK_CONST_METHOD0(is_temporary, bool());
+ MOCK_METHOD1(set_opened, void(bool));
+ MOCK_CONST_METHOD0(opened, bool());
+ MOCK_CONST_METHOD0(last_reason, InterruptReason());
+ MOCK_CONST_METHOD0(GetPersistentStoreInfo, DownloadPersistentStoreInfo());
+ MOCK_CONST_METHOD0(state_info, DownloadStateInfo());
+ MOCK_CONST_METHOD0(GetTabContents, TabContents*());
+ MOCK_CONST_METHOD0(GetTargetFilePath, FilePath());
+ MOCK_CONST_METHOD0(GetFileNameToReportUser, FilePath());
+ MOCK_CONST_METHOD0(GetUserVerifiedFilePath, FilePath());
+ MOCK_CONST_METHOD0(NeedsRename, bool());
+ MOCK_METHOD1(OffThreadCancel, void(DownloadFileManager* file_manager));
+ MOCK_CONST_METHOD1(DebugString, std::string(bool));
+ MOCK_METHOD0(MockDownloadOpenForTesting, void());
+};
+#endif // CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_ITEM_H_

Powered by Google App Engine
This is Rietveld 408576698